3

I would like to create an Ubuntu live usb with persistence. With Linux Tails it was working well for me without problem but for Ubuntu and Mint I have some problems.

I tried to use rufus, unetbootlin and so on from Windows and mkusb from Linux.I always ended up with the following:

I have a casper-rw partition which is not writable after boot by default (after chmod777 it is writeable). When I am booting in grub I never see persistence in the parameter list (on partition 4 -  see partition description little later). I tried to add it there but system become unstable and haven't saved any changes I made like it is a live boot.

Last time I used mkusb. It looks that everything went OK (there were no errors in the console). I see new2 boot options in the BIOS.

bios picture

If I choose the partition 3 than it does nothing, only black screen and nothing happens. If I boot with the partition 4 than I can see a "usbboot" partition as partition 3. On that I see a grub.cfg which looks good, there is persistence and so on in the file. 

Gparted info about pendrive

If I choose the partition 4 for boot than it boots without any persistent (looks like this is the live usb image)

Can you please help me to fix this issue?

Do I have to activate persistence storage somehow like in the TAILS Linux? If you need any further details please let me know.

Kevin Bowen
  • 19,395
  • 55
  • 76
  • 81
user998456
  • 33
  • 1
  • 1
  • 3
  • 1
    1. Can you boot the computer from a live-only USB pendrive (made by a tool you mention? A persistent live USB pendrive made by mkusb should boot with the same settings in your UEFI/BIOS menus; 2.You need not tweak Ubuntu or Mint in the USB pendrive except if you have some HP computers, which are not willing to boot from grub with a GUID partition table (gpt). If that is the case, select MSDOS partition table, in one of the windows of mkusb; 3. Have you checked with `md5sum` that the iso file is correct (no error during the download)? 4. Which versions of Ubuntu and Mint are you trying? – sudodus Sep 22 '19 at 15:53
  • 1
    Do not choose a partition for booting, but the **drive** or simply USB, whatever can be selected in your UEFI/BIOS system. See also [this link](https://help.ubuntu.com/community/Installation/FromUSBStick#Booting_the_Computer_from_USB) – sudodus Sep 22 '19 at 15:57
  • 1
    I have never had to modify a **mkusb** Persistent install to make it work. A UNetbootin or Rufus install can be made Persistent with partitions as shown thus: https://ubuntuforums.org/showthread.php?t=2426728&p=13888346#post13888346 . A Persistece file, (4GB max), can be added to Rufus or UNetbootin thus: https://askubuntu.com/questions/1126145/can-i-convert-a-live-ubuntu-usb-to-one-with-persistent-memory/1126305#1126305 . Have you considered a Full install to USB? – C.S.Cameron Sep 22 '19 at 16:42
  • @sudodus: Yes boot to live is working. I want to boot it on an Alfawise T1 mini pc. Maybe the GPT could be a problem for the mashine. I tested the same pendrive in my normal pc and i got the "good" grub menu with persistent menu item but the boot was not working after that. I will try the MSDOS partition table in mkusb thanks for idea.I haven't chacked the md5sum yet. I tried the newest version from ubuntu and mint as well. – user998456 Sep 22 '19 at 18:42
  • @C.S.Camero: Yes i tried full install (only with MINT ) as well. I booted the mashine from another usb. It took ca 10 hours. I installed that from an USB2 pendrive to a USB3 kingston. The boot was not working (it changed the boot sector on the main ssd which i can't remove from the mashine so i gave it up for a while) – user998456 Sep 22 '19 at 18:48
  • Thanks for the details :-) Boot to live is working, and I checked the specs of the computer. Things should work with persistence by mkusb too with all current Ubuntu versions. But it is very important that you unmount all partitions of the drive before unplugging This will flush the write buffers. This means also that when you shut down or reboot, you must wait until the process has finished. Otherwise the file system in the partition of persistence `casper-rw` can get corrupted, and the drive stops working. – sudodus Sep 22 '19 at 18:54

3 Answers3

2

Adding Persistence Manually

UNetbootin: Add casper-rw file to USB root. Edit syslinux.cfg, adding a space and the word persistent to default boot, thus: "...splash --- persistent".

Rufus: Add casper-rw file to USB root. Edit /isolinux/txt.cfg, (for BIOS boot persistence) and /boot/grub/grub.cfg, (for UEFI boot persistence), thus: "...splash --- persistent".

Start up Disk Creator uses a write only ISO9660 file system which takes up the whole drive and GParted can't modify. Persistence is not possible.

Mkusb Live installs also use ISO9660 file system, (which GParted won't modify), however mkusb can be downloaded to the Live USB and used to turn the Live USB into an excellent Persistent drive that uses casper-rw partitions of unlimited size.

To create a casper-rw file:

sudo dd if=/dev/zero of=casper-rw bs=1M count=512

sudo mkfs.ext3 -L casper-rw -F casper-rw

(where count=512 is persistence size, with max size = 4GB).

Starting with Ubuntu 19.10, persistent partitions can be added to UNetbootin and Rufus and also to cloned drives.

C.S.Cameron
  • 18,890
  • 10
  • 64
  • 105
  • 1
    +1. Starting with Ubuntu 19.10, persistent partitions can be added to UNetbootin and Rufus *and [also to cloned drives](https://ubuntuforums.org/showthread.php?t=2426728) (e.g. by Start up Disk Creator)* – sudodus Sep 25 '19 at 09:51
1

If you use a casper-rw persistent partition on the same drive you're booting from with anything but (the yet to be released) Ubuntu 19.10, you're going to be screwed because of Ubuntu/casper bug #1489855. And I'm afraid that, since Mint is a derivative of Ubuntu, it suffers from the same casper bug. At this stage, I'm not aware of any distro having backported the fix for #1489855 into an updated release.

So here's what I would recommend:

  • Download the latest daily-live of Ubuntu 19.10 and use that with Rufus 3.8 or later. It should work just fine for persistence (source: I am the developer of Rufus, and I have tested it fairly extensively to make sure that it does work).
  • Use Debian or a Debian derivative that doesn't use casper-rw for persistence. For instance, there again, Debian Live 10.x should work just fine for persistence with Rufus 3.8 or later.
  • Wait until the Mint distro maintainers pick the casper fix and produce a release that is not plagued by bug #1489855 and can therefore properly support persistent partitions.

I spent a lot of time ensuring that Rufus can automate the hard work for you (again, provided that the distro you use isn't plagued with a major bug with regards to persistent partition support), and you indicated that you tested Rufus. So you might as well let it sort your issue for you, by using it with an ISO that actually has a chance to work...

Akeo
  • 1,375
  • 1
  • 10
  • 17
  • A partition for persistence works when the system is created by mkusb with all current Ubuntu and Linux Mint versions. The news are that it will be much easier with 19.10; it will work with most boot structures and tools to create USB boot drives, even cloned drives, where you can create a partition for persistene 'behind' the cloned data. See [this link](https://ubuntuforums.org/showthread.php?t=2426728). – sudodus Sep 23 '19 at 05:56
  • 1
    @sudodus, did you read what I wrote above? Rufus can __already__ create live drives with a persistent partition if you use Debian 10 or Ubuntu 19.10. There's no need to release a new version for that, it's already there. – Akeo Sep 23 '19 at 11:29
  • Also, whatever workaround `mkusb` might use to set up persistence (I can __guarantee__ that if it works, then they aren't following the __standard expected__ method of creating a `casper-rw` `ext` partition and adding `persistence` to the kernel options, because if they were doing that, they would absolutely run into the casper issue), that doesn't invalidate that bug #1489855 is very real and currently affects all Ubuntu derivatives. This is a __major bug__ that must be fixed by Linux distros and that utilities that create live USBs with persistence should not have to work around. – Akeo Sep 23 '19 at 11:32
  • 'Rufus can already create live drives with a persistent partition': When I get my Windows computer unpacked after moving to a new city, I intend to test Rufus and persistence with 19.10 :-) – sudodus Sep 23 '19 at 12:14
  • I have seen more threads, where I think users are tempted to use Rufus to create a persistent live drive from versions of Ubuntu, where it does not work because of that major bug. Please consider adding a warning about it or some logic, that will allow it only for versions of Ubuntu, Debian ... and derivatives, where we can expect it to work (Ubuntu 19.10+ and Debian 10+). I think this would be good both for Rufus and for the affected linux distros/versions. – sudodus Sep 24 '19 at 11:10
  • I considered it, but it's more tricky than it looks. What is 18.04.4 uses a fixed casper? And how can I know what is the upcoming version of the many Ubuntu derivative, that might include the fix. Even as distros and their version are much harder to detect than you realize (pick a few ISOs at random, including ones from 5 or 10 years ago, and see how easily you can come up with a method that'll tell you the name and version of the distro), even if I have the distro name and version, there's no guarantee that I can use a blanket `if (ubuntu_version < 19.10) print_warning();` – Akeo Sep 24 '19 at 12:56
  • Plus, I estimate that someone using Linux and encountering an issue need to be able to seek for help on that issue by googling the message they get (or if they aren't able to do that, they certainly need to learn to). And if they do just that, they will easily get to askubuntu entries such as this one, or a similar one [from the Rufus FAQ](https://github.com/pbatard/rufus/wiki/FAQ#mount_mounting_cow_on_root_failed_Invalid_argument). Or they can also have a look at the Changelog from the [Rufus homepage](https://rufus.ie) that explicitly mentions the Ubuntu persistence issue. – Akeo Sep 24 '19 at 13:00
  • OK I can see that it is not easy to make it automatic, but is there a warning about it in Rufus (and a link to a web page that mentions if persistence might work or not work for some major distros)? That should be rather easy to fix and to update in the future. – sudodus Sep 24 '19 at 13:14
  • You mean like the generic warning that tells people that if ISO mode is not working, they should re-create the USB in DD mode, and which gets mostly ignored by Rufus users? Also, there are already 2 generic warnings that are going to display when creating a Ubuntu drive with Rufus. Considering that, unlike the warnings aforementioned, the issue that you are asking to ask a 3rd warning about __is__ going to go away eventually, and that a lot of other distros (Debian and derivatives) are not affected at all, I see it better not to display a warning for what remains a specific Ubuntu issue. – Akeo Sep 24 '19 at 16:56
  • Besides, one can consider that the generic warning that advises users to try re-creating the media in DD mode if it doesn't boot properly in ISO mode __already__ serves as the warning you'd like me to add, as, if they do recreate the USB in DD mode, persistence will not be added, and they'll be fine. So really, it makes little sense to add a new warning in Rufus. Users who do pay attention to the existing Rufus warnings and notices will be able to overcome the casper issue. And users who don't clearly wouldn't have paid much heed to that proposed extra notice anyway... – Akeo Sep 24 '19 at 17:02
  • Well, many people will use Rufus to create USB boot drives with Ubuntu 18.04.x LTS before persistence will work. Let us hope that the good reputation of Rufus as a reliable and user friendly tool will survive. – sudodus Sep 24 '19 at 17:33
  • Hi, thank you very much for all of your help Sudodus and Akeo! I tried Akeos solution with debian and rufus, it is working quite well now. By the way Akeo I think Rufus is great and thank you for developing and supporting it so well! Good luck for the future releases! – user998456 Sep 24 '19 at 19:42
1

I am new to Linux and attempted to set up a live usb with perstence on Win 10. Here's my journey.

Tried various usb creators but found the only one to work was Linux Live USB Creator (LiLi).

Using Mint Cinnamon Tricia 19.3 Went through the setup procedure with LiLi and finalised the installation.

Booted from the usb pendrive and everything worked as it should including persistence.

Update manager needed updating, did that and refreshed the repositries. Updated everything and after reboot had a boot failure. (Doh!)

Went through the whole procedure again but this time when updating the software, I deselected anything to do with Kernel, Grub and Firmware.

Rebooted and everything worked fine.

So when updating DO NOT update the Kernel, Grub or Firmware. Otherwise you will have further work to do in terminal to get a recovery.

Hope this is helpful to Newbies like me.

  • I had already formatted the pendrive to Fat32. – Alex Watson Jan 27 '20 at 11:59
  • If you have a big USB pendrive it is an advantage to have a partition for persistence instead of a file for persistence because the file size (in FAT32) is limited to 4 Gibibytes. If I understand correctly, Mint 19.x cannot use the new sinpler method to use a partition for persistence, and then mkusb is a good choice, but it means that you have to run Ubuntu or Debian or a Linux distro derived from them. For example, you can install mkusb into your current USB pendrive and use it to create a persistent live system with a big partition for persistence in another USB pendrive. – sudodus Jan 27 '20 at 12:15