Score:2

Would it be possible to create additional partitions (e.g. /home) on a Xubuntu 20.04 Live stick?

in flag

Recently I made a live USB stick with Xubuntu 20.04.02 LTS with Startup media creator (this might be usb-creator-gtk).

I tried to resize the partition after creating the stick in order to provide an additional data partition. But that was impossible: Although the capacity of the stick was 32 GB, gparted showed it as completely occupied and prevented me from reducing the size of the ISO9660-partition on it.

However, lsblk tells me about three partitions on it:

$ lsblk -o name,size,fstype,partflags,model,vendor /dev/sdc
NAME    SIZE FSTYPE  PARTFLAGS MODEL            VENDOR
sdc    29,3G iso9660           Flash Disk       Generic
├─sdc1  1,6G iso9660 0x80
├─sdc2  3,9M vfat
└─sdc3 27,7G ext4
$ lsblk -o Name,size,fstype,uuid,label,mountpoint | grep -E sdc
sdc     29,3G iso9660  2021-02-09-19-20-08-00               Xubuntu 20.04.2.0 LTS amd64
├─sdc1   1,6G iso9660  2021-02-09-19-20-08-00               Xubuntu 20.04.2.0 LTS amd64 /media/user/Xubuntu 20.04.2.0 LTS amd64
├─sdc2   3,9M vfat     54C5-9C6C                            Xubuntu 20.04.2.0 LTS amd64
└─sdc3  27,7G ext4     80b4c9bd-f04c-4bc2-8ae8-7551e6026d49 writable                    /media/user/writable
$

Surprisingly the same UUID appears twice: Once for the whole device and once more for the ISO9660-partition. The same label even appears three times: for all three partitions!

To my understanding that's not a very good idea. I would prefer more meaningful labels, e.g. Xubuntu20.04.2-amd64_purpose, where purpose indicates the purpose of that partition.

I wonder about the partition with label writable: It seems to keep track when the stick was used for installation. I could store data there, but I could not access them from the live system!

I have the impression that the partition with label writable is mounted in the live system as /var/crash. I stored a script there and I used it. But after shutting down the live system, my script on /var/crash was gone. Could someone please demystify the partition architecture of my Live USB-Stick for Xubuntu 20.04.02 LTS amd64?

The comments up to 2021-08-09 told me about the benefits of a full install (which is not my question) and how to make a persistent install (which also is not my question).

I had wasted some weeks with persistent installs using unetbootin: I had made them with a persistent partition labelled casper-rw. Unfortunately during shutdown, there is an awful lot of writing to the thumbdrive while the screen looks innocently black. If one disconnects the stick during that dangerous time, casper-rw is ruined (inode errors)!

Updating a system on a persistently installed USB-drive can take an awful amount of time. E.g. I exchanged firefox by chromium. I suppose that the time consumption is due to the huge number of turns of the transfer direction between reading and writing, which causes the electronics of USB3-devices to slow down by large factors. It got even worse, when I tried to compile a Jamulus system to be present on my live stick. I know that during make many files are read, other files are written and possibly intermediate files are created and deleted after use. This causes stress for which the electronics of USB3-sticks is not made.

To get out off the mud after wrecking my partition casper-rw, I had created a spare partition with a backup copy of a previous working casper-rw (of course with a different LABEL). But copying from one to the other one (both had exactly the same size) with cp -a (after deleting all previous files of the target partition) took much longer than adding an intermediate step of first copying to my fixed disk and then copying to the thumb drive: This observation led me to the conclusion that changing the data transfer direction is the root cause for time consumption when updating a persistent installation.

My questions above were after an explanation of why I could not resize the partition made with start media creation tool.

My questions above were after the purpose of the partition writable found on the stick.

My objective is to create partition on the live stick, which can be mounted as /home to be used for scripts, which apply some on-the-fly modifications like those, which I apply manually when trying the live system. My second objective is to create partition on the live stick, which can be mounted as /home with scripts of on-the-fly installations of additional software (which happen in the ram-fs and which will be gone after shutdown). Of course, the ultimate goal would be to have that partition mounted as /home automatically.

My objective would be in the middle between a DVD-like Read-Only installation medium and a persistent one. The difference is that such a stick can not be updated (persistently). The difference to a full install is, that it will run on any computer (capable of running the system, of course) rather than the particular one, to which a full install of a stick seems to be limited.

(N.B. I once made a full install stick for a Lenovo W530. It did not boot on a Lenovo T410. But it did on a T430 and on a T430s. The architecture of those two models seems to be close enough to let them boot, but many other computers which I tried did not boot from it. So in general, a full install seems to be limited to the target computer and very close relatives only).

Unfortunately persistent partitions seem to be infeasible because of the very time consuming shutdown process: I observed more than 5 minutes of disk activity! Otherwise inode-errors happen very often.

