LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 10-29-2008, 03:06 PM   #1
lumix
Member
 
Registered: Mar 2007
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323

Rep: Reputation: 30
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?
 
Old 10-29-2008, 04:08 PM   #2
ophirg
Member
 
Registered: Jan 2008
Location: Israel
Distribution: Kubuntu 13.10
Posts: 134

Rep: Reputation: 34
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.
 
Old 10-30-2008, 08:35 AM   #3
lumix
Member
 
Registered: Mar 2007
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323

Original Poster
Rep: Reputation: 30
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.
 
Old 10-30-2008, 08:37 AM   #4
lumix
Member
 
Registered: Mar 2007
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323

Original Poster
Rep: Reputation: 30
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
 
Old 10-30-2008, 09:52 AM   #5
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,117
Blog Entries: 2

Rep: Reputation: 113Reputation: 113
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.
 
Old 10-30-2008, 06:22 PM   #6
ophirg
Member
 
Registered: Jan 2008
Location: Israel
Distribution: Kubuntu 13.10
Posts: 134

Rep: Reputation: 34
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
 
Old 10-30-2008, 06:49 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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.
 
Old 10-30-2008, 08:00 PM   #8
ophirg
Member
 
Registered: Jan 2008
Location: Israel
Distribution: Kubuntu 13.10
Posts: 134

Rep: Reputation: 34
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Filesystems delta_simon Linux - Software 1 09-13-2007 11:11 PM
CD-RW Filesystems PatrickNew General 3 10-24-2006 10:35 PM
windows filesystems vs. linux filesystems irfanhab General 8 05-25-2004 08:21 AM
filesystems thesnaggle Linux - General 1 10-28-2003 01:12 PM
filesystems sxbah Linux - General 1 07-02-2003 02:12 PM


All times are GMT -5. The time now is 07:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration