File System Maintenance

From LinuxFanBoy

Jump to: navigation, search

Linux has can use many file system types include NTFS used by Windows.

Contents

File system types

Maximum Sizes of File Systems

  File System	File Size [Byte]	File System     Size [Byte]
  Ext2 or Ext3 (1 kB block size)  	234 (16 GB)	241 (2 TB)
  Ext2 or Ext3 (2 kB block size)  	238 (256 GB)	243 (8 TB)
  Ext2 or Ext3 (4 kB block size)  	241 (2 TB)	244 (16 TB)
  Ext2 or Ext3 (8 kB block size)  	246 (64 TB)	245 (32 TB)
  ReiserFS 3.5	                   	232 (4 GB)	244 (16 TB)
  ReiserFS 3.6 (under Linux 2.4)  	260 (1 EB)	244 (16 TB)
  XFS	                           	263 (8 EB)	263 (8 EB)
  JFS (512 Bytes block size)	   	263 (8 EB)	249 (512 TB)
  JFS (4 kB block size)	  	263 (8 EB)	252 (4 PB)
  NFSv2 (client side)        		231 (2 GB)	263 (8 EB)
  NFSv3 (client side)	          	263 (8 EB)	263 (8 EB)

The partitions, their file system times and where they are mounted is controlled by /etc/fstab.

Althow / is the only required mount point, there are several common mount points used by the system for these resions.

  • /boot Some BIOS systems can't load anything past 1023 cylinders on a disk. This partition the first partition and is keep just big enough to hold GRUB and the needed kernel files.
  • /usr hold the bulk of the systems files. It should be at least eight (8) GB but his is dependent on how much of the system you load. This directory contains things like all the system libraries.
  • /home is a place holder for user home directories.
  • /var contains logs and often is used to keep applications files.
  • /opt this is the standard and prefered location of applications and their files.
  • /tmp is used by may applications to store files only needed for a short time. Making this a seperate file system keeps run away programs for filling the root (/) file system and bringing the system to it to a halt.


Creating a Filesystem

Each of these will create a new journal file system on partition 1 of raid disk 1.

mke2fs -j /dev/md1p1
mkfs -t ext3 /dev/md1p1
mkfs.ext3 /dev/md1p1


Mounting a Filesystem

mount LABEL=/boot
mount /dev/md0p0

cat /etc/fstab


Auto Mounting Media

/etc/auto.master
/etc/auto.misc
cd -fstype=iso9660,ro,nosuid,nodev   :/dev/cdrom

Checking file system integrity

There are a number of ways to force a check of the integrity of the file systems.

  touch /forcefsck
  init 6 (or at next boot)


File System Attributes

I think of these more of file attributes but there are file system dependent.

The command chattr has three options.

+a - The file can not be deleted but can be appended.
+d - The file will be skipped by the dump backup command.
+i - immutable! The file can not be changed or deleted.


Back it UP!

There are lots of backup systems and software but like vi, tar is available on every system and does the job quit well.

  tar cvpzf backup.tgz --exclude-/proc --exclude-/lost+found \ 
      --/exclude=/backup.tgz --exclude-/mnt --exclude=/media \
      --exclude=/sys / 

To restore:

  tar xvpfz backup.tgz -C /
  mkdir /proc
  mkdir /lost+found
  mkdir /mnt
  mkdir /media
  mkdir /sys