HOWTO: Create a persistent USB
Posted: Thu Jul 11, 2013 4:41 pm
Here is how I created a persistent Gangbang USB stick.
Create two partitions on your USB stick. One partition needs to be big enough to hold the iso, the other partition should use all the remaining space. I used a 8G USB stick, so I created a 1G partition for the iso and the remaining space for persistence.
NOTE: The rest of the commands in this topic assume that you are running as root. Use "su" or "sudo su" to become root. BE CAREFUL! This example also assumes that your USB stick is "sdb" -- change the code accordingly if this is not true for your machine. BE CAREFUL!
Put a fat32 filesystem on the first partition, and an ext2 filesystem labled "persistence" on the second partition:
Mount the first partition (unetbootin requires this):
Use unetbootin to put the iso on the sdb1 partition. When unetbootin finishes, select "exit"
Edit the syslinux.config file on /dev/sdb1 (mounted at /mnt):
Add the word "persistence" to the end of the "append" line for the first entry, and (optionally) change the menu label of the first entry. For Gangbang, I changed this:
To this:
Save the file. Unmount the first partition, and mount the second:
Create a file called "live-persistence.conf" at the root of the partition:
Put this one line in live-persistence.conf (note that there is a space between "/" and "union"):
Save the file, and unmount the partition.
Boot your new persistent USB.
References:
http://live.debian.net/manual/3.x/html/ ... n.html#529
http://crunchbang.org/forums/viewtopic. ... 78#p297178
Create two partitions on your USB stick. One partition needs to be big enough to hold the iso, the other partition should use all the remaining space. I used a 8G USB stick, so I created a 1G partition for the iso and the remaining space for persistence.
NOTE: The rest of the commands in this topic assume that you are running as root. Use "su" or "sudo su" to become root. BE CAREFUL! This example also assumes that your USB stick is "sdb" -- change the code accordingly if this is not true for your machine. BE CAREFUL!
Put a fat32 filesystem on the first partition, and an ext2 filesystem labled "persistence" on the second partition:
Code: Select all
mkfs.vfat /dev/sdb1
mkfs.ext2 -L persistence /dev/sdb2
Code: Select all
mount /dev/sdb1 /mnt
Edit the syslinux.config file on /dev/sdb1 (mounted at /mnt):
Code: Select all
nano /mnt/syslinux.cfg
Code: Select all
label unetbootindefault
menu label Default
kernel /ubnkern
append initrd=/ubninit boot=live ip=frommedia union=aufs video=uvesafb:mode_option=1024x768-16@60 vga=current init=/bin/systemd
Code: Select all
label unetbootindefault
menu label Gangbang (with persistence)
kernel /ubnkern
append initrd=/ubninit boot=live ip=frommedia union=aufs video=uvesafb:mode_option=1024x768-16@60 vga=current init=/bin/systemd persistence
Code: Select all
umount /mnt && mount /dev/sdb2 /mnt
Code: Select all
nano /mnt/live-persistence.conf
Code: Select all
/ union
Code: Select all
umount /mnt
References:
http://live.debian.net/manual/3.x/html/ ... n.html#529
http://crunchbang.org/forums/viewtopic. ... 78#p297178