CentOS 6.3 automatically mounts disks and folders upon startup
CentOS 6.3 automatically mounts disks and folders upon startup
The CentOS server may have multiple disks but suddenly loses power. The previously manually attached disk is no longer in use. Therefore, the system needs to automatically mount the required disks and folders at startup.
Edit/ect/fstab to view all current mount points and append the information to be mounted. The information represented by each column is as follows:
[Plain] view plaincopy
- Devicenamemountpointfs-typeoptionsdump-freqpass-num
-Device name: device name, for example,/dev/sda1.
-Mount point: a mount point, which is a folder on the system.
-Fs-type: the type of the device to be mounted, for example, ext4. Man fstab can be used to check the supported types.
-Options: The parameter used for mounting, usually ults.
-Dump-freq and pass-num are generally set to 0, and the device to be mounted is not checked at startup.
In the following example, Mount/dev/sdb1 to/var/ftp and/home/. isos to/var/ftp/pub/software/isos respectively.
[Plain] view plaincopy
- [Root @ localhost ~] # Cat/etc/fstab
- #
- #/Etc/fstab
- # CreatedbyanacondaonThuNov1504: 13: 162012
- #
- # Accessiblefilesystems, byreference, aremaintainedunder '/dev/disk'
- # Seemanpagesfstab (5), findfs (8), mount (8) and/orblkid (8) formoreinfo
- #
- /Dev/mapper/vg_livecd-lv_root/ext4defaults11
- UUID = 9e293568-2685-421a-ae3f-f4a058e3f9e1/bootext4defaults12
- // Dev/mapper/vg_livecd-lv_home/homeext4defaults12
- /Dev/mapper/vg_livecd-lv_swapswapswapdefaults00
- Tmpfs/dev/shmtmpfsdefaults00
- Devpts/dev/ptsdevptsgid = 5, mode = 62000
- Sysfs/syssysfsdefaults00
- Proc/procprocdefaults00
- /Dev/sdb1/var/ftpext4defaults00
- /Home/. isos/var/ftp/pub/software/isosnonerw, bind00
- [Root @ localhost ~] #
References:
1. http://en.wikipedia.org/wiki/Fstab
2. http://stackoverflow.com/questions/145209/mounting-ntfs-filesystem-on-centos-5-2
3. http://www.linuxforums.org/forum/servers/28252-fstab-mount.html