2019-01-16 14:18:06 1312瀏覽
今天扣丁學(xué)堂Linux培訓(xùn)老師給大家介紹一下關(guān)于linux無損擴(kuò)容的方法詳解,首先云平臺(tái)客戶的服務(wù)器可能會(huì)隨著業(yè)務(wù)量的不斷增長造成磁盤空間不足的情況,比如:共享文件服務(wù)器硬盤空間不足,在這個(gè)時(shí)候就需要增加磁盤空間,來滿足線上的業(yè)務(wù);又或者我們?cè)谑褂胠inux的過程中,有時(shí)會(huì)因?yàn)榘惭b系統(tǒng)時(shí)分區(qū)不當(dāng)導(dǎo)致有的分區(qū)空間不足,而有的分區(qū)空間過剩的情況,都可以是使用fdisk分區(qū)工具來動(dòng)態(tài)調(diào)整分區(qū)的大小;root@i-abnawjwo:/# df Filesystem 1K-blocks Used Available Use% Mounted on udev 497752 4 497748 1% /dev tmpfs 101700 440 101260 1% /run /dev/sda1 20509308 1337636 18106816 7% / none 4 0 4 0% /sys/fs/cgroup none 5120 0 5120 0% /run/lock none 508488 0 508488 0% /run/shm none 102400 0 102400 0% /run/user /dev/sdc1 10190136 23032 9626432 1% /data root@i-abnawjwo:/data# cat hello test1
fuser -m -v /data fuser -m -v -i -k /data lsof /data
root@i-abnawjwo:/# umount /data root@i-abnawjwo:/# fdisk /dev/sdc Command (m for help): d Selected partition 1 Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): Using default response p Partition number (1-4, default 1): Using default value 1 First sector (2048-104857599, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599): Using default value 104857599 Command (m for help): p Disk /dev/sdc: 53.7 GB, 53687091200 bytes 64 heads, 32 sectors/track, 51200 cylinders, total 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 identifier: 0x305cddae Device Boot Start End Blocks Id System /dev/sdc1 2048 104857599 52427776 83 Linux Command (m for help): wq The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
root@i-abnawjwo:~# e2fsck -f /dev/sdb1 e2fsck 1.42.9 (4-Feb-2014) 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/sdb1: 12/655360 files (0.0% non-contiguous), 79664/2621440 blocks root@i-abnawjwo:~# resize2fs -p /dev/sdb1 resize2fs 1.42.9 (4-Feb-2014) Resizing the filesystem on /dev/sdb1 to 13106944 (4k) blocks. The filesystem on /dev/sdb1 is now 13106944 blocks long.
root@i-abnawjwo:~# mount /dev/sdb1 /data/ root@i-abnawjwo:/data# cat hello acasdcacsa root@i-abnawjwo:/data# df Filesystem 1K-blocks Used Available Use% Mounted on udev 497752 4 497748 1% /dev tmpfs 101700 428 101272 1% /run /dev/sda1 20509308 1337768 18106684 7% / none 4 0 4 0% /sys/fs/cgroup none 5120 0 5120 0% /run/lock none 508488 0 508488 0% /run/shm none 102400 0 102400 0% /run/user /dev/sdb1 51474044 33100 48803172 1% /data
【關(guān)注微信公眾號(hào)獲取更多學(xué)習(xí)資料】
查看更多關(guān)于“Linux培訓(xùn)資訊”的相關(guān)文章>>