解決centos下磁碟無法掛載超過2T大小磁碟解決方案
磁碟分割格式MBR限制了單塊磁碟大小為2TB,如果想掛載超過2TB的磁碟,就要換成其他格式如GPT格式。
因為協助客戶使用OnApp搭建雲平台,儲存先用6TB在測試,所以需要通過其他格式來掛載這6TB的磁碟。分享下Linux上(我用的CentOS5.9 x86_64)掛載使用6TB的Dell MD3600f硬體儲存的方法:
[root@demo ~]# parted /dev/sdb #使用parted來對GPT磁碟操作,進入互動式模式
GNU Parted 1.8.1
Using /dev/sdb
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) mklabel gpt # 將MBR磁碟格式化為GPT
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
parted: invalid token: gpt
Yes/No? yes
New disk label type? [gpt]? 按下Enter鍵
(parted) print
Model: DELL MD36xxf (scsi)
Disk /dev/sdb: 6000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
(parted) mkpart primary 0 -1 #將整個磁碟空間全部分為一個區
(parted) print
Model: DELL MD36xxf (scsi)
Disk /dev/sdb: 6000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 6000GB 6000GB primary
(parted) quit
Information: Don’t forget to update /etc/fstab, if necessary
硬體儲存已經映射到Hypervisor伺服器上了,所以不用再編輯/etc/fstab了。到這裡就完成了CentOS 上掛載6TB磁碟。