[anaconda root@localhost /]# parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 5369MB 5368MB primary ext4 boot
删除旧分区:
(parted) rm 1
(parted) p
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
从原分区的 起始位置 开始新建 主分区 至 最大可用空间 :
(parted) mkpart primary 1049kB 100%
(parted) p
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 8590MB 8589MB primary lba
重新创建分区后,之前的 分区标记Flags 丢失,重新设置 boot 不然无法启动:
(parted) set 1 boot on
(parted) p
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 8590MB 8589MB primary boot, lba
(parted) set 1 lba off
(parted) p
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 8590MB 8589MB primary boot
(parted) q
Information: You may need to update /etc/fstab.
[anaconda root@localhost /]# e2fsck -fv /dev/sda1
e2fsck 1.44.3 (10-July-2018)
Superblock last write time is in the future.
(by less than a day, probably due to the hardware clock being incorrectly set)
Pass 1: Checking inodes, blocks, and sizes
Inode 138584 extent tree (at level 1) could be shorter. Fix<y>? yes
Inode 282934 extent tree (at level 1) could be shorter. Fix<y>? yes
Pass 1E: Optimizing extent trees
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
fedora-root: ***** FILE SYSTEM WAS MODIFIED *****
141558 inodes used (43.20%, out of 327680)
2435 non-contiguous files (1.7%)
149 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 127429/623/1
1106492 blocks used (84.44%, out of 1310464)
0 bad blocks
1 large file
111258 regular files
15944 directories
0 character device files
0 block device files
0 fifos
11243 links
14347 symbolic links (13497 fast symbolic links)
0 sockets
------------
152792 files
[anaconda root@localhost /]# resize2fs /dev/sda1
resize2fs 1.44.3 (10-July-2018)
Resizing the filesystem on /dev/sda1 to 2096896 (4k) blocks.
The filesystem on /dev/sda1 is now 2096896 (4k) blocks long.
使用 dumpe2fs 确认文件系统大小:How to find the size of a filesystem ?
评论列表