Boot from the live CD.
Make two partitions on your USB key, one big enough to hold the live CD image and the other the rest of the stick.
# fdisk -l /dev/sda
Disk /dev/sda: 8000 MB, 8000110592 bytes
255 heads, 63 sectors/track, 972 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x667d2bec
Device Boot Start End Blocks Id System
/dev/sda1 * 1 262 2104483+ b W95 FAT32
/dev/sda2 263 972 5703075 83 Linux
Format the first partition as FAT 32, the second as ext2.
# mkdosfs -F 32 /dev/sda1
# mkfs -L live-rw /dev/sda2
# aptitude update
# aptitude install unetbootin
Do unetbootin magic.
For the source, choose the live cd (/dev/hdc on my system).
For the destination, choose /dev/sda1.
Once unetbootin finishes, reboot on the USB key. Choose live and then hit TAB to edit. Add the parameter "persistent" to the end of the line and all changes you make to the system will be saved to the live-rw filesystem on /dev/sda2! I also change the username and hostname, but that's optional.
I think this is the ultimate USB portable debian distro!
Last edited by jeward (2010-06-05 16:02:07)
is it possible to do something like that but with an hd instalation instead the live cd?
Yes, and then you'd also want to make a swap partition! :-)
I just make a persistent usb stick with cb alpha2 (damn, it's the amd64 version...I'll have to build it again if I want to make it bootable on all systems) and I would like to change boot menu of unetbootin. First I would like to make the "persistent" entry permanent and if it's possible I would also like to have the default menu of cb or maybe a new one without the install option.
Is something that can be done? I was thinking to dd the image in the usb but I don't think I can choose the sdb1 partition of usb...
I have created a couple of persistent USB installs using UNetbootin. I found that it worked brilliantly and I was able to edit the default syslinux menu to add the persistent flag and also change the username from "crunchbang" to "corenominal". Good stuff.
it works very nice, finally!
now, how i install apps so they go to the persistent partition?
and how i edit the default syslinux to add the persistent flag and username and stuff?
and the locale. i need hebrew layout too. I would like it so much to be persistent...
mmm there must be a way to set the /home dir to the persistent partition right? anybody has a link where i can learn how to do that?
thanks for the how-to
EDIT: oh my goddess!! SO COOL!! i just went to explore the usb and found that in fact /home is in the persistent partition!! lol
sorry for bothering. (blush )
Last edited by liame (2010-07-12 18:08:10)
Just do things as you would do anyway. apt-get anything you want, create users, delete users, change locales etc. Everything you add/change goes to persistent partition by default. It's a nice gadget to have around, especially when you get pissed off by your friend's windows computer
this is the first part of syslinux.cfg on live-usb (the rest of the entries are similar):
default menu.c32 prompt 0 menu title CrunchBang Statler timeout 10 label unetbootindefault menu label Default kernel /live/vmlinuz append initrd=/live/initrd.img boot=live live-config live-config.hostname=crunchstick live-config.username=slapfish live-config.user-fullname=CrunchBangLiveUser live-config.locales=en_US.UTF-8 live-config.timezone=Europe/Athens quiet persistent
Everything works except the timezone.. (I created the user and changed the host name first though)
EDIT: I just noticed your edit addition
Last edited by slapfish (2010-07-12 18:17:38)
thank you very much slapfish
to more things i am founding problems to set are:
the time zone/correctly time.
the keyboard layout to be us,il
Fellow, I'm wading through what is now necessary to set it up correctly.
Question - do I have to ever allow any room on the FAT partition of the USB to expand for updates, etc as CB is only 700Mb.
I'm thinking 1Gb should be big enough with the remainder ext2. l
Something has failed - followed directions did the updates per Slapfish; update wireless and rebooted.
Nothing saved as persistent - selecting Live has given me a Live cd.
Anyone know why?
I've redone everything once again.
Looking at the file manager shows that there is nothing on the 6Gb FAT32 partition that I created; everything on 1Gb ext2 partition. This is worrying.
Using slapfish's directions:
live-config.username=mpierce shows up correctly under File system/home/mpierce
Shouldn't this be on the ext2 partition?
live-config.locales=en_US.UTF-8 is launching with en_GB.UTF-8
live-config.timezone=Australia/Melbourne is OK
I don't think I can reboot the computer without everything failing.
Sorry for taking ages to reply, I was away for some days... I'm not sure if this is the reason why your persistent usb isn't persistent but (did) you have the partitions wrong (?). Live cd goes to fat32 and persistent staff to ext2. Also double check that you have entered the persistent flag to the grub entry. Last but equally important the original default entry of grub entry (made by unetbootin) isn't working with persistent. Try the live entry and if it works you can replace the content of "default" with that of "live" + persistent flag. Hope that helps...
It failed because I didn't label the partition correctly. I gave the vfat partition the name of casper-rw because I had used a different loader which created that partition.
Unetbootin does not give you the option to create the correct persistent partition. Carelessness of my part.
I've now created a full install on the usb stick from the CD and am preparing to test this out. As the stick is 8Gb, I've created a 2.75Gb /, .75Gb swap and 4.5Gb /home directories. It is currently updating the packages and shows that it has used 1.85Gb on / but still updating.
For the live-cd partition you only have to create a 700mb partition. It doesn't use more than that... anything else goes to the other partition.
having trouble at the "unetbootin magic" part of the description.
I have the live CB booted as VM and I only see /dev/sdb2 not /dev/sdb1 and unetbootin also requests that I mount /dev/sdb1 or /dev/sdb2 to use.
Secondly, how can I tell unetbootin to use an iso when I am running the machine off the live image i want to create (as per the first line).
Any tips, be most helpful.
Check if sdb1 is being used by the host... I guess that if sdb1 and sdb2 partitions were created properly then it's a vm issue and not unetbootin's.
You can create a share to the folder containing the iso on host or if this is too complicated you can download it in VM.
Also, I'm guessing that your host machine is a windows one, cause if it's a linux you don't have to do it from inside alpha on VM (just in case ).
Thanks for that, seems the host must of been using the usb drive, actually changed to a different usb plug on the machine and re-ran the installation. Got a booting usb drive now though
how do I edit syslinux.cfg though? do I need to edit it before I create the disk with unetbootin?
Lastly, If I make changes and or save my own files, do I have to make sure I save to the live-rw file partition or is that the settings in syslinux.cfg that control that?
BTW - my host is actually a Mac running the osX which is really just a ripped off BSD spinoff.... =P
EDIT - After re-booting several times and setting the "persistent" flag in both live and default its not saving anything, simple text document saved to /home/crunchbang/documents is gone on a reboot. must be editing this options wrong somewhere.
Last edited by mess (2010-07-17 15:16:31)
Key question - how does someone edit the kernel boot script so that they do not have to enter the "persistent" flag everytime? Corenomical made reference to this.
Do you guys experience really high disk usage? The update was supposed to take up less than 150 megabytes, but so far it's taken up more than 600...
[ Error writing /media/Transcend/syslinux.cfg: Read-only file system ]
I saw my disk usage increase by 900mb just by running apt-get dist-upgrade. I ran apt-get clean and autoclean, I've been going through and removing packages/applications, but that still doesn't explain how an update can take up that much space.
Can someone help? This USB stick is obviously supposed to be minimal, but with 1.16 gB of storage and 90% of it used, I'm a little worried about the next update.