PersistentTechnic
From LinutopWiki
Contents |
A word on filesystems
When one writes a file on a hard disk, complex mechanisms are involved to act on the hardware (where do I write? do I have the right? do I follow a symlink? etc.). This is handled by the Linux kernel and users don't have to take care about all these questions. The Linutop OS uses standard filesystems (vfat and ext2), but also two other filesystems: squashfs and aufs which don't directly act on the hardware.
Squashfs and Aufs
The squashfs filesystem is highly compressed and read-only filesystem. It is represented on the system as a single file, just like a .zip or .tar.gz archive. The core of the Linutop OS is a squashfs system which contains everything (configuration, applications, kernel modules...). The file is /cdrom/casper/filesystem.squashfs.
When the system boots, this file is mounted, which means that it is then readable, just like any other filesystem. But an operating system needs to be able to write data, which is not possible with a squashfs filesystem. That's why we will add a writable layer in addition of the read-only one. To avoid writing on the disc (or USB key, or flash card), we will write in memory. And Aufs will help us to unify both layers in one. For the user, the resulting system will look like one.
Linutop Persistence mode
With the steps described above, we are in a Live CD configuration. This means that anything that is written on the system is written in RAM, and rebooting will destroy everything that has been done on the writeable layer. That's exactly what happens if you chose to remove all the persistence on the Linutop OS.
By default the Linutop system adds a third layer. This layer is the second partition provided on the USB key. It is mounted rw (read/write) on the /home directory. So when you will write in your personal directory (/home/linutop), data will be written on the key, and not in the memory. That's why documents and personal settings can be kept after a reboot.
In full persistence mode, the second partition is used to replace the ram. Because of the second layer, everything is kept after a reboot.
Mountpoints
Details of mount points:
Default mode
- hda1 on /cdrom and squashfs on /rofs (read only)
- tmpfs on /cow (read write)
- aufs unifies /rofs and /cow to /
- hda2 on /home (read write)
Full persistence
- hda1 on /cdrom and squashfs on /rofs (read only)
- hda2 on /cdrom/.cow (read write but not directly usable)
- aufs unifies /rofs and /cdrom/.cow to /
Linutop Lock (version 2.0.1)
- hda1 on /cdrom and squashfs on /rofs (read only)
- hda2 on /rofsbis (read only)
- tmpfs on /cow (read write)
- aufs unifies everything to /