You are not logged in.

#1 2010-02-20 22:12:38

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Compressing /usr with squashfs

I'm trying to follow this guide that is mentioned in the Maximizing SSD Perfomance in the arch wiki but it's slightly hard to follow since the article is written for a gentoo system and some things don't match up.

I'm in the process of writing a shell script that will do this so it will be less confusing for other users to do this process but I'm stuck at one point. The article mentions adding umount commands to what i'm assuming is gentoo's shutdown script so that it will unmount the squashfs when the system is going down. The say to add the lines to /sbin/rc but obviously arch doesn't have that script, so should where should I add the following code?

Step 8: Open /sbin/rc and look for the call to halt.sh. I should be in the part where the reboot and shutdown softlevels are processed. Add the following lines just BEFORE the 'LC_ALL=C exec /etc/init.d/halt.sh "${SOFTLEVEL}"'  line:

Code:
einfo "Unmounting stubborn squashfs folders"
umount -l /usr
umount -l /squashed/usr/ro

Offline

#2 2010-02-20 22:17:01

kjon
Member
From: Temuco, Chile
Registered: 2008-04-16
Posts: 398

Re: Compressing /usr with squashfs

it's easier to create a RO, squashed-fs /usr and then add a writable branch with aufs. I don't remember the exact syntax, but it works. I did that trick with my EEE700.


They say that if you play a Win cd backward you hear satanic messages. That's nothing! 'cause if you play it forwards, it installs windows.

Offline

#3 2010-02-20 22:43:10

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: Compressing /usr with squashfs

If you could find how to do that it'd be great, I think I found the place to add those lines. I added them to the "Unmounting Filesystems" section of /etc/rc.shutdown since thats where the other filesystems are unmounted.

Offline

#4 2010-02-21 00:01:00

kjon
Member
From: Temuco, Chile
Registered: 2008-04-16
Posts: 398

Re: Compressing /usr with squashfs

it was something like this on the fstab. I'm assuming you have your sqfs file on /squash and your writable branch on /usr-rw

/squash/usr.sqfs /usr squashfs loop 0 0
none /usr aufs br:/usr=ro:/usr-rw=rw 0 0

You'll have a fully functional /usr. Changes to the filesystem are stored on /usr-rw. I don't recall if the syntax is completly correct, but you can google for it.

If you need to recompress the usr (due to /usr-rw grows in time), just mksquashfs the /usr and replace the file stored on /squash. Also remove the /usr-rw directory and recreate it (this step is important, because aufs creates some hidden files there. Just whack the whole directory and recreate it, is the simplest solution).


They say that if you play a Win cd backward you hear satanic messages. That's nothing! 'cause if you play it forwards, it installs windows.

Offline

Board footer

Powered by FluxBB