Topic: File System Tweaks

First off at the very, very minimum one needs to slice up their drives with -

/boot
/
/var/log
/home

Also I would recommend an additional slice for /tmp also, but that depends on how much drive space you have, 2-4 Gig is usually fine

Reason for the extra slices is boot really does need to be secure and root needs to be isolated from home and log.   For those who just put everything on one slice just get a buggy daemon or something that fills up and corrupts your file system wink

Anyway for a basic set up I'd do this to squeak a bit of performance, with the following slicing scheme as -

/dev/sda1     ext2       /boot      (around 256MB is fine)
/dev/sda2     ext4       /              (depending on drive, I usually go for around 12 - 15 GB)
/dev/sda5     ext4       /var/log  (around 256MB is fine)
/dev/sda4     swap                     (me, I usually only have about 1 GB)
/dev/sda6     ext4       /home     (rest of the drive space)

For /var/log while booted into a boot disk or Live CD tweak /var/log with -

tune2fs -o journal_data_writeback /dev/sda5
tune2fs -O ^has_journal  /dev/sda5

Then mount root to /mnt with

mount /dev/sda2 /mnt
cd /mnt/etc

Edit fstab with what ever tool you're comfortable with, vi or nano.  I use vi so I would execute this

vi /mnt/etc/fstab

The options for the modified file systems are -

# / was on /dev/sda2 during installation
UUID=xxxxxxxxx    /               ext4        relatime,errors=remount-ro            0 1
# /boot was on /dev/sda1 during installation
UUID=xxxxxx         /boot           ext2        noatime,defaults            0 1
# /home was on /dev/sda6 during installation
UUID=xxxxxx        /home           ext4        relatime            0 2
# /var/log was on /dev/sda5 during installation
UUID=xxxxxxx      /var/log        ext4        noatime,data=writeback            0 1

What this does is increase read/writes to file systems where you don't need the precautions like that of journaling for example.  There is a lot a activity with /var/log so this would tweak out a bit of performance.  If you're on an old laptop also you may want to turn off journaling, then set noatime and writeback on all slices also if it's on a very sluggish system.  But be aware though you loose the ability to recover from a crash.  But on old hardware one has to do what one has to wink

Where Thought Crime is committed
http://www.rejecttheherd.net

Re: File System Tweaks

:|and so we should all stand, clap, cheer, and follow you blindly?...

Re: File System Tweaks

good advice for older machines. If you have the ram to spare and don't mind losing the logs on reboot you can mount /var/log and /tmp on a ramdisk, that'll help a little too.

I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.

Re: File System Tweaks

Still recommending /swap on a separate partition?  And a monolithic chunk of swap space?  I'm no expert but I read that there are better ways of doing this now.

Re: File System Tweaks

Hi,

Thanks for these tips.

I have just found some explanation about noatime, relatime and atime option, maybe it can be useful for some people not knowing what it is like I just was: http://linux.koolsolutions.com/2009/01/ … t-options/

May I ask why /boot partition is in ext2 ?

I am planning to switch to statler as main system via a clean install on my eeepc; do you guys recommend ext4 or another file system (home usage for that machine)?

thanks,

Eee-PC 1000H    |  Statler r20110207 Openbox
Vaio VGN-FE21H  |  Statler r20110207 Openbox

no more proprietary OS at home, and still no printer smile

Re: File System Tweaks

alef wrote:

I am planning to switch to statler as main system via a clean install on my eeepc; do you guys recommend ext4 or another file system (home usage for that machine)?

I use (and recommend) ext4 on my netbook SSD. Almost 2 years and counting of obsessive daily use, no problems yet.

My "partitioning scheme" is a single ext4 partition that spans the entire tiny (8gb) drive. There is no "one size fits all" solution for every user.

Re: File System Tweaks

Ext4 is generally regarded as the best option and most people use it. For SSD's, I think there is some tweaking one has to do to ensure it's lifetime, but I don't own one so I can't tell you. Snowpine doesn't mention anything about tweaks though and since he uses one, I guess it's a better option to follow his advice regarding SSD's.

