本日利用之前的硬盘挂载文章(468.【数据库】阿里云服务器挂载硬盘)挂载公司服务器上 4T 的硬盘,结果,挂载完我一看,就发现:4T 的硬盘,挂载上之后,只体现 2T。
网上查了下,发现 fdisk 建不了大于 2T 的分区。本日记载下利用 parted 工具来创建大于 2T 的分区。
一、创建分区
[root@k8s0 shell_sync_scripts]# parted /dev/sdb GNU Parted 3.1Using /dev/sdbWelcome to GNU Parted! Type 'help' to view a list of commands.(parted) mklabel 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?Yes/No? yes (parted) mkpart primary xfs 0% 100%(parted) print Model: LSI MR9240-8i (scsi)Disk /dev/sdb: 4000GBSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags: Number Start End Size File system Name Flags 1 1049kB 4000GB 4000GB ext4 primary(parted) quit Information: You may need to update /etc/fstab.二、创建文件体系
[root@k8s0 shell_sync_scripts]# mkfs.xfs /dev/sdb1meta-data=/dev/sdb1 isize=512 agcount=4, agsize=244154240 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0, sparse=0data = bsize=4096 blocks=976616960, imaxpct=5 = sunit=0 swidth=0 blksnaming =version 2 bsize=4096 ascii-ci=0 ftype=1log =internal log bsize=4096 blocks=476863, version=2 = sectsz=512 sunit=0 blks, lazy-count=1realtime =none extsz=4096 blocks=0, rtextents=0三、挂载目录
mount /dev/sdb1 /var/lib/containerd四、设置开机主动挂载
echo $( blkid /dev/sdb1 | awk '{print $2}' | sed 's/\"//g' ) /var/lib/containerd xfs defaults 0 0 >> /etc/fstab 五、验证
可以看到,这会体现有3.7T了,大于2T的分区创建完成,而且乐成挂载。
相干阅读:
468.【数据库】阿里云服务器挂载硬盘
316.【Linux】给服务器新增一块硬盘(挂载硬盘) |