Published on Sake.in.th (https://sake.in.th)

หน้าแรก > หน้าหลัก > ปรับแต่ง fstab ให้เหมาะสม

ปรับแต่ง fstab ให้เหมาะสม [1]

เขียนโดย sake [2] เมื่อ 2007-10-10 17:15

จากการ boot เครื่องพบว่า ส่วนนึงที่ช้า มาจากการที่ fsck ทำการ scan file system
ทุกครั้ง โดยเฉพาะที่เป็น vfat จะช้ามาก ๆ จึงต้องทำการแก้ fstab ไม่ให้ scan ทุกครั้ง

ใน Linux เมือทำการ boot ระบบขึ้น ไฟล์แรก ๆ ที่มีความสำคัญคือ /etc/fstab
ที่จะถูกอ่าน เพื่อทำการ mount หรือสร้างโครงสร้างของระบบไฟล์

ไฟล์ fstab จะประกอบด้วยส่วนต่าง ๆ ที่เกี่ยวกับข้อมูลโครงสร้าง อุปกรณ์ต่าง ๆ ของระบบ

ตัวอย่างไฟล์

# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda3 / ext3 defaults,errors=remount-ro 0 1
/dev/hda1 /media/hda1 vfat defaults,utf8,umask=007,gid=46 0 1
/dev/hda2 none swap sw 0 0

จะพบว่า ถูกแบ่งออกเป็น 6 คอลัมน์ คือ

คอลัมน์ที่ 1 เป็น device หรือ บล็อกของอุปกรณ์
คอลัมน์ที่ 2 เป็น mount point หรือจุดที่ทำการเชื่อมต่ออุปกรณ์เข้าสู่โครงสร้างระบบไฟล์
คอลัมน์ที่ 3 เป็นชนิดของ file system เช่น ext2 ext3 vfat swap
คอลัมน์ที่ 4 เป็น option ของการ mount เช่น auto defaults
คอลัมน์ที่ 5 เป็น dump option ซึ่งเป็น utility ในการ backup ข้อมูล
คอลัมน์ที่ 6 เป็น fsck option เป็น utility ในการตรวจสอบระบบไฟล์

ข้อมูลเพิ่มเติม : http://www.tuxfiles.org/linuxhelp/fstab.html [3]

ถ้าไม่ต้องการให้ scan ก็เพียงแต่เปลี่ยน fsck option ให้เป็น 0 เท่านี้ก็เรียบร้อย.

Tags: 
linux [4]

Source URL (modified on 2008-02-16 05:38): https://sake.in.th/node/44

Links
[1] https://sake.in.th/blog/%E0%B8%9B%E0%B8%A3%E0%B8%B1%E0%B8%9A%E0%B9%81%E0%B8%95%E0%B9%88%E0%B8%87-fstab-%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B9%80%E0%B8%AB%E0%B8%A1%E0%B8%B2%E0%B8%B0%E0%B8%AA%E0%B8%A1
[2] https://sake.in.th/users/sake
[3] http://www.tuxfiles.org/linuxhelp/fstab.html
[4] https://sake.in.th/tags/sitetags/linux