13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 5 ■ WORKING WITH FILESYSTEMS■ Note If the filesystem you’re changing is the root filesystem, you may need to boot from a LiveCD or rescue discand then run e2fsck /dev/hda1 from there so that the journal file can be moved to its new inode. Then reboot asnormal. Debian, and some other distros, have a workaround that avoids having to do this.If your existing filesystem is too full to have space for the journal file (the normal default is about 5percent of the filesystem size), you can use -J to set various options to work around this problem. (Or seerecipe 5-5 for how to resize filesystems on the fly.) The following will create a journal of size 512MB:tune2fs -j -J size=512 /dev/hda1Alternatively, you can create a journal file on a different device (here, /dev/hdb2) with this:mke2fs -O journal_dev /dev/hdb2Then when you set up journaling on your overfull filesystem, you can set it to use this externaljournal file:tune2fs -j -J device=/dev/hdb2 /dev/hda15-2. Making Changes to Automatic fsck CheckingIf you’re running a nonjournaled filesystem, you will be familiar with the automatic e2fsck check forinconsistencies that is triggered after a certain number of mounts. (Journaled filesystems don’t need thisbecause the journal is what avoids inconsistencies.) This can be irritating if it happens at bootup whenyou need a machine to come up quickly. Using tune2fs, it’s possible to turn it off altogether:tune2fs -c 0 /dev/hda1-c 0 sets the number of mounts between checks to 0, thus turning it off.■ Note This means that your filesystem will never be checked unless you do it manually! This is a problemonly if you’re using a non-journaled filesystem such as ext2. Journaling means that there’s no need for regularautomatic fscks.More useful is setting the value to different numbers for different partitions so that they don’t all getchecked on the same bootup. This means that at least you’ll be checking only one partition on any givenboot, which will speed things up a little.tune2fs -c 13 /dev/hda1tune2fs -c 17 /dev/hda2120Download at WoweBook.Com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!