1

Background

Persistent live systems with Ubuntu store the data to persist in a file named 'casper-rw' or partition labeled 'casper-rw'. In addition there can be a file or partition 'home-rw' to store the data of the home directory.

Other linux distros use 'live-rw', 'persistence' or other naming conventions.

Questions

  • What format is better for casper-rw file ext2, ext3 or ext4, why?

  • What format is better for casper-rw partition ext2, ext3 or ext4, and why?

  • Parameters would be performance, size, limitations, etc.

Zanna
  • 70,465
ZEE
  • 127
  • 1
    For what purpose ? Your question is very broad. See anything from https://en.wikipedia.org/wiki/Comparison_of_file_systems to http://www.linux-magazine.com/Online/Features/Filesystems-Benchmarked to https://www.phoronix.com/scan.php?page=article&item=linux-41-filesystem&num=1 – Panther Sep 14 '17 at 02:27
  • 1
    for use in live iso persistence... – ZEE Sep 14 '17 at 02:35
  • 1
    Persistent live systems and the file systems used in the file or partition, where the data are stored to persist is a rather limited and specific subject. I do not agree that it is too broad, and suggest to reopen the question. – sudodus Sep 14 '17 at 10:41
  • 1
    The question is very broad and is asking about performance, size, and limitations of various file systems. Even if it were narrowed, which file system should I use for persistence it is still quite broad. Do you have benchmarks on file systems specific to persistence ? And of course I suppose as always it depends on what you are doing. – Panther Sep 14 '17 at 13:16
  • @bodhi.zazen, I chose to focus on what is specific for persistent live drives in the typical case, running in a USB pendrive or memory card. – sudodus Sep 14 '17 at 13:19
  • 1
    The main problem you will have with persistence is that is it a cow system. The limitations of persistence have very little to do with what filesystem you use. Persistence will work fine for minor changes for example saving themes or customization to your interface across boots, saving wireless networks and passwords, install a few packages, etc. – Panther Sep 14 '17 at 13:21
  • If you wish to store data, IMO, you are best off making a specific data partition as it is more easily shared and not dependent on cow if you make changes to your files. – Panther Sep 14 '17 at 13:22
  • Persistence completely fails if you try to run it as a normal installation. If for example you install a large number of packages, make extensive customizations to your system, and run update your system with sudo apt-get update && sudo apt-get upgrade. Each and every such installation / update / upgrade is stored in the cow and the data associated with such activity eventually becomes larger than a regular install – Panther Sep 14 '17 at 13:24
  • In addition, again with extensive changes, cow tends to fail. There tends to come a time when there are so many changes cow just is not designed to track so much data. – Panther Sep 14 '17 at 13:25
  • I agree, @bodhi.zazen , so if you want an up to date system with full flexibility concerning what to install, you should use an installed system. Such a system can be portable between computers too, but not as portable as a persistent live system, https://askubuntu.com/questions/786986/boot-ubuntu-from-external-drive/942312#942312 – sudodus Sep 14 '17 at 13:26
  • So if you are not going to update your system, due to the limitations of cow, your system will have significant security vulnerabilities which will go up patched as updates are a significant part of security. – Panther Sep 14 '17 at 13:26
  • With the low cost and size of modern flash drives it is better, IMO, to just do an installation onto the flash drive and run it as you would any standard desktop install complete with updates / upgrades . – Panther Sep 14 '17 at 13:27
  • Note: none of these comments really have to to with the files system you use for persistence, IMO the above limitations outweigh the benefits of persistence with the exception of saving settings across boots and installing a limited number of packages . – Panther Sep 14 '17 at 13:29
  • @sudodus - The point remains the question, as worded, is too broad. Specifically "What format is better for casper-rw file ext2, ext3 or ext4, why?" and "What format is better for casper-rw partition ext2, ext3 or ext4, and why?" and "Parameters would be performance, size, limitations, etc" . Whole chapters could be written on each of those questions complete with benchmarks, explanation of file system parameters and optimization, and why ? really ? What are you using said file system for ? What is your tolerance to faults ? very very very broad questions there. – Panther Sep 14 '17 at 13:32
  • @bodhi.zazen, Well, we have different opinions in this case. I have full respect for your view. Anyway, ZEE, the OP, seems happy with my answer. I can accept that the question remains on hold. If it will be deleted, I can hope that ZEE will remember the answer. – sudodus Sep 14 '17 at 13:37
  • @sudodus - That is true and I am glad you were able to answer ZEE to his satisfaction. I am answering your comment " I do not agree that it is too broad, and suggest to reopen the question." as to why I consider the question too broad. IMO ZEE should modify the question and narrow the focus. If the question is re-opened I will convert my verbose comments on persistence into an answer. – Panther Sep 14 '17 at 13:40
  • How can this question be too broad? There are only two possible answers, ext2 or ext4 or perhaps UDF if you don't want Windows trying to format the persistent partition every time the USB is inserted for data. ext2 vs ext4 should be simple to decide... UDF perhaps not so simple. – C.S.Cameron Aug 07 '18 at 16:44
  • @Panther, You are welcome to convert your verbose comments on persistence into an answer. I might reply with comments on your answer, because I am running a long-lasting test, where the persistent live system is performing better than I expected, when I started that test ;-) – sudodus Aug 08 '18 at 11:09

