2016年12月

都说硬盘单块大于2T就不能用fidisk了,这次入了一台双6T硬盘的服务器, IDC已经完成了GPT转换.
把sdb硬格式并挂载了,然后sda除了系统之外,留下一大部分没动.
现就把sda剩下的分区搞起来. 
expr fdisk -s /dev/sda / 1024

查看硬盘空间 ,发现有两个分区了,分区到第265M,建立第三个分区从265到全部.

parted /dev/sda mkpart primary ext4 265 5723166

又新加一块硬盘会报
parted /dev/sdb mkpart primary ext4 265 5723166
Too many primary partitions
处理
[root@localhost ~]# expr fdisk -s /dev/sda / 1024
3815447

parted /dev/sdb mkpart ext4 1 3815447
提示:You may need to update /etc/fstab 忽略
mkfs.ext4 /dev/sdb
/dev/sdb is entire device, not just one partition!
无论如何也要继续? (y,n) y
文件系统标签=
操作系统:Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
244195328 inodes, 976754646 blocks
48837732 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=4294967296
29809 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
102400000, 214990848, 512000000, 550731776, 644972544

正在写入inode表: 1206/29809

完成后
挂上
mount /dev/sdb /disk3
设置开机自动挂OK后就完成。

vim /etc/fstab

/dev/sdb /disk3 ext4 defaults 1 2


以虚线以上
mkfs.ext4 /dev/sda3

Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.

格式化失败

发现sda2也是没格的,先格sda2.

成功,再格sda3,失败.

Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
重启

partprobe

mkfs.ext4 /dev/sda3 再格

完成.

df -h 分区成功
 
parted /dev/sda print 查看分区情况

mount /dev/sda3 /data 挂载

开机自动挂载

vim /etc/fstab

/dev/sda3 /data ext4 defaults 1 2