Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Live usb with persistence

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
kereberos
Posts: 67
Joined: 2011-05-23 09:12

Live usb with persistence

#1 Post by kereberos »

I copy the debian-live-7.6.0-i386-standard.iso to the usb. Now i can live boot into the usb.
I also follow the guide "10.3.1 The persistence.conf file" to make /dev/sda2 my persistence partition.
When it boot up and i add the parameter "persistence" it will works. But i want to know how to make it automatically boot with the parameter?

Does anyone know how to do it?

My guess is that i have to make my own live cd then copy to the usb again. If that is it, anyone know any tutorial how to make live cd from the live cd i already downloaded?

fsmithred
Posts: 1873
Joined: 2008-01-02 14:52

Re: Live usb with persistence

#2 Post by fsmithred »

Depending on how you added the live iso to the usb stick, you may or may not be able to plug the stick into a running system and edit the boot menu. (Probably isolinux/live.cfg or syslinux/live.cfg). Just add the word, "persistence" to the default boot entry.

If it's a read-only filesystem, you won't be able to do that. There are several ways around that. Here are a few:
- re-image the usb stick with something other than dd or cat, so that you don't end up with something that acts like a cdrom when you plug it into a running system. You could also do this manually by mounting the iso file and copying the filesystem within it onto the usb, then adding a bootloader.
- build your own live CD with live-build
- modify the iso file you have: mount the iso, copy the contents to a work directory, copy and unpack live/filesystem.squashfs (I'd do this outside the work directory), make the changes in the unsquashed filesystem, re-squash it, replace the original filesystem.squashfs with your modified version, make a new iso from the filesystem in your work directory.
- install the live-CD you have to hard drive, make the changes you want, make a bootable copy of your system in a live-CD iso, either with live-build or refractasnapshot, remastersys or other software. Results will vary between the different tools used.

Here are a couple links for Refracta Tools...
http://sourceforge.net/projects/refracta/files/tools/
http://www.ibiblio.org/refracta/documents.html

kereberos
Posts: 67
Joined: 2011-05-23 09:12

Re: Live usb with persistence

#3 Post by kereberos »

The usb is read only.
fsmithred wrote: - modify the iso file you have: mount the iso, copy the contents to a work directory, copy and unpack live/filesystem.squashfs (I'd do this outside the work directory), make the changes in the unsquashed filesystem, re-squash it, replace the original filesystem.squashfs with your modified version, make a new iso from the filesystem in your work directory.

After i unsquashed filesystem, what file to edit. it doesn't have ilve.cfg file

Code: Select all

#find -name live.cfg

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Live usb with persistence

#4 Post by kiyop »

live.cfg is not in extracted directory from /live/filesystem.squashfs in iso, but in /isolinux in iso, at least for http://live.debian.net/cdimage/release/ ... andard.iso
Thus, I think that you need not modify (extract=unpack, modify, and pack) the filesystem.squashfs, in order to achieve your goal: just adding "persistence" to kernel parameter.

To make an iso(9660) image, you can use "genisoimage", although I am not so familiar with it.
Read manual by

Code: Select all

man genisoimage
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

fsmithred
Posts: 1873
Joined: 2008-01-02 14:52

Re: Live usb with persistence

#5 Post by fsmithred »

Kiyop is right - the boot menu file is not inside the squashfs, so you only need to unpack and repack the iso file. Below are two different ways to make the iso - use genisoimage or use xorriso. Replace $snapshot_dir/$filename with the path and filename of the final iso file you're making.

wheezy versions of refractasnapshot use these commands:

Code: Select all

genisoimage -r -J -l -D -o "$snapshot_dir"/"$filename" -cache-inodes \
    -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
    -boot-info-table -allow-limited-size iso/ |
isohybrid "$snapshot_dir"/"$filename"
jessie/sid versions of refractasnapshot use this command:

Code: Select all

xorriso -as mkisofs -r -J -joliet-long -l -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
    -partition_offset 16 -V "snapshot-live-cd"  -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
    -boot-load-size 4 -boot-info-table -o "$snapshot_dir"/"$filename" iso/
You'll still need to find a better way than dd or cat to put the iso on the usb if you want the persistent volume to be on the same usb.

kereberos
Posts: 67
Joined: 2011-05-23 09:12

Re: Live usb with persistence

#6 Post by kereberos »

I didnt create the usb with dd or cat. I'm using window and i'm not familar with linux.
First i used a partition software to cut the usb into two partition. Then i assign a letter to the
first one. Next i used Win32DiskImager to write the iso to the first partition. I can rewrite the
first partition with Win32DiskImager and it will not affect the 2nd one.
After i boot into the usb, i use fdisk and followed the guide to create the persistent volume.
--

Since i dont have to extract the filesystem.squashfs it will make it easier todo. window don't have software that can extract and i had to use another livecd to extract the filesystem.
The livecd have the unsquash command but it doesnt support the compression. So i have to build unsquash from source. It was a mess and a lot of googling.

fsmithred, is there anything special in your command that make the iso especially for livecd/usb or is it just a simple command to create a bootable iso? Because i changed the live.cfg and then created a iso with ImgBurn. It will boot up and it works.

In ImgBurn, there a place called "Boot Image" i put "isolinux/isolinux.bin" , but it doesnt have any place to for "isolinux/boot.cat".

Code: Select all

genisoimage -r -J -l -D -o "$snapshot_dir"/"$filename" -cache-inodes \ -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \ -boot-info-table -allow-limited-size iso/ | isohybrid "$snapshot_dir"/"$filename"
For the command,i know what to change for "$snapshot_dir"/"$filename", besides that i don't know what other parameter do. I dont want to created a iso and then later realize i destory the usb because the iso wasn't specially build for live usb.

Furthermore, i have two more questions. how to make it auto boot up to the default? Something like a countdown, if there is no keyboard movement it will just use the default. After it power up it will just stand on the menu, and i have to press enter for it to enter default.

Second, how to make it shutdown without a confirmation
Please remove the disc, close the tray(if any) and press ENTER to continue
I used the command

Code: Select all

shutdown -hP 1
even tried

Code: Select all

shutdown -hP 1 | y 
and it didnt works.

fsmithred
Posts: 1873
Joined: 2008-01-02 14:52

Re: Live usb with persistence

#7 Post by fsmithred »

The isohybrid command is what makes it possible to copy the iso to usb (with dd or cat, a bit-by-bit copy) and get it to boot. When you transfer the image with dd or cat, the partition table gets overwritten. I don't know what the software you're using does with the image.

Add 'noeject' to the boot command to disable it from asking you to hit ENTER to eject the medium when you shut down.

I think you can just remove "timeout 0" from isolinux.cfg to get it to automatically boot the default entry. Otherwise, change 0 to something like 30 for a 3-second timeout.

I'm not sure what effect removing boot.cat would have. Here's what the genisoimage man page says about it:
-c boot_catalog
Specifies the path and filename of the boot catalog, which is required for an El
Torito bootable CD. The pathname must be relative to the source path specified to
genisoimage. This file will be inserted into the output tree and not created in the
source filesystem, so be sure the specified filename does not conflict with an exist‐
ing file, or it will be excluded. Usually a name like boot.catalog is chosen.

If -sort has not been specified, the boot catalog sorted with low priority (+1) to
the beginning of the medium. If you don't like this, you need to specify a sort
weight of 0 for the boot catalog.

Post Reply