LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trying to understand filesystems (https://www.linuxquestions.org/questions/linux-newbie-8/trying-to-understand-filesystems-679818/)

lumix 10-29-2008 02:06 PM

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?

ophirg 10-29-2008 03:08 PM

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.

lumix 10-30-2008 07:35 AM

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.

Thanks for the reply.

lumix 10-30-2008 07:37 AM

df -h:

Filesystem Size Used Avail Use% Mounted on
tmpfs 252M 2.0M 250M 1% /lib/modules/2.6.27-7-generic/volatile
tmpfs 252M 2.0M 250M 1% /lib/modules/2.6.27-7-generic/volatile
tmpfs 252M 0 252M 0% /lib/init/rw
varrun 252M 112K 251M 1% /var/run
varlock 252M 0 252M 0% /var/lock
udev 252M 2.8M 249M 2% /dev
tmpfs 252M 208K 251M 1% /dev/shm
rootfs 243M 141M 90M 62% /
/dev/sdb1 959M 948M 11M 99% /cdrom
/dev/loop0 676M 676M 0 100% /rofs
tmpfs 252M 1.1M 251M 1% /tmp
/dev/sda1 36G 30G 4.4G 87% /media/disk

estabroo 10-30-2008 08:52 AM

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.

ophirg 10-30-2008 05:22 PM

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.

read about unionfs, squashfs and tmpfs

jschiwal 10-30-2008 05:49 PM

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.

ophirg 10-30-2008 07:00 PM

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.

i think i use "page out" much too often
page out


All times are GMT -5. The time now is 09:41 AM.