(03-16-2015, 04:06 AM)bugfree link Wrote: On the other hand, to avoid this persistence problem, the obvious solution is to install to a USB stick that has already been partitioned with ext2 and a swap file. I've done this a couple of times, although with ext4 format, but not tested on other makes and models of computers to determine if proper drivers are installed. Seems to work on Acer machines which are the ones I've tested on. Very quick when done this way.
Assuming that you mean doing a full-blown install to the USB (not a "live" USB), yes that works and you don't need to worry about contortions with setting up persistence. Another advantage to that is that you can run system updates just like you would on a hard drive install, which is not something that works on "live" USB's -- they'll typically fail and/or freeze up the system. In order to use a USB with regularly installed system on multiple computers, just don't install any proprietary graphics drivers. It will just use the standard Linux drivers for whatever system it is booted from. For demo purposes the standard drivers should be fine.
(03-16-2015, 04:06 AM)bugfree link Wrote: On mine, I've got LL2.2 (4Gb mem) installed on a Sandisk cruzer fit micro stick created with USB-creator and partitioned as ext4 with a small swap file. The swap file never gets used. Everything is snappy! I've installed many other packages, which swells the used section to a bit over 10Gb with 19Gb left for storage.
As it takes time and bandwidth to install all these packages and set them up, what I'm trying to do now is to create/duplicate my usb installed system of 10Gb used and transpose this onto a blank 16Gb stick and somehow leave the balance of 6Gb available for storage (a la persistence).
If I understand you right, you've got a 32GB Sandisk USB with full install that has a Root and Swap partition on it (with about 10GB used, rest free space) and you want to basically clone it onto a smaller (16GB) stick.
Best bet:
- Set-up Root and Swap partitions on the 16GB stick.
- Use GParted to shrink the Root partition on 32GB stick to same size as one made on 16GB stick.
- After shrink, right-click and "Copy" the source Root partition on 32GB stick, right-click and "Paste" it on to destination partition on 16GB stick.
However, since you and I have both had problems with GParted trying to shrink USB partitions (for whatever reason) that may not be an option if shrinking aborts like before.
You're correct that using the dd command would require same size (or larger) USB destination stick, so that's not an option. However, I'm pretty sure you could use the rsync command to basically do the same thing. That command will only copy over the data from the source partition to the destination partition (ignoring the free space), so that would only copy over the 10GB being used on that 32GB stick. I've never tried that myself, but I'm 99% sure that will work. Look up the man page for rsync to find best options to use with the command.
You'll want to use command options that preserve ownership and permissions. Do a search for cloning with rsync to see if you can find examples of other people who've done it and what options they used in the command. Here's a good example from very reputable person on the Mint forums:
http://forums.linuxmint.com/viewtopic.ph...20#p909260. You'll notice that he's excluded certain directories in his command. I believe that's because he's rsyncing from a running system to a USB stick. If you boot from the 32GB stick and run the rsync command from there, I'd recommend you do the same. If you're not running the command from the 32GB stick, but instead from a separate system with both USB's plugged in, then you can remove the excluded stuff from the command.
No matter which way you do the cloning (with GParted or rsync), you will likely need to use a "live" DVD/USB to install grub to the MBR of the new USB to get it to boot properly. For example purposes, let's pretend you boot with live DVD/USB and plug in your newly cloned USB. If it automounts when you plug it in, right-click it and choose "unmount" before proceeding. Let's also pretend that the Root partition on the cloned USB is "/dev/sdc1". To install grub boot loader, do the following.
Mount the Root partition to the /mnt directory
Code:
sudo mount /dev/sdc1 /mnt
Install grub to the MBR of the cloned USB stick
Code:
sudo grub-install --boot-directory=/mnt/boot /dev/sdc
Unmount the cloned root partition
Code:
sudo umount /dev/sdc1
One more thing you may want to check is the
"/etc/fstab" file. You need to make sure that the partition UUID's in fstab match the UUID's on the clone USB.
Enter this command to find the UUID's for the clone USB
Code:
sudo blkid -c /dev/null
Mount the clone's root partition again before trying to read the
fstab file on it
Code:
sudo mount /dev/sdc1 /mnt
Print to the terminal screen the contents of the
fstab file for you to look at
Look at the UUID's for both the Root and Swap partitions in that file and make sure they match the ones shown by the
blkid command for that USB stick -- they probably won't.
If they don't match, open the file with your text editor (leafpad) as administrator with this command
Code:
gksu leafpad /mnt/etc/fstab
Replace the current UUID's with the correct new ones then save the file and close the text editor.
Unmount the USB's root partition after you're done making the change.
Close terminal and shutdown computer.
Reboot with newly cloned USB and it should work now.