CentOS是社區(qū)企業(yè)操作系統(tǒng),是Linux發(fā)行版之一,它是來自于Red Hat Enterprise Linux依照開放源代碼規(guī)定釋出的源代碼所編譯而成。由于出自同樣的源代碼,因此有些要求高度穩(wěn)定性的服務(wù)器以CentOS替代商業(yè)版的Red Hat Enterprise Linux使用。兩者的不同,在于CentOS并不包含封閉源代碼軟件。
企業(yè)級應(yīng)用系統(tǒng)的建設(shè),通常將系統(tǒng)和數(shù)據(jù)分別存儲,并建立raid。新裝的CentOS6.5,需要掛載數(shù)據(jù)盤,并且能夠系統(tǒng)啟動自動掛載該數(shù)據(jù)盤。
1、手動掛載磁盤
查看磁盤分區(qū)信息,執(zhí)行fdisk命令
[root@tsp-rls-webservice tsp]# fdisk -l
Disk /dev/sdb: 1476.5 GB, 1476529225728 bytes
255 heads, 63 sectors/track, 179511 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0008a3a1
Device Boot Start End Blocks Id System
/dev/sdb1 1 179512 1441922048 83 Linux
Disk /dev/sda: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6a5b51c5
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 39163 314059776 8e Linux LVM
Disk /dev/mapper/vg_tsprlswebserv-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_tsprlswebserv-lv_swap: 16.8 GB, 16814964736 bytes
255 heads, 63 sectors/track, 2044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_tsprlswebserv-lv_home: 251.1 GB, 251092008960 bytes
255 heads, 63 sectors/track, 30526 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
查看到/dev/sdb1沒有掛載,接下來建立掛載點(diǎn)(創(chuàng)建掛載目錄),執(zhí)行mount命令,掛載數(shù)據(jù)盤。
[root@tsp-rls-webservice tsp]# mkdir /tsp
[root@tsp-rls-webservice tsp]# mount /dev/sdb1 /tsp
2、系統(tǒng)啟動,自動掛載數(shù)據(jù)盤
查看磁盤UUID信息
[root@tsp-rls-webservice tsp]# blkid
/dev/mapper/vg_tsprlswebserv-lv_root: UUID=quot;3dedb8a7-69c5-44d7-b590-e70a0b1b3c9aquot; TYPE=quot;ext4quot;
/dev/sdb1: UUID=quot;e85dd659-bb20-4d12-a8bc-16130efc04eaquot; TYPE=quot;ext4quot;
/dev/sda1: UUID=quot;97f12da1-c972-4508-9028-9b98cde34a34quot; TYPE=quot;ext4quot;
/dev/sda2: UUID=quot;cKJ1xc-8mci-0d89-DNaR-5IAG-2JOv-V1G1q9quot; TYPE=quot;LVM2_memberquot;
/dev/mapper/vg_tsprlswebserv-lv_swap: UUID=quot;aa4589df-1d47-4060-a419-9c4432c3bb9aquot; TYPE=quot;swapquot;
/dev/mapper/vg_tsprlswebserv-lv_home: UUID=quot;17a62039-4676-45ce-8eb9-1914e2d4820cquot; TYPE=quot;ext4quot;
編輯系統(tǒng)分區(qū)表
[root@tsp-rls-webservice tsp]# vi /etc/fstab
添加如下信息:
UUID=e85dd659-bb20-4d12-a8bc-16130efc04ea /tsp ext4 defaults 1 2
編輯后的信息如下:
#
# /etc/fstab
# Created by anaconda on Thu Aug 21 17:17:19 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_tsprlswebserv-lv_root / ext4 defaults 1 1
UUID=97f12da1-c972-4508-9028-9b98cde34a34 /boot ext4 defaults 1 2
UUID=e85dd659-bb20-4d12-a8bc-16130efc04ea /tsp ext4 defaults 1 2
/dev/mapper/vg_tsprlswebserv-lv_home /home ext4 defaults 1 2
/dev/mapper/vg_tsprlswebserv-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
保存退出;重啟系統(tǒng),確認(rèn)自動掛載成功。
以上就是 CentOS6.5開機(jī)自動掛載硬盤 的執(zhí)行命令,希望能滿足各位的需求。腳本之家的小編也會繼續(xù)努力尋找更好方法,請繼續(xù)關(guān)注我們,謝謝。