fstab 파일의 가장 위에 보면 보통 아래와 같은 설명이 달려있다.

# <file system> <mount point>   <type>  <options>       <dump>  <pass>

앞의 네 항목은 딱 보면 알만한 내용들이라 그렇게 어렵지 않다.

  1. file system : 마운트 할 파일 시스템 (/dev/sda, UUID=BLAHBLAH..., proc 등)
  2. mount point : 마운트할 경로 (/, /mnt/usb 등)
  3. type : 마운트할 파일 시스템의 타입  (ext4, ntfs 등)
  4. options : 마운트할 때 줄 옵션 (rw, ro, noexec 등)

문제는 마지막 두 항목은 dump나 pass라는 이름만 보고는 어떤 역할을 하는지 알기 힘들다는 것이다. 이미 설정되어있는 값을 보아도 0이나 1같은 숫자 뿐이다. 이런걸 알아보려면 역시 Manpage가 우선이다. Manpage를 보면 마지막 두 항목은 다음과 같이 설명되어 있다.

The fifth field (fs_freq).
This field is used for these filesystems by the dump(8) command to  determine which filesystems need to be dumped.  If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.

The sixth field (fs_passno).
This field is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot  time. The root filesystem  should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2.  Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize  parallelism available in the hardware.  If the sixth field is not present or zero, a value of zero is returned and fsck will assume that  the filesystem does not need to be checked.

다시 말하자면, dump라고 되어있는 다섯번째 항목은 해당 파일 시스템이 dump가 필요한지 여부를 설정하는 것이고, 마지막 여섯번째 항목은 리부팅시에 파일시스템을 검사할지 여부를 설정하는 것이다. 파일 시스템을 dump해야한다면 다섯번째 항목을 1로, 아니면 0으로 하면 되고, 파일 시스템을 리부팅 시에 검사하려면 여섯번째 항목을 1보다 큰 값으로, 필요없으면 0으로 하면 된다. 검사는 1부터 순서대로 한다.

'Operating' 카테고리의 다른 글

MySQL Replication 복구  (0) 2015.02.05
리눅스 tmp 디렉토리 파일 시스템  (0) 2015.02.02
vipw - passwd 파일 편집  (0) 2015.01.31

+ Recent posts