guiverc avatar
cn flag
It's easiest to re-write the ISO to the thumb-drive and create one with *persistence* if that's what you're after. An ISO is written as a read-only image intentionally following the ISO9660 standard for that (to prevent corruption or someone changing the image); the standard originally applying to CDs. As it can't write to it; a file-system is built in RAM and that is used (COW or copy-on-write) so all files you have write access to are in the *ramdisk* (note: it isn't very large; is created a set size that will work even on boxes with limited RAM)
guiverc avatar
cn flag
Does this answer your question? [How is it easier to make a persistent live drive with Ubuntu 19.10?](https://askubuntu.com/questions/1181854/how-is-it-easier-to-make-a-persistent-live-drive-with-ubuntu-19-10)
heynnema avatar
ru flag
Don't try and create/modify a full-time run-time environment on a flash drive. It's not reliable. There's never enough storage space. You'll never be happy in the long run. Use the Ubuntu Live to test Ubuntu to see if you like it, or as a diagnostic tool to fix an existing Ubuntu installation on disk.
C.S.Cameron avatar
cn flag
Yes it is possible to use the "writable" partition for persistence but it is a hassle using a Startup Disk Creator clone. Better to create a Persistent Live USB using mkusb: https://help.ubuntu.com/community/mkusb or a Full install USB.
C.S.Cameron avatar
cn flag
If you want a home partition on a persistent USB stick, create an ext4 partition and label it `home-rw`. There should also probably be a `writable` or `casper-rw` partition. Persistence can also be done with `writable` and `home-rw` files on a FAT32 partition. Max size for files on FAT32 is 4GB each.
C.S.Cameron avatar
cn flag
FYI: Startup Disk Creator makes ISO9660 clones of the ISO file. All Live USB's of a Ubuntu release made by SDC, (or Etcher, mkusb or dd, etc), have the same UUID. For Ubuntu 21.04 the UUID is 2021-04-20-11-16-16-00.
sudodus avatar
jp flag
If you want a persistent live or installed system in a USB drive, that is responsive (fast) and reliable, it is important to have a fast USB drive. The best alternative is an SSD. Today small standard SATA-connected SSDs are cheap, and you can connect it via an adapter to a USB3 port of the computer.
sudodus avatar
jp flag
You might be happy with a persistent live system by [mkusb](https://help.ubuntu.com/community/mkusb) at least if the USB drive is responsive enough. [This link](https://ubuntuforums.org/showthread.php?t=1958073&page=54&p=14051419#post14051419) shows how to get a 'custom live' system, that should be reliable also in a slower USB drive (because after creating the tarball, you can run it live (with or without 'toRAM').
in flag
Thanks for the responses. The question, why the same UUID is used more than once and why the same label is also used more than once was not yet covered. Has this been made that way to prevent someone from mounting those partitions by UUID or by LABEL?
Score:3
cn flag

Persistent Install vs Full install

Ubuntu can be installed to a USB in different ways. A Live install does not save between sessions. A Persistent install extracts the OS from a compressed file and saves data to an overlay file or partition each session, and a Full install installs the complete OS to the USB just like an install to internal disk.

Comparison between Persistent and Full install USB

Advantages of a persistent install:

  1. You can use the persistent pendrive to install Ubuntu to another computer.

  2. A persistent install takes up less space on the pendrive.

  3. You can reset the pendrive by overwriting the old casper-rw file with a new one.

  4. The install to pendrive takes less time.

  5. Slightly less wear on the drive.

Advantages of a Full install:

  1. You can update and upgrade.

  2. If you have problems or wish to modify, the solution is the same as with an internal install, (You can ask for help in the forums).

  3. No ugly startup / install screen.

  4. Better security, you can use full encryption

  5. You can use proprietary drivers.

  6. Swapfiles and partitions work and Hibernation can be enabled.

  7. Many persistent installs are limited to a 4GB casper-rw and a 4GB home-rw persistence file, to get more persistence requires persistence partitions. Once casper-rw is full, the drive will not boot.

  8. More efficient usage of disk space. Does not require reserved space for persistence.

  9. Faster boot, no automatic disk checking or Try Ubuntu/Install Ubuntu screen.

  10. You can run VBox and use virtual machines.

  11. Generally faster boot than Live or Persistent USB's.

  12. More stable, better for day to day use. I have run Ubuntu off a flash drive for 5 years making only LTS upgrades.

Note that once booted, both methods run at about the same speed. If the computer has lots of RAM Ubuntu should run mainly in RAM and there will not be a big difference between running off internal HDD and USB3 flash drive f.

Full Install Method

A quick and easy method to flash a Full install to USB can be found here: Easy Full Install USB that Boots both BIOS and UEFI

A more traditional methods for creating a Full install USB from scratch can be found here: How to Create a Full Install of Ubuntu 20.04 to USB Device Step by Step

Persistent Install

I recommend mkusb for making Persistent Ubuntu installs to USB, see: https://help.ubuntu.com/community/mkusb

See also for converting Live USB to Persistent Live USB: How to turn my Live USB to Persistence Live USB?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.