For a regular HDD, no tweaking is required.

Let's do it and don't screw it.

Re: File System Tweaks

I think I chose the 'noatime' option (can't remember and I'm not at that computer right now).

I lurk on several Linux forums and I have never, not once, heard of a single user wearing out their SSD running Linux. It's a myth. smile

On the other hand, I did destroy a conventional HDD once (while defragging Windows XP)...

Re: File System Tweaks

My SSD partitions (root and home) are both ext3, noatime, relatime.  Runs great.

I've heard of one Dell Mini user killing a SSD, but this was due to mechanical/thermal damage, not writes.

while ( ! ( succeed = try() ) );

Re: File System Tweaks

Hmm, maybe I should consider getting one. Oh well.. don't have the money atm. sad

Let's do it and don't screw it.

Re: File System Tweaks

thanks all for your answers.

Unia wrote:

For a regular HDD, no tweaking is required.

Do I understand well: you are considering here tweaking regarding drive lifetime, and Pagan's post rather refers to performance.

I have a regular HDD, no SSD, but was considering to follow part of his advices to have better performance and security.

always open for suggestions.

Eee-PC 1000H    |  Statler r20110207 Openbox
Vaio VGN-FE21H  |  Statler r20110207 Openbox

no more proprietary OS at home, and still no printer smile

Re: File System Tweaks

Sure, there are options to tweak it for optimal performance, but I don't think you will notice any big difference as a regular user; ext4 will do. Don't get too confused by all the filesystem types out there.

Let's do it and don't screw it.

Re: File System Tweaks

Separate partition for your data is also recommended, as it's not very good to store important things in your /home folder (together with just downloaded "funny" pictures, browser cache, instant messenger log and other crap.)

/home is excellent for keeping your config files for different apps you want to use after a reinstall (unless you distro-hop... in this case it may be safer to manually reconfigure each application's settings) but not for your private things like home video and PhD thesis.

The /data partition shouldn't be messed up with different hidden folders, and it should always be available neatly, regardless what distro you use from the ones that exist on your computer or other live systems. Since its content is usually irreproducible - best thing we can do is to clone this partition as frequently as possible.

(IMHO)

Re: File System Tweaks

You should always have an external backup of your PhD thesis and other important documents (on an external drive, a CD, a thumb drive, over the network, etc.).

If your computer is stolen or destroyed, it does not matter whether your documents are on /home or a separate data partition. smile

Re: File System Tweaks

snowpine wrote:

You should always have an external backup of your PhD thesis and other important documents (on an external drive, a CD, a thumb drive, over the network, etc.).

If your computer is stolen or destroyed, it does not matter whether your documents are on /home or a separate data partition. smile

Of course. That's default for me. I use CDs and Dropbox paralelly.... sometimes I even upload a file into my gmail account.

Re: File System Tweaks

When it comes to backups, I prefer scattering my most important files around. Two copies on different HDDs in the same computer. Then another copy on a computer that isn't in the same house (usually at my mom's) and then somewhere on the internet, like dropbox or SkyDrive. Keeping copies on the same physical location is a really bad idea if someones decides to start a fire.

As for the partitioning, my Eee 900 runs the whole 16gb SSD as one Ext4 partition. /tmp on ramdisk. 1GB ram is seldom filled under Statler.

Re: File System Tweaks

btw, how do you make ramdisk for /tmp?

Re: File System Tweaks

boromeus wrote:

btw, how do you make ramdisk for /tmp?

I think the technique is explained here: http://crunchbanglinux.org/wiki/crunche … ll_tips?s\[]=fstab#purge_logfiles_at_boot

Eee-PC 1000H    |  Statler r20110207 Openbox
Vaio VGN-FE21H  |  Statler r20110207 Openbox

no more proprietary OS at home, and still no printer smile

Re: File System Tweaks

^
thx