1 Answers1

2

File system for the casper-rw file or partition

The ext4 file system is more advanced than the previous ext2 and ext3 file systems. It is the standard file system used in many linux distros, and is well debugged and polished.

ext4 and ext3 have journaling, which helps a lot, when there are problems with the file system, and the file system must be repaired. But journaling causes additional write operations to the drive, and if it is USB pendrive or memory card, it can cause excessive wear of the memory cells. You can turn off journaling.

  • ext2 works well without tweaks in a USB pendrive or memory card, but I would recommend ext4 with journaling turned off.

  • In an SSD or HDD I suggest that you use ext4 with journaling turned on (which is the default).

    Please notice that the casper-rw partition need not be in the same drive as the persistent live operating system. This works with all Ubuntu versions, when booting via grub, and I have read (but not tested yet) that the newest version of syslinux can manage it too.

  • I suggest the same choice of file system for casper-rw files and partitions.

File system for the home-rw file or partition

If you create a home-rw file or partition, the standard advice is to use the same file system and tweaks as for the casper-rw partition. But there is an alternative, that makes it available to Windows.

I am experimenting with the UDF file system for home-rw. It works well with Ubuntu persistent live systems, and when the [USB pen]drive is plugged into a computer running Windows, it will be mounted with read/write permissions, so that files can be transferred easily between the Ubuntu persistent live system and Windows.

Installed system in an external drive

If you want an up to date system with full flexibility concerning what to install, you should use an installed system, installed into an external drive like it were installed into an internal drive. Such a system can be portable between computers too, but not as portable as a persistent live system.

Links

Some claim on the internet that persistence reduces lifespan of the USB stick. Is this true?

help.ubuntu.com/community/Installation/UEFI-and-BIOS#Final_system_tweaks

help.ubuntu.com/community/mkusb/persistent#Partitions

Experimenting with the UDF file system for home-rw

Boot Ubuntu from external drive

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • I think your answer proves the question is not too broad, well done. When you get a chance could you please update your answer with a comment on using the UDF file system for home-rw. A lot of people might like to be able to open home folder in Windows. – C.S.Cameron Aug 07 '18 at 18:23
  • I am experimenting with the UDF file system for home-rw. It works well with Ubuntu persistent live systems, and when the [USB pen]drive is plugged into a computer running Windows, it will be mounted with read/write permissions, so that files can be transferred easily between the Ubuntu persistent live system and Windows. – sudodus Aug 07 '18 at 18:37
  • I have tried your udf2home-rw script, People coming to this thread because they want info on custom USB installations might find it interesting. I can understand that writing to a closed post is not much fun, but it is getting some votes for reopen. – C.S.Cameron Aug 07 '18 at 20:43