[SOLVED] Persistent Jessie Live USB

Help with issues regarding installation of Debian

[SOLVED] Persistent Jessie Live USB

Postby HisDudeness » 2015-10-28 23:28

Hi! I'm trying to create a persistent live Jessie system on my 8GB USB drive.

If that matters, I'm currently on an Arch Linux system, and I partly followed what's on the relative wiki (Pages Create a new MBR for a USB stick, Manually create a USB flash installation and Install Syslinux), plus a CrunchBang post explaining how to make a persistent live USB out of any Jessie-deriving distro (like their BunsenLabs Hydrogen).

The problem is, even if Debian boots up more than fine, the system isn't persistent at all.

Here's what I did (I know some passages are redundant, but still...):
  1. Donwloaded the Cinnamon flavor of Jessie via torrent
  2. Erased the old MBR
    Code: Select all
    # dd if=/dev/zero of=/dev/sdb bs=512 count=1 && sync
  3. Created a 1.1G W95 FAT32 (LBA) active partition and used the remaining space on a Linux partition
  4. Formatted the first to FAT32 and labelled it "Debian64". Formatted the second to ext4 and labelled it "persistence"
    Code: Select all
    # mkfs.vfat -n Debian64 /dev/sdb1
    # mkfs.ext4 /dev/sdb2 -L persistence
  5. Mounted the first partition and the iso
    Code: Select all
    # mkdir /mnt/{iso,usb}
    # mount /dev/sdb1 /mnt/usb
    # mount -o loop debian-live-8.2.0-amd64-cinnamon-desktop.iso /mnt/iso
  6. Copied all files inside the iso to the USB
    Code: Select all
    # cp -a /mnt/iso/* /mnt/usb/ && sync
  7. Copied all .c32 files from the extlinux installed in my system to my USB
    Code: Select all
    # cp /usr/lib/syslinux/bios/*.c32 /mnt/usb/isolinux
  8. Installed extlinux to the USB
    Code: Select all
    # extlinux --install /mnt/usb/isolinux
  9. Wrote exlinux MBR to my USB
    Code: Select all
    # dd bs=440 count=1 if=/usr/lib/syslinux/bios/mbr.bin of=/dev/sdb
  10. Copied this syslinux.cfg in my isolinux folder
    (You'll notice that the syslinux.cfg file already has the "persistence" attribute after "boot=live", and it is programmed to load a fancy splash screen at 1366x768, my laptop's resolution)
  11. Created persistence.conf file inside the second partition
    Code: Select all
    # mkdir /mnt/pers
    # mount /dev/sdb2 /mnt/pers
    # echo / union > /mnt/pers/persistence.conf
  12. Unmounted everything and rebooted

Anyone has any clue of what I did wrong?
Last edited by HisDudeness on 2015-10-29 09:07, edited 1 time in total.
The Dude minds.
User avatar
HisDudeness
 
Posts: 21
Joined: 2012-07-30 15:54
Location: Melzo (Italy)

Re: Persistent Jessie Live USB

Postby GarryRicketson » 2015-10-29 02:19

Anyone has any clue of what I did wrong?


You are really complicating something that is so simple ( I think),
I can't even come close to making any sense of what you did,..
This is the simple way:

I use
Code: Select all
lsblk

To determine what the usb device is. It should be something like
for example:
Code: Select all
$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk
├─sda1   8:1    0 244.4G  0 part /
├─sda2   8:2    0     1K  0 part
├─sda3   8:3    0  50.7G  0 part
├─sda4   8:4    0   127G  0 part
├─sda5   8:5    0   4.7G  0 part
└─sda6   8:6    0    39G  0 part
sr0     11:0    1  1024M  0 rom 
sdc      8:32   1  14.7G  0 disk
├─sdc1   8:33   1  12.6G  0 part /media/rootMX
└─sdc2   8:34   1     2G  0 part

In mine here, the USB stick is all ready partitioned, and is using MX14 , not Debian , but that is not important. The point being "lsblk" shows me it is "sdc" "sdc1" and "sdc2"
If it is a clean usb stick with nothing it would just show "sdc" and maybe "sdc1",.it might also be "sdb", and not sdc. So anyway, then I use the "dd" command,
Code: Select all
 # dd if=debian-live-8.0.0-i386-mate-desktop.iso of=/dev/sdc bs=4M; sync

Here I was using the Debian with mate "live" iso, You will want to use the full file name and path to whatever ISO you are using,
It will take some time, depending on your system, on mine it takes about a hour, well maybe less, half a hour, when I do this, after I run the command, I leave it and do something else for a while, usually when I get back it is finished. It will show, if it was successfull or not.
Also see :
Code: Select all
man dd

Take NOTE: IMPORTANT! It is very important you make sure you write the dd command to point to the correct device, it can and will overwrite what ever device or partition it is pointed to.

You can also look at this :https://wiki.debian.org/BootUsb and
From:
https://www.debian.org/CD/faq/#write-usb

How do I write a CD/DVD/BD image to a USB flash drive?

Several of the Debian and Debian Live images, notably all i386, amd64 and arm64 images, are created using the isohybrid technology, which means that they may be used in two different ways:

They may be written to CD/DVD/BD and used as normal for CD/DVD/BD booting.
They may be written to USB flash drives, bootable directly from the BIOS / EFI firmware of most PCs.
On a Linux machine, simply use the cp command, to copy an image to a USB flash drive:

Code: Select all
cp <file> <device>

