Making a read-only bootable USB drive for Debian is straightforward, but need much more effort to make persistence version if not using 3rd-party tools. As it is not easy to make Windows XP create multiple partition of USB drive required, the work-around is to use a normal read-only bootable Debian and use that environment to do all the work. Most helpful resources found in the web is Dirk-Jan's blog:
http://www.vleeuwen.net/2014/01/create-a-persistent-debian-live-usb-flash-drive
My steps are based on this procedure with some updates for Debian 8.5.0.
Below are the summarized steps after many on-line searching and trail-and-error attempts:
Prerequisites:
- A PC with at least 2 free USB ports.
- 2 USB drives: One already installed normal read-only Debian 8.5.0 (xfce). Another one with at least 4G space for installing the persistence version.
- The PC has the Internet access and also have ISO file image already download in internal hard disk.
Boot the PC with the read-only Debian USB drive, and then plug in the new USB for installing the persistence version.
Make sure you identify the correct device file of the new USB ready to install the persistence version (e.g. use parted). In this case, the device is identified as
/dev/sdc.
Execute bash command (to install the necessary tools):
apt-get install mbr syslinux gparted
Also need packages:
p7zip-full and
dosfstools but these should already installed by default.
Use graphical partition tool:
sudo gparted /dev/sdc
Right-click Delect
Select unallocated partition
Right-click New
Create as: Primary Partition
New size (MiB): 1536
File system: fat32
Label: live
Select "Add"
Right-click New
New size (MiB): <remaining size>
Create as: Primary Partition
File system: ext4
Label: persist
Select "Add"
Click the "green tick" icon
Close to exit.
sudo parted /dev/sdc
print
...
(parted) mkpart primary fat32 1 1024M
(parted) mkpart primary ext4 1024M 12G
(parted) set 1 boot on
(parted) p
...
1 1049kB 1612MB 1611MB primary fat32 boot
2 1612MB 15.6GB 14.0GB primary ext4
(parted) quit
sudo mkdosfs -n live /dev/sdc1
sudo mkfs.ext4 -L persistence /dev/sdc2
sudo mkdir /mnt/live
sudo mount /dev/sdc1 /mnt/live
sudo mkdir /mnt/persistence
sudo mount /dev/sdc2 /mnt/persistence
cd /mnt/live
sudo 7z x /media/user/Data/temp/debian-live-8.5.0-xfce-desktop.iso
sudo nano isolinux/live.cfg
Modify lines (adding "persistence noeject"): append boot=live persistence noeject components quiet splash
Save file and exit.
sudo install-mbr /dev/sdc
sudo syslinux -i /dev/sdc1
sudo mv isolinux syslinux
sudo mv syslinux/isolinux.cfg syslinux/syslinux.cfg
sudo mv syslinux/isolinux.bin syslinux/syslinux.bin
cd /mnt/persistence
sudo nano persistence.conf
Just type in:/ union
Save file and exit.
sudo umount /mnt/live
sudo shutdown now
Remove the read-only USB drive and ready to test the newly created persistence version USB drive.
Notes: optionally append network configuration to file /live/isolinux/live.cfg (not tested): ip=eth0:192.168.1.100:255.255.255.0:192.168.1.1:217.149.196.6