1

I have installed Ubuntu 14.04.3 to a 16GB pendrive so as to obtain a Live OS that stores persistent data on an ext4 partition. I followed the instructions on various tutorials and answers, recently on this: How do I get a live-USB to use a partition for persistence?

Everything works fine except persistence.

This is what I did:

  1. Boot from a live Ubuntu on USB (here: USB2) without a persistent file.
  2. Insert another USB (here: USB1), open gparted, unmount and delete all partitions.
  3. Select "unallocated" and create two partitions:
    sdc1: 1 - 2170 - auto - MiB // Primary Partition - fat32 - OS
    sdc2: 0 - auto - 0 - MiB // Primary Partition - ext4 - casper-rw
  4. Extract USB1 and then insert it in a Windows machine. Install Ubuntu on OS using "UNETBOOTIN" (but I've also used "Universal USB Installer", no difference later on) and set a 10 MiB persistent file.
  5. Delete casper-rw under Windows (but I've also done it under Ubuntu).
  6. Boot Ubuntu from USB2, insert USB1, open GParted and Right Click on the fat32 partition (OS 2.10 GiB), select Manage Flags and check "Boot" and "lba" ("Boot" is already checked; checking "lba" does not seem to change the situation later on).
    The "casper-rw" is now larger than 4GB (12.81 GiB), but persistence does not work.
  7. Modify the file "txt.cfg" as reported here below.

But even so persistence does not work. Can someone help? Many thanks in advance.

default live

label live

  menu label ^Try Ubuntu without installing

  kernel /casper/vmlinuz.efi

  append  file=/cdrom/preseed/ubuntu.seed boot=casper cdrom-detect/try-usb=true persistent noprompt floppy.allowed_drive_mask=0 ignore_uuid initrd=/casper/initrd.lz quiet splash --

label live-install

  menu label ^Install Ubuntu

  kernel /casper/vmlinuz.efi

  append  file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity cdrom-detect/try-usb=true persistent noprompt floppy.allowed_drive_mask=0 ignore_uuid initrd=/casper/initrd.lz quiet splash --

label check

  menu label ^Check disc for defects

  kernel /casper/vmlinuz.efi

  append  boot=casper integrity-check cdrom-detect/try-usb=true persistent noprompt floppy.allowed_drive_mask=0 ignore_uuid initrd=/casper/initrd.lz quiet splash --

label memtest

  menu label Test ^memory

  kernel /install/mt86plus

label hd

  menu label ^Boot from first hard disk

  localboot 0x80
  • Are you trying to boot on a UEFI machine in UEFI mode? txt.cfg is not the file to edit in that case, it's grub.cfg – ubfan1 Dec 14 '15 at 05:47
  • Many thanks! I will try that as soon as possible and then report. – Robi Fiorita Dec 14 '15 at 16:41
  • @ubfa1 I went over the whole procedure once more, but editing the relevant grub.cfg instead of n. 7. above. This is what I did: Here it is: menuentry "Try Ubuntu without installing" { set gfxpayload=keep linux /casper/vmlinuz.efi persistent file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash -- initrd /casper/initrd.lz } But the result was a black screen! Can you help? – Robi Fiorita Dec 15 '15 at 16:50
  • I usually put the "persistent" after the "boot=casper", but a black screen may be a video problem -- try the nomodeset option (edit grub.cfg or a function key at the grub menu). – ubfan1 Dec 15 '15 at 21:26
  • Now I have the "persistent" after the "boot=casper", but I still get a black screen. I will try the nomodeset option, if I find out how to do that. But why should it be a video problem, if everything works fine without the word "persistent"? Many thanks! – Robi Fiorita Dec 16 '15 at 08:02
  • If during the boot process I press "e" and add "nomodeset" before "quiet splash", the laptop freezes and displays various lines of code. The last reads: "---[end Kernel panic - not syncing: UFS: unable to mount root fs on unknown-block(0,0)". Many thanks! – Robi Fiorita Dec 16 '15 at 08:20
  • @ubfa1 The black/blank screen does not seem to be a video problem. I found out that during booting no drivers could be loaded because of this error:

    IOError: [Errno 28] No space left on device.

    But on the device there is plenty of space! Surely there must be a way to force the new (larger) casper-rw to replace the original (deleted) casper-rw. Can you help?

    – Robi Fiorita Dec 18 '15 at 09:21
  • Did you actually make the ext4 filesystem on the partition? It cannot be used otherwise. Can you mount it and see the (few) directories and the 12G free space? It should be picked up automatically, nothing special to do other than the word persistent you added. – ubfan1 Dec 18 '15 at 16:02
  • @ubfan1 I did make the ext4 filesystem on the partition. The volume casper-rw (folder: casper-rw) is mounted but empty, with 12.6GB free space. The volume casper-rw (folder: casper-rw1) contains two directories and one file, with no free space. After creating the "persistent" Ubuntu pendrive I deleted only the 10MB casper-rw file. Persistence does not work. If I edit grub.cfg with "persistent" after "boot=casper", I get a black/blank screen, which is not a video problem. When I try to see beyond the black/blank screen, the error I get is "IOError: [Errno 28] No space left on device". Any idea? – Robi Fiorita Dec 19 '15 at 09:28
  • You should only have one partition labeled "casper-rw", and no files or directories named "casper-rw" in any top level of ANY FAT partition. There is a search for "casper-rw", and the wrong one may be picked up if there are multiples. (Docs seem to include the extx filesystems in the search, but I have not found that to be the case). – ubfan1 Dec 19 '15 at 17:08
  • @ubfan1 What I reported above refers to the situation with two sticks active. With only the relevant stick active I have only one folder casper-rw (/media/ubuntu) with 12.6GB free space. But if I add "persistent" to the grub.cfg file, booting results in an error message: "BusyBox v.1.22.1 etc. Enter help for a list of built-in commands. (Initramfs)_". This time I used "Universal USB Installer", not "UNETBOOTIN". Any idea? – Robi Fiorita Dec 20 '15 at 14:13
  • @ubfan1 Modifying the grub.cfg file AND the syslinux.cfg file as suggested by C.S. Cameron at "http://askubuntu.com/questions/138356/how-do-i-get-a-live-usb-to-use-a-partition-for-persistence" seems to leave things unchanged. Any ideas? – Robi Fiorita Dec 20 '15 at 15:40
  • We should probably move this to the ubuntuforums/installation and upgrades. They are more suitable for this sort of problem solving. Editing both files just means it should boot both UEFI and legacy with persistence, but legacy never had the problem, since the installer did edit its config file. – ubfan1 Dec 20 '15 at 16:04
  • @ubfan1 I leave to you, I am new to this sort of things. Many thanks! – Robi Fiorita Dec 21 '15 at 07:58
  • Can someone move this to the "ubuntuforums/installation and upgrades" as suggested by @ubfan1? Many thanks! – Robi Fiorita Dec 22 '15 at 17:53

1 Answers1

0

Syslinux has not allowed persistent partitions on the same drive since Ubuntu 14.04.

However a Syslinux type install, (UNetbootin, Rufus, Universal), will use a persistent partition labeled casper-rw or home-rw if it is located on a different drive, either internal or external. It will use the first casper-rw file or partition it finds while booting

If you want a casper-rw partition on the same drive use grub2 type bootable disk creator like mkusb, (that works with BIOS and UEFI), or install grub2 to the USB manually and loop mount an ISO.

If you simply need more than 4GB persistence you can use YUMI to make the drive, it's casper-rw file can be larger than 4GB and there is a UEFI version.

C.S.Cameron
  • 19,519