Please support VectorLinux!

Author Topic: vector linux on USB drive  (Read 13028 times)

aixuser01

  • Member
  • *
  • Posts: 86
vector linux on USB drive
« on: August 17, 2007, 11:59:44 am »
Ok, downloaded vl5.8 std live iso, burned it to disk then copied to my usb drive.
ran syslinux and renamed the isolinux.cfg to syslinux.cfg system now boots!

ok, so now I want to make changes and same so they are there next time I boot.
for example I want to edit /etc/hosts and have those changes there the next time I boot off the USB drive.

I don't want to do a regular install ( I think) because I might use the USB drive to boot another machine so I need the live version so it will scan and set up all the hardware.

Any help would be great!

thanks!
Evil Overlord rule 58 My doomsday device will not employ a large red digital countdown device unless it is absolutely necessary.  If a countdown device proves to be necessary, the doomsday device will be set to activate when the counter reaches 00:10:00, rather than 00:00:00.

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: vector linux on USB drive
« Reply #1 on: August 17, 2007, 12:07:11 pm »
good to hear your up and running with it.
you need to find out which device name your usb drive gets when the system boots i.e. /dev/sda1
then you add this "changes=/dev/sda1" to your boot line in syslinux.cfg (changing /dev/sda1 to match your device of course)

let us know if that works for you,
Uelsk8s

aixuser01

  • Member
  • *
  • Posts: 86
Re: vector linux on USB drive
« Reply #2 on: August 17, 2007, 12:54:49 pm »
hmm, I'm doing something wrong.


root:# mount
tmpfs on / type tmpfs (rw)
/dev/sda1 on /mnt/sda1 type vfat (rw)
/dev/sda2 on /mnt/sda2 type ntfs (ro)
usbfs on /proc/bus/usb type usbfs (rw,devgid=10,devmode=0666)
/dev/sdb1 on /mnt/vl-hot/sdb/vol1 type vfat (rw,noexec,nosuid,nodev,noatime,uid=0,gid=100,fmask=0111,dmask=0000,quiet,codepage=437,iocharset=iso8859-15)
/dev/sdb1 on /mnt/sdb1_removable type vfat (rw)

now if I do ls on /mnt/sda1 I get :

root:# ls /mnt/sda1
adaptec.mdm*   ddinit.mim*    int15_88.com*  nic8254x.mdm*  system.mdm*
adaptec2.mdm*  ddinit.mlm*    io.sys*        parallel.mdm*  upkeep.lst*
ami_raid.mdm*  dell/          ioapic.mdm*    pci.mdm*       usb.mdm*
autoexec.bat*  dellboot.exe*  ir.mdm*        perc2ada.mdm*  usb2.mdm*
autoexec.up*   delldiag.com*  keyboard.mdm*  pm.mdm*        usbdevid.mdm*
biosmp.mdm*    delldiag.exe*  lsi.mdm*       pnp.mdm*       usbkbd.mdm*
bootlog.txt*   delldiag.ini*  memory.mdm*    raid.mdm*      usbmass.mdm*
cables.mdm*    dellsys.msm*   miscpci.mdm*   scsi.mdm*      usbmouse.mdm*
cache.mdm*     delltbui.exe*  mouse.mdm*     seal.exe*      usbohci.mdm*
command.com*   disk.mdm*      mpcache.mdm*   seal.ini*      usbtm.mdm*
config.bts*    diskette.mdm*  msdos.sys*     serial.mdm*    usbufi.mdm*
config.sys*    dvd.mdm*       nbbatt.mdm*    smbios.mdm*    usbuhci.mdm*
config.up*     genaudio.mdm*  nbfan.mdm*     smbus.mdm*     video.mdm*
copyup.bat*    iaudio.mdm*    nbsvc.mdm*     smi.mdm*
cpu.mdm*       ieee1394.mdm*  nbtherm.mdm*   symtree.ini*
csaudio.mdm*   imchecc.mdm*   nic.mdm*       sysbdmon.mdm*

I'm not sure what I'm looking for but my syslinux.cfg has the "changes=" line as the last line.
I tried "changes=/dev/sda1" and "changes=/dev/sdb1" but neither seem to make changes stick.

my test case is to edit /etc/hosts and see if changes are there on reboot.

root:# cat syslinux.cfg
display boot/splash.cfg
default linux
prompt 1
timeout 100
F1 boot/splash.txt
F2 boot/splash.cfg

label linux
kernel boot/vmlinuz
append vga=788 splash=silent max_loop=255 initrd=boot/initrd init=linuxrc load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=10000  root=/dev/ram0 rw

label cli
append vga=normal vesa max_loop=255 initrd=boot/initrd init=linuxrc load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=10000  root=/dev/ram0 rw