Alternatively you can also use dd:

dd if=<file> of=<device> bs=4M; sync
Last edited by GarryRicketson on 2015-10-29 07:08, edited 1 time in total.
User avatar
GarryRicketson
 
Posts: 3859
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Persistent Jessie Live USB

Postby spacex » 2015-10-29 02:42

Here is how I do it:
[url][http://syn.theti.ca/2013/06/22/tutorial-wheezy-live-iso-hybrid-with-persistence-on-usb//url]

Works for Jessie also.
spacex
 
Posts: 633
Joined: 2015-01-17 01:27

Re: Persistent Jessie Live USB

Postby HisDudeness » 2015-10-29 06:34

GarryRicketson wrote:You are really complicating something that is so simple ( I think),
I can't even come close to making any sense of what you did,..


Thanks for your answer. Unfortunately, that's not what I'm doing. I'm trying to make a persistent live boot, which means that any changes applied to the system (new programs installed, programs uninstalled, keyboard layout changed etc.) will be kept on next boot.

spacex wrote:Here is how I do it:
[url][http://syn.theti.ca/2013/06/22/tutorial-wheezy-live-iso-hybrid-with-persistence-on-usb//url]

Works for Jessie also.


Thanks, I'll take a look at it. It was linked in the CrunchBang post but, given that it talks about Wheezy and tags seem to change with any version, I thought it didn't work, as the OP was still asking how to do it.
The Dude minds.
User avatar
HisDudeness
 
Posts: 21
Joined: 2012-07-30 15:54
Location: Melzo (Italy)

Re: Persistent Jessie Live USB

Postby GarryRicketson » 2015-10-29 07:04

Thanks for your answer. Unfortunately, that's not what I'm doing. I'm trying to make a persistent live boot, which means that any changes applied to the system (new programs installed, programs uninstalled, keyboard layout changed etc.) will be kept on next boot.

OOps, Ok, well, I know what persistence means, but was mistaken, the live usb stick I made, does not save any changes,guess you will need to try some other way.
Edited:
I did a search and found this.
https://www.linux.com/community/blogs/133-general-linux/420179-creating-a-debian-live-usb-flash-drive-with-persistence-for-non-techies
It is a pretty simple approach, I was thinking the about the same thing, The "Line" iso is only 1.5 gb, more or less, depending on which image, so anyway, still using the same
dd command, shown above, it will only be taking up a small part of the USB stick, 8gb would be plenty, after installing the iso with the dd command, create a primary partition on the rest of the usb stick, as needed, you could even make a swap, partition as well.
Read the tutorial, it is very simple , straight forward. I am going to try it my self just now.
User avatar
GarryRicketson
 
Posts: 3859
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Persistent Jessie Live USB

Postby HisDudeness » 2015-10-29 09:06

Thanks to both for your help. I'm writing you from my new persistent live Debian system.

I used the syn.theti.ca post, except for two differences, which are primarily for the fact I don't care the data my system stores to be read by windows: I put the bootable partition on top and, instead of making a 1.0GiB persistence partition and putting the rest on a FAT32 one, I simply used all the space that wasn't occupied by the first partition on the ext4 persistence partition. Also, being in an Arch system, I didn't have /sbin/install-mbr, I had to dd syslinux's MBR like I've shown.

I read in the crunchbang forum the guy which writes in syn.theti.ca (Ben Armstrong) is a major Debian developer, so it was pretty obvious it would work :lol:
I was deceived by the fact that it was on Wheezy, and sometimes tags needed for it to work changed with some Debian versions. I was deceived by the fact that, instead of just posting it, hhh put up a new guide, but that's probably because BunsenLab's Hydrogen has some differences. Really, 99% of his instructions were directly taken from Ben's.

Maybe I was wrong in not changing isolinux folder's name to syslinux etc., but I did that the first time and it didn't work anyway. Dunno.

I report that, the first times, instead of creating a partition of the right size, I shrank it after extracting the iso inside it. After that, it wouldn't load syslinux, but would present me a blinking white underscore on the upper left side of a black screen, and would not respond to any keyboard input (not even CTRL+ALT+CANC), but would turn off abruptly as soon as I pressed the power button.

The topic you linked, Garry, was reported in CrunchBang's forum too, but I didn't read it because the OP, despite reading it, still asked how to do it. Anyway, it contains an interesting information I didn't know (if I got that right): if you dd to a drive which has a partition in it (big enough to contain the file you dd, I suppose), the partition is mantained. The reason I wouldn't use dd is it messed my table up, so that I couldn't create persistence partition after it, but I guess that was because I always created a partition table before using dd, making it work on a partitionless drive. That is quite an useful information, I guess I'm a "non-techie" then :P

Thanks to both for your help, this topic can be closed for what concerns me.
The Dude minds.
User avatar
HisDudeness
 
Posts: 21
Joined: 2012-07-30 15:54
Location: Melzo (Italy)

Re: [SOLVED] Persistent Jessie Live USB

Postby bashterm » 2016-09-26 12:05

I solved this problem by using the live-build package from the debian repos to build my own custom iso file. I'm writing this from it right now. I have solved the persistence problem in the past by passing the --bootappend-live "boot=live persistence" on lb config, but there seems to be some sort of instability with it or something.
bashterm
 
Posts: 9
Joined: 2015-12-27 00:13
Location: USA


Return to Installation

Who is online

Users browsing this forum: 4D696B65 and 4 guests

fashionable