【linux命令】使用parted对超过2T大小的磁盘进行GPT分区划分
内容摘要
买了一块4T的磁盘,直接采用fdisk无法进行这么大的磁盘进行分区划分,提示如下信息:
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't sup
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't sup
文章正文
买了一块4T的磁盘,直接采用fdisk无法进行这么大的磁盘进行分区划分,提示如下信息:
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted. Disk /dev/sda: 4000.8 GB, 4000787030016 bytes 255 heads, 63 sectors/track, 486401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000
按照网上的教程搜索了下,成功划分,这里记录下操作步骤:
parted /dev/sda (parted) mklabel gpt (parted) unit TB (parted) mkpart primary 0.00TB 4.00TB (parted) print
执行如上几个命令,成功创建,可以查看具体磁盘分区信息了,使用命令quit退出parted。下边的就比较简单了,可以直接mkfs进行格式化和挂载:
mkfs.ext4 /dev/sda1 mount /dev/sda1 /data
如果要将其随系统启动挂载,别忘记修改/etc/fstab表。
[[email protected] /]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sdb2 234G 1.2G 221G 1% / tmpfs 16G 0 16G 0% /dev/shm /dev/sdb1 190M 27M 154M 15% /boot /dev/sdc1 1.8T 1.7T 57G 97% /kvm /dev/sda1 3.6T 0 3.6T 51% /data
代码注释
[!--zhushi--]