µ±Ç°Î»ÖãºLinux½Ì³Ì - Linux - /etc/fstabÎļþʹÓÃ

/etc/fstabÎļþʹÓÃ

1 fstabÎļþµÄ×÷ÓÃ
Îļþ/etc/fstab´æ·ÅµÄÊÇϵͳÖеÄÎļþϵͳÐÅÏ¢¡£µ±ÕýÈ·µÄÉèÖÃÁ˸ÃÎļþ£¬Ôò¿ÉÒÔͨ¹ý""mount /directoryname""ÃüÁîÀ´¼ÓÔØÒ»¸öÎļþϵͳ£¬Ã¿ÖÖÎļþϵͳ¶¼¶ÔÓ¦Ò»¸ö¶ÀÁ¢µÄÐУ¬Ã¿ÐÐÖеÄ×ֶζ¼Óпոñ»òtab¼ü·Ö¿ª¡£Í¬Ê±fsck¡¢mount¡¢umountµÄµÈÃüÁÀûÓøóÌÐò¡£

2. fstabÎļþ¸ñʽ
ÏÂÃæÊÇ/etc/fatabÎļþµÄÒ»¸öʾÀýÐУº
fs_spec fs_file fs_type fs_options fs_dump fs_pass
/dev/hda1 / ext2 defaults 1 1

fs_spec - ¸Ã×ֶζ¨ÒåÏ£Íû¼ÓÔصÄÎļþϵͳËùÔÚµÄÉ豸»òÔ¶³ÌÎļþϵͳ£¬¶ÔÓÚÒ»°ãµÄ±¾µØ¿éÉ豸Çé¿öÀ´Ëµ£ºIDEÉ豸һ°ãÃèÊöΪ/dev/hdaXN£¬XÊÇIDEÉ豸ͨµÀ(a, b, or c)£¬N´ú±í·ÖÇøºÅ£»SCSIÉ豸һÃèÊöΪ/dev/sdaXN¡£¶ÔÓÚNFSÇé¿ö£¬¸ñʽһ°ãΪ:

,ÀýÈ磺``knuth.aeb.nl:/''¡£¶ÔÓÚprocfs£¬Ê¹ÓÃ``proc''À´¶¨Òå¡£

fs_file - ¸Ã×Ö¶ÎÃèÊöÏ£ÍûµÄÎļþϵͳ¼ÓÔصÄĿ¼µã£¬¶ÔÓÚswapÉ豸£¬¸Ã×Ö¶ÎΪnone£»¶ÔÓÚ¼ÓÔØĿ¼Ãû°üº¬¿Õ¸ñµÄÇé¿ö£¬ÓÃ40À´±íʾ¿Õ¸ñ¡£

fs_type - ¶¨ÒåÁ˸ÃÉ豸ÉϵÄÎļþϵͳ£¬Ò»°ã³£¼ûµÄÎļþÀàÐÍΪext2 (LinuxÉ豸µÄ³£ÓÃÎļþÀàÐÍ)¡¢vfat(WindowsϵͳµÄfat32¸ñʽ)¡¢NTFS¡¢iso9600µÈ¡£

codepage¹ú¼ÒÓïÑÔ´úÂëÒ³

iocharset×Ö·û¼¯

fs_options - Ö¸¶¨¼ÓÔظÃÉ豸µÄÎļþϵͳÊÇÐèҪʹÓõÄÌض¨²ÎÊýÑ¡Ï¶à¸ö²ÎÊýÊÇÓɶººÅ·Ö¸ô¿ªÀ´¡£¶ÔÓÚ´ó¶àÊýϵͳʹÓÃ""defaults""¾Í¿ÉÒÔÂú×ãÐèÒª¡£ÆäËû³£¼ûµÄÑ¡Ïî°üÀ¨£º
Ñ¡Ïî º¬Òå
ro ÒÔÖ»¶Áģʽ¼ÓÔظÃÎļþϵͳ
sync ²»¶Ô¸ÃÉ豸µÄд²Ù×÷½øÐлº³å´¦Àí£¬Õâ¿ÉÒÔ·ÀÖ¹ÔÚ·ÇÕý³£¹Ø»úʱÇé¿öÏÂÆÆ»µÎļþϵͳ£¬µ«ÊÇÈ´½µµÍÁ˼ÆËã»úËÙ¶È
user ÔÊÐíÆÕͨÓû§¼ÓÔظÃÎļþϵͳ
quota Ç¿ÖÆÔÚ¸ÃÎļþϵͳÉϽøÐдÅÅ̶¨¶îÏÞÖÆ
noauto ²»ÔÙʹÓÃmount £­aÃüÁÀýÈçϵͳÆô¶¯Ê±£©¼ÓÔظÃÎļþϵͳ

fs_dump - ¸ÃÑ¡Ïî±»""dump""ÃüÁîʹÓÃÀ´¼ì²éÒ»¸öÎļþϵͳӦ¸ÃÒÔ¶à¿ìƵÂʽøÐÐת´¢£¬Èô²»ÐèҪת´¢¾ÍÉèÖøÃ×Ö¶ÎΪ0

fs_pass - ¸Ã×ֶα»fsckÃüÁîÓÃÀ´¾ö¶¨ÔÚÆô¶¯Ê±ÐèÒª±»É¨ÃèµÄÎļþϵͳµÄ˳Ðò£¬¸ùÎļþϵͳ""/""¶ÔÓ¦¸Ã×ֶεÄÖµÓ¦¸ÃΪ1£¬ÆäËûÎļþϵͳӦ¸ÃΪ2¡£Èô¸ÃÎļþϵͳÎÞÐèÔÚÆô¶¯Ê±É¨ÃèÔòÉèÖøÃ×Ö¶ÎΪ0


3. ʾÀýÎļþ
# /etc/fstab
/dev/hda8 swap swap defaults 0 0
/dev/hda9 / ext2 defaults 1 1
/dev/hda6 /wine vfat defaults,codepage=936,iocharset=cp936 0 0
/dev/hda7 /winf vfat defaults,codepage=936,iocharset=cp936 0 0
/dev/hdb /cdrom iso9660 noauto,user 0 0
none /proc proc defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0