最近風(fēng)信建站服務(wù)的客戶所使用的獨(dú)立Linux服務(wù)器系統(tǒng),因?yàn)榭蛻羝脚_(tái)數(shù)據(jù)太多,導(dǎo)致數(shù)據(jù)盤滿了,為了保證數(shù)據(jù)的安全及增加數(shù)據(jù)盤的空間容量,風(fēng)信建站對(duì)客戶的服務(wù)器進(jìn)行了數(shù)據(jù)盤擴(kuò)容升級(jí),保證了客戶的數(shù)據(jù)安全。
先把掛載分區(qū)進(jìn)行卸載
[root@instance-549sbowh /]# umount /www
umount: /www: target is busy.
(In some cases useful info about processes that usethe device is found by lsof(8) or fuser(1))
顯示無法卸載成功。
方法1、查看是否有進(jìn)程占用
[root@instance-549sbowh /]# lsof | grep /www
如果發(fā)現(xiàn)有被占用的進(jìn)程,我們可以使用kill命令,直接殺掉進(jìn)程。
方法2:編輯vi /etc/fstab文件
[root@instance-549sbowh ~]# vi /etc/fstab
直接注銷掛載點(diǎn),重新啟動(dòng)服務(wù)器。
查看磁盤信息,已經(jīng)卸載成功。
[root@instance-549sbowh ~]# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G 7.3G 31G 20% /
devtmpfs 980M 0 980M 0% /dev
tmpfs 991M 0 991M 0% /dev/shm
tmpfs 991M 9.1M 982M 1% /run
tmpfs 991M 0 991M 0% /sys/fs/cgroup
tmpfs 199M 0 199M 0% /run/user/0
使用parted -l查看磁盤情況:
[root@instance-549sbowh ~]# parted -l
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 42.9GB 42.9GB primary ext4 boot
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0.00B 53.7GB 53.7GB ext4
[root@instance-549sbowh ~]# cat /proc/partitions
major minor #blocks name
253 0 41943040 vda
253 1 41941999 vda1
253 16 52428800 vdb
檢查文件系統(tǒng)
[root@instance-549sbowh ~]# e2fsck -f /dev/vdb
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vdb: 31325/327680 files (0.2% non-contiguous), 713819/1310720 blocks
變更文件系統(tǒng)大小
[root@instance-549sbowh ~]# resize2fs /dev/vdb
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/vdb to 13107200 (4k) blocks.
The filesystem on /dev/vdb is now 13107200 blocks long.
重新掛載分區(qū)
[root@instance-549sbowh ~]# mount /dev/vdb /www
數(shù)據(jù)盤擴(kuò)容成功
[root@instance-549sbowh ~]# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G 7.3G 31G 20% /
devtmpfs 980M 0 980M 0% /dev
tmpfs 991M 0 991M 0% /dev/shm
tmpfs 991M 9.1M 982M 1% /run
tmpfs 991M 0 991M 0% /sys/fs/cgroup
tmpfs 199M 0 199M 0% /run/user/0
/dev/vdb 50G 12.6G 35G 6% /www