Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323
Rep:
Trying to understand filesystems
I have chosen the "make usb start-up" option in Ubuntu 8.10 (Intrepid) which pretty much just makes a persistent, yet live-like install. That is, it's live in the sense that it discovers its hardware environment each time it boots up, so within reason it will boot up on nearly any PC. It's persistent in that it retains application installations, documents, settings, etc.
So how are they accomplishing the persistence, specifically? What kind of file system, mounted in what way, is doing this. I'll try to repost with a df dump, but I do know that the USB flash drive has only one fat32 partition on it, and that the rest appears to be in a squashfs. But I just read that squashfs is ro. So where is the information retained, and how is it set up?
it has nothing to do with the filesystem.
to make a live distro persistent you need to save only the things you change
for most distros it's:
global files in /etc and maybe /var
private config files, documents and preferences in /home and /root
the packages you installed(or a list of them)
it varies from one distro to another with special features and different locations of files, but that's the general idea.
you only need the files, not the filesystem. it's like you can copy a file from a ntfs partition to a reiserfs partition.
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323
Original Poster
Rep:
I'm a bit confused by this. The entire working environment is loaded (by Syslinux) from a virtual partition (forgive the parlance) that is of squashfs type filesystem. From what I've read, this is a read-only filesystem. Is this not true? If so, then I'd think the filesystem would indeed prevent one from being able to make or save changes to it.
You are correct squashfs is a read-only system. The persistent changes will be written to another device/partition. In this case I'd bet you'll find the changes in that fat32 partition.
the way the os can make changes is by using unionfs.
they can mount the same directory(and maybe the same file?) from more than one filesystems.
so what is happening is that the original files that you haven't changed are mounted from the original read only squashfs and the changes are made to the other(fat32 for persistent storage and tmpfs for ram).
there are other ways, but the idea is that you have the original version mounted as read only and the modified as read write.
The tmpfs filesystem is commonly used. It uses cached ram directly so it doesn't waste memory.
Look at the output of "mount" without options to see what is mounted and what filesystem is used.
jschiwal,
that's true, but live distros, the subject of this thread, don't have a swap partition to page out unused pages. i know tmpfs can page out but when there is nowhere to page out to, it just doesn't page out.
there is no way to save memory when you have to keep the pages you write.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.