I added much of this information to the Ubuntu wiki.
Ubuntu Wiki : fstab
There are essentially 5 sections:
- Introduction / Mount.
- "fstab syntax" - Syntax and fstab options.
- How to label, FAT and Linux file systems.
- Examples, FAT and Linux native file systems.
- References
Scroll down to the section you need.
Introduction
/etc/fstab is a system configuration file and is used to tell the Linux kernel which partitions (file systems) to mount and where on the file system tree.
/etc/mtab is an index of all mounted partitions/file systems.
Note: See references section at the end of this how to for useful links.
How to mount
The mount command and fstab go hand in hand:
- Options for mount and fstab are similar.
- If a device/partition is not listed in fstab ONLY ROOT may mount the device/partition.
- Users can mount a removable device using pmount.
- Users may mount a device/partition if the device is in fstab with the proper options.
How to mount
Mount Partitions Automatically (At BOOT).
Filesystems and Mounting
mount has a multitude of options. Manpage: man mount
pmount: Pmount allows a user to mount removable media.
pmount uses /media/
Syntax:
Quote:
pmount |
Code:
pmount /dev/dsa1 data
To unmount:
Code:
pumount
- For example, if you have a directory /media/usb ; pmount /dev/sda1 usb may fail.
- If you are having problems with gnome-volume-manager or pmount check the contents of /media and delete directories as needed.
- Obviously do not delete a directory in /media if a device is mounted to this mount point.
Configure pmount for internal drives
To show your partitions/usb devices, first plug in your usb card.
To list your mounted partitions:
Code:
mount
Code:
sudo fdisk -l
First connect all your devices, then:
Code:
ls /dev/disk/by-uuid -alh
fstab Syntax
Quote:
[Device] [Mount Point] [File_system] [Options] [dump] [fsck order] |
/dev/hdxy or /dev/sdxy.
x will be a letter starting with a, then b,c,....
y will be a number starting with 1, then 2,3,....
Thus hda1 = First partition on the master HD.
See Basic partitioning for more informationNote: zip discs are always numbered "4".
Example: USB Zip = /dev/sda4.
Note: You can also identify a device by udev, volume label (AKA LABEL), or uuid.
These fstab techniques are helpful for removable media because the device (/dev/sdxy) may change. For example, sometimes the USB device will be assigned /dev/sda1, other times /dev/sdb1. This depends on what order you connect USB devices, and where (which USB slot) you use to connect. This can be a major aggravation as you must identify the device before you can mount it. fstab does not work well if the device name keeps changing.
To list your devices, first put connect your USB device (it does not need to be mounted).
By volume label:
Code:
ls /dev/disk/by-label -lah
Code:
ls /dev/disk/by-id -lah
Code:
ls /dev/disk/by-uuid -lah
The format to use instead of the device name in the fstab file is:
LABEL=
0 comentarios:
Publicar un comentario