label memtest
kernel boot/memtest
changes=/dev/sdb1
Evil Overlord rule 58 My doomsday device will not employ a large red digital countdown device unless it is absolutely necessary.  If a countdown device proves to be necessary, the doomsday device will be set to activate when the counter reaches 00:10:00, rather than 00:00:00.

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: vector linux on USB drive
« Reply #3 on: August 17, 2007, 12:59:49 pm »
it needs to be in your append line, like this
Code: [Select]
append vga=788 splash=silent max_loop=255 initrd=boot/initrd init=linuxrc load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=10000  root=/dev/ram0 changes=/dev/sdb1 rw

aixuser01

  • Member
  • *
  • Posts: 86
Re: vector linux on USB drive
« Reply #4 on: August 20, 2007, 05:56:36 am »
ok, added the "changes=/dev/sdb1" to the append line, rebooted edited /etc/hosts but once I rebooted again, the changes were gone.



display boot/splash.cfg
default linux
prompt 1
timeout 100
F1 boot/splash.txt
F2 boot/splash.cfg

label linux
kernel boot/vmlinuz
append vga=788 splash=silent max_loop=255 initrd=boot/initrd init=linuxrc load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=10000  root=/dev/ram0 changes=/dev/sdb1 rw

label cli
append vga=normal vesa max_loop=255 initrd=boot/initrd init=linuxrc load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=10000  root=/dev/ram0 rw

label memtest
kernel boot/memtest
Evil Overlord rule 58 My doomsday device will not employ a large red digital countdown device unless it is absolutely necessary.  If a countdown device proves to be necessary, the doomsday device will be set to activate when the counter reaches 00:10:00, rather than 00:00:00.

stoichyu

  • Packager
  • Vectorite
  • ****
  • Posts: 369
Re: vector linux on USB drive
« Reply #5 on: August 20, 2007, 09:30:48 am »
From my experience in slax 6, changes=/dev/sdb1 means to save changes in the partition found in /dev/sdb1 (usually ext2) which is probably not what you want to do.I am not sure but check if there is a command called 'mkchanges' and try using that to make a save file somewhere. Then in your syslinux.cfg make changes=<relative path from root of drive to save file>. Well, that's how it's done is Slax 6 which uses the linux-live 6 scripts, so I'm not sure if it also applies to linux-live 5(the one used in VL-5.8 live.

Edit:

I inspected the VL-5.8 live cd and turns out there wasn't anything to make a filesystem. So based off some stuff in slax, here is what you do to keep changes.

Quote
cd <path to flashdrive>
touch save.dat #filename of choice
dd if=/dev/zero of=save.dat bs=1 seek=<size in mb>M count=0
mkfs.xfs save.dat

Then, in your syslinux.cfg put "changes=save.dat"
Note: I used xfs because that's what slax uses and you can optionally grow the fs, but you can use other filesystems as well, as long as it's supported, I think. You should give about 256mb for the changes file, which is usually more than enough.
« Last Edit: August 20, 2007, 10:11:47 am by stoichyu »
There's no place like ~.
VL 5.8 PentiumD 2.8Ghz Registered Linux User #432836

aixuser01

  • Member
  • *
  • Posts: 86
Re: vector linux on USB drive
« Reply #6 on: August 20, 2007, 11:49:57 am »
ok cded  to /mnt/sdb1_removable

created file save.dat
-rwxr-xr-x 1 root root 209715200 2007-08-20 15:34 save.dat


dd if=/dev/zero of=save.dat bs=1 seek=200M count=0
mkfs.xfs save.dat

ran with no errors.

then added the changes=save.dat to the append line of the linux label

append vga=788 splash=silent max_loop=255 initrd=boot/initrd init=linuxrc load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=10000  root=/dev/ram0 changes=save.dat rw

rebooted, edited /etc/hosts and saved. Rebooted and changes still not there.
Evil Overlord rule 58 My doomsday device will not employ a large red digital countdown device unless it is absolutely necessary.  If a countdown device proves to be necessary, the doomsday device will be set to activate when the counter reaches 00:10:00, rather than 00:00:00.

aixuser01

  • Member
  • *
  • Posts: 86
Re: vector linux on USB drive
« Reply #7 on: August 21, 2007, 12:09:14 pm »
ok so that didnt work.

wiped out my usb drive, created 2 partitions : 1 fat16 and 1 ext2
rebuilt the livecd into the fat16 reran syslinux and booted.

created a file called saved.cow in the ext2 file system

set "changes=saved.cow" in the syslinux.cfg

rebooted and still not working. is the "changes" option correct?
Evil Overlord rule 58 My doomsday device will not employ a large red digital countdown device unless it is absolutely necessary.  If a countdown device proves to be necessary, the doomsday device will be set to activate when the counter reaches 00:10:00, rather than 00:00:00.

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: vector linux on USB drive
« Reply #8 on: August 21, 2007, 12:18:21 pm »
the changes= boot option has worked for me.
All the documentation I have found, (and the way it worked for me) says that the changes option should be used with the device name.
I have read that if a file called save.dat is found on the device used in the changes= option that it will be used but that it is not required.
there should also be a folder called rootcopy on the usb that can be used to copy files into the root file system on boot like /etc/hosts

stoichyu

  • Packager
  • Vectorite
  • ****
  • Posts: 369
Re: vector linux on USB drive
« Reply #9 on: August 21, 2007, 01:18:33 pm »
Did you try using ext2 for the save.dat file? But since you already have an ext2 partition, you can just use that to save changes to.
There's no place like ~.
VL 5.8 PentiumD 2.8Ghz Registered Linux User #432836

gacl

  • Vectorite
  • ***
  • Posts: 218
Re: vector linux on USB drive
« Reply #10 on: August 21, 2007, 04:39:52 pm »
I also needed to save my settings for Vector Live on a UFD. Maybe look at this thread?: http://www.vectorlinux.com/forum2/index.php?topic=3651.15
“Our very lives depend on the ethics of strangers, and most of us are always strangers to other people.” -- Bill Moyers

stoichyu

  • Packager
  • Vectorite
  • ****
  • Posts: 369
Re: vector linux on USB drive
« Reply #11 on: August 21, 2007, 08:59:03 pm »
I also needed to save my settings for Vector Live on a UFD. Maybe look at this thread?: http://www.vectorlinux.com/forum2/index.php?topic=3651.15
That works if you just want to change a single setting permanently, but it doesn't work if you want to save what you've done in a single session.
There's no place like ~.
VL 5.8 PentiumD 2.8Ghz Registered Linux User #432836

aixuser01

  • Member
  • *
  • Posts: 86
Re: vector linux on USB drive
« Reply #12 on: August 22, 2007, 09:17:24 am »
uelsk8s,

can you please post your syslinux.cfg with this option working?

when you say device name you mean /dev/sbd1  example "changes=/dev/sbd1" and then on that device have a save.dat file ?
Evil Overlord rule 58 My doomsday device will not employ a large red digital countdown device unless it is absolutely necessary.  If a countdown device proves to be necessary, the doomsday device will be set to activate when the counter reaches 00:10:00, rather than 00:00:00.

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: vector linux on USB drive
« Reply #13 on: August 22, 2007, 09:41:57 am »
i just added it like this

label linux
kernel boot/vmlinuz
append vga=788 splash=silent max_loop=255 initrd=boot/initrd init=linuxrc load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=10000  root=/dev/ram0 changes=/dev/sdb1 rw

and i did not make a save.dat file
you shouldnt need one if you use a linux filesystem

aixuser01

  • Member
  • *
  • Posts: 86
Re: vector linux on USB drive
« Reply #14 on: August 22, 2007, 10:48:57 am »
mine looks like yours

label linux
kernel boot/vmlinuz
append vga=788 splash=silent max_loop=255 initrd=boot/initrd init=linuxrc load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=10000  root=/dev/ram0 changes=/dev/sdb2 rw

and my /dev/sdb2  is ext2 as you can see here. but ........

root:# mount
tmpfs on / type tmpfs (rw)
/dev/sda1 on /mnt/sda1 type vfat (rw)
/dev/sda2 on /mnt/sda2 type ntfs (ro)
usbfs on /proc/bus/usb type usbfs (rw,devgid=10,devmode=0666)
/dev/sdb1 on /mnt/vl-hot/sdb/vol1 type vfat (rw,noexec,nosuid,nodev,noatime,uid=0,gid=100,fmask=0111,dmask=0000,quiet,codepage=437,iocharset=iso8859-15)
/dev/sdb2 on /mnt/vl-hot/sdb/vol2 type ext2 (rw,noexec,nosuid,nodev,noatime)
/dev/sdb1 on /mnt/sdb1_removable type vfat (rw)
/dev/sdb2 on /mnt/sdb2_removable type ext2 (rw)

logged in as root. did a touch test.txt in / then rebooted and it was gone.   


looking at dmesg I see the append line was read

Kernel command line: vga=788 splash=silent max_loop=255 initrd=boot/initrd init=linuxrc load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=10000 root=/dev/ram0 changes=/dev/sdb2 rw BOOT_IMAGE=boot/vmlinuz

thoughts?
Evil Overlord rule 58 My doomsday device will not employ a large red digital countdown device unless it is absolutely necessary.  If a countdown device proves to be necessary, the doomsday device will be set to activate when the counter reaches 00:10:00, rather than 00:00:00.