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 FILESYSTEMSAlternatively, set the filesystem to be checked every so many days rather than every so manymounts:tune2fs -i 13d /dev/hda1-i 13d sets the interval between checks to 13 days. Use 13w for 13 weeks, or use 13m for 13 months.Again, you can set this to be different values for different partitions.To force a check at the next reboot, you can set the number of mounts that the filesystem has had:tune2fs -C 14 /dev/hda1-C 14 will set the mount count to 14, which if you’ve set the automatic check to happen every 13mounts, means that the next time the filesystem is mounted (most likely on system reboot), it’ll bechecked.5-3. Saving Space on Large Filesystems and DirectoriesIf you have a really large filesystem, you can save some space by limiting the number of backupsuperblocks (see recipe 4-10 for when backup superblocks can come in handy.) However, you don’tneed quite as many as the default setting gives you if your directory is very large.tune2fs -O sparse_super /dev/hda1Similarly, for large directories, you can use hashed b-trees to speed up directory lookups:tune2fs -O dir_index /dev/hda1To set two -O options at once, use a comma and no space between the options:tune2fs -O dir_index,sparse_super /dev/hda15-4. Working with Disks, UUID, and LabelsAs well as the standard /dev/hda1, /dev/sda2 notation that you’re probably used to for referring to disks,<strong>Linux</strong> also provides universal unique identifier (UUID) notation. The major advantage of this is that,unlike the /dev notation, it’s linked specifically to a particular piece of hardware. So, although /dev/notation can shift between disks depending on how they’re plugged in, if you use UUID, this shouldn’thappen. This avoids the possibility of a system reconfiguration causing disks to be renamed and thuscausing knock-on breakage of things that reference that disk.The first part of this is to find out the existing UUID of your disks; you can do this using the blkidcommand:> blkid /dev/hda1/dev/hda1: UUID="0ef96300-36c0-4575-8a1d-2d36ff4cd585" SEC_TYPE="ext2" TYPE="ext3"121Download at WoweBook.Com

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

Saved successfully!

Ooh no, something went wrong!