[syslinux] mounting other compressed filesystems

Marc Haisenko haisenko at be-ok.com
Tue Sep 14 08:13:06 PDT 2004


On Tuesday 14 September 2004 17:28, Luke Albers wrote:
> On Tue, 2004-09-14 at 09:20, Marc Haisenko wrote:
> > Oooh, that's a hard one. Well, first thing that comes to mind is good old
> > cron, but you're facing a big problem regardless of how you do it: what
> > shall the routine that compresses the FS do when the FS changes while it
> > is compressing ? You'll surely run into corrupted FS's sometime, I think.
>
> I think I could remount the FS in ram as read-only before compressing
> it, right?

Of course, and if you can ensure that no process will then write to your FS 
it'll work just fine. However this setup seemed way too simple for me, the 
real world is normally more complex which is why I've not even considered 
writing this in the first place ;-)

> > The other thing to think about is that you should minimize writing to
> > CF's because the more often you write to them the sooner they'll fail
> > (thus if you have a FS on a CF you should mount it with the "noatime"
> > option so that the FS driver doesn't write timestamps). This means
> > writing to the CF in regular intervals is propably a bad idea.
>
> This is why I am considering a separate, probably around 10MB filesystem
> when uncompressed.  Basically I only need it to write a few config files
> and logs whenever it is turned off, which should not be often
> (weeks,months, maybe years).  Although I am thinking I should probably
> have it write everything a little more often than that in case of a
> power failure or some other event.  But, It wouldn't be a constant
> thing.  By "regular intervals" I mean every couple days or every week.
> Since the number of writes should be in the low hundred-thousands, I
> thing this should be alright.  Correct me if I am wrong, though.

Yes, you're right. With "regular interval" I was thinking in the hours or 
minutes.

> > I have an idea on how to solve this, maybe it suits you:
> >
> > I guess that the stuff in /opt/xxx can be summarized into two categories:
> > stuff that changes and stuff that's static. If the static stuff is taking
> > up the majority of space you could do the following:
> >
> > The root fs is a compressed image. It contains a compressed file trees
> > (I'd use .cpio.bz2 for this). This compressed file tree gets extracted
> > into a ramdisk and holds all your static stuff, let's say that this
> > ramdisk is mounted at /static.
> >
> > Then you have a normal, uncompressed partition which has symlinks into
> > the /static tree.
> >
> > Let's say your /opt/xxx looks like this:
> >
> > /opt/xxx/etc/config.conf
> > /opt/xxx/etc/...
> > /opt/xxx/bin/ -> /static/bin/
> > /opt/xxx/mixed/anotherconfig.conf
> > /opt/xxx/mixed/anotherstatic -> /static/mixed/anotherstatic
> >
> > I hope you understand what I mean. This way all you're dealing with is
> > read-only compressed data and uncompressed read/write data.
>
> I get your idea and I think I will use parts of it.  I havent thought
> about symlinking to an uncompressed partition.  However, space on the CF
> card is valuable so I may find out that using a full 10 MB (I may not
> even need this much) is out of the question.  It would take the same
> amount of space, but it should be easy to do the same thing with another
> ext2 image on the FAT16 card.  Compressing it would still be very
> helpful, though.
> > C'ya,
> > 	Marc
>
> Thanks a lot for the suggestions.  If anyone has more please send them
> out.  Especially if you can explain to me how to mount another gzipped
> filesystem.

No problem.
C'ya,
	Marc

-- 
Marc Haisenko
Linux Solutions
Be O.K. service group GmbH

Rüdesheimer Straße 7
D-80686 München
Tel:   +49 (0)89 - 54 84 99 73
Fax:   +49 (0)89 - 54 84 99 28
e-mail: haisenko at be-ok.com
http://www.be-ok.com




More information about the Syslinux mailing list