夜月琉璃Lv46
iStoreOS 分区扩容
原文命令部分转自:iStoreOS x86根分区扩容 - 知乎 (zhihu.com)
扩容前提:需要给当前磁盘新增足够空间
# 执行parted root@iStoreOS:~# parted # 执行print命令,查看当前分区情况 (parted) print Model: VMware Virtual disk (scsi) Disk /dev/sda: 53.7GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 262kB 134MB 134MB primary ext2 boot 2 135MB 403MB 268MB primary 3 403MB 2551MB 2147MB primary ext4 4 2551MB 17.2GB 14.6GB primary ext4 # 这里对分区3进行扩容,完成后退出 (parted) resizepart Partition number? 3 Warning: Partition /dev/sda3 is being used. Are you sure you want to continue? Yes/No? yes End? [2551MB]? 53.7G(这里的值根据实际情况进行设定) (parted) quit Information: You may need to update /etc/fstab. # 执行resize2fs对文件系统进行扩容 root@iStoreOS:~# resize2fs -p /dev/sda3 resize2fs 1.46.5 (30-Dec-2021) Filesystem at /dev/sda3 is mounted on /overlay; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 7 The filesystem on /dev/sda3 is now 13008704 (4k) blocks long. # 执行df -h可以看到分区大小已经更新 root@iStoreOS:~# df -h Filesystem Size Used Available Use% Mounted on /dev/sda3 48.8G 1.8G 46.9G 4% /overlay/upper/opt/docker
0 已被阅读了4545次 楼主 2024-02-20 12:18:39