1

I've installed ubuntu on a pendrive but with persistence on it is painfully slow.

I suppose this is because the usb drive is quite slow, specially on writing.

Is there any way I can modify this install (or recreate the live usb drive from scratch) defining the local ntfs windows partition as the source for the casper-rw persistance file?

  • Another option to add along with persistence is "toram" (put it next to persistence on the boot line), which copies the compressed filesystem into ram, for much better performance. – ubfan1 Feb 14 '17 at 3:08
3

Persistent partitions do not work with 64bit syslinux type USB installs such as Startup Disk Creator, UNetbootin, Universal and Rufus make.

They do work with grub2 type installs like mkusb makes.

Use only mkusb to do the initial persistent install to the thumb drive and then follow Sudodus' instructions for creating a HDD casper-rw partition, then delete the casper-rw partition on the thumb drive.

If you do not remove the thumb drive's persistent partition, it will use the internal hard drives persistent partition when running off that computer and the thumb drive's casper-rw partition when plugged into a different computer, maybe becoming a little confusing.

  • 2
    I created a live-only drive by cloning the iso file to a USB pendrive. This can be done with mkusb in linux and with Win32 Disk Imager in Windows. In another [and fast] USB pendrive I created three partitions: 1 - an ext4 partition with the label 'casper-rw'; 2 - an NTFS partition with a 'casper-rw' file; 3: a FAT32 partition with a 'casper-rw' file. I failed to get persistence with the file in NTFS, but succeeded with both the ext4 partition and the file in FAT32, both in UEFI mode (with grub) and BIOS mode (with syslinux). See help.ubuntu.com/community/mkusb/sp – sudodus Feb 14 '17 at 8:06
  • 2
    Thanks Sudodus: Got SDC, UNetbootin and Rufus USB installs working with persistent partitions, but only in 16.04.1, not 15.10 or 16.10 and the persistent partition only works when on a different drive than the OS. otherwise get BusyBox. I prefer mkusb. – C.S.Cameron Feb 15 '17 at 9:03
  • I tried yesterday with Lubuntu 16.04.1 LTS. i had not imagination enough to think that the same thing would fail in 15.10 and 16.10. Thanks for explaining these details, @C.S.Cameron :-) – sudodus Feb 15 '17 at 13:57
  • 1
    Discovered I was not properly wiping the remote casper-rw partition between versions, now have 14.04.3 64, 15.10 64, 16.04 32, 16.04.1 64 and 16.10 64 working with casper-rw partition on remote drive, but not on same drive. – C.S.Cameron Feb 18 '17 at 7:44
2

Yes. The persistent live system uses the first casper-rw file or partition it finds. So

  1. create a partition with the file system ext4 in a hard disk drive (HDD) or solid state drive (SSD). Give it the label 'casper-rw'.

  2. copy the directories and files from your current casper-rw file to this casper-rw partition.

  3. remove the casper-rw file.

  4. reboot.


An alternative is to get a fast USB 3 pendrive, which is good at writing and reading 'many small files'. See this link

Installation/FromUSBStick#Notes_about_speed

and you can use mkusb to create a casper-rw partition automatically, without the limited size of a casper-rw file. See these links

help.ubuntu.com/community/mkusb

mkUSB-quick-start-manual.pdf

  • your suggestions are informative and helpful but I have to find a solution that works on a slow pendrive/usb port (not usb3) and does not require modifications on the host hdd's partition table -> casper-rw loop file must be a file on the existing NTFS windows partition. – NotGaeL Feb 15 '17 at 8:29
  • My understanding is that casper-rw files only work in a FAT32 file system, thus the 4GB size limit. Have you tried the toram option? – C.S.Cameron Feb 15 '17 at 9:45
  • I can assure that I have tried in many ways, but never managed to get persistence with a casper-rw file in an NTFS partition. So I am afraid, that you need another solution. I think the best solution is to 1. let Windows shrink the main NTFS partiiton; 2. Leave the unallocated drive space and boot into Ubuntu live; 3. Use gparted to create a partition in the unallocated space, create an ext4 file system in the partition and set the label 'casper-rw'. – sudodus Feb 15 '17 at 14:41
  • Maybe an alternative is to install VirtualBox in Windows and run Ubuntu in a virtual machine (in VirtualBox). Then you need not tamper with the partition table of your internal drive. – sudodus Feb 15 '17 at 14:53
  • @C.S.Cameron I did try the toram option. Appart from increasing boot time by a lot I didn't notice any significant speed improvement (this was a surprise, maybe I did something wrong but I saw no error in the kernel/system logs). – NotGaeL Feb 15 '17 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.