2018-12-18 16:40:07来源: 阅读 ()

[root@localhost ~]# umount /dev/sdb1
1:fuser -m -v /data
2:fuser -m -v -i -k /data
[root@localhost ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p  (查看分区表信息)
Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x7efdf11b
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   104857599    52427776   83  Linux
Command (m for help): d  (删除分区,因为我默认只有一个,所以默认删除第一个,如果有多个,可以指定1,2,3..)
Selected partition 1   Partition 1 is deleted
Command (m for help): n  (重新新建分区)
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1 (和之前的分区好一致
First sector (2048-104857599, default 2048): 2048 (需要和之前的分区的起始磁盘柱号一致,特别重要!!!)
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599):
Using default value 104857599
Partition 1 of type Linux and of size 50 GiB is set
Command (m for help): wq (保存退出,如果操作有无可以直接退出不保存)
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
然后检查分区信息:[root@localhost ~]# e2fsck -f /dev/sdb1
调整分区大小:[root@linuxprobe ~]# resize2fs -p /dev/sdb1
[root@localhost ~]# mount /dev/sdb1 /data
[root@localhost ~]# df -hal 

标签:centos 扩容


下一篇:Ubuntu 16.04.2基于APT源安装Nginx