1/13/2024 0 Comments Linux disk mapYou can also change a partition flag in parted. To reduce the file system size, the following commands are used. If you shrinking the partition size, you have to reduce the file system size first, and then reduce your partition. Run the following command in parted:įirst, extend the partition, and then expand the file system on it. You can resize a partition interactively. To extend or shrink a partition size, the resizepart subcommand is used in parted. How to Resize (Extend or Shrink) Partition with Parted? Thus, you can make your work easier or add similar commands to bash scripts or kickstart files. Using the command, we will create a partition on vdb disk and allocate all free space to it. # parted -a opt /dev/vdb mkpart primary ext4 0% 100% & mkfs.ext4 /dev/vda1 You can create a partition and format it without going into the parted shell. # mkfs.ext4 /dev/vdb1 mke2fs 1.44.6 () Creating filesystem with 1220352 4k blocks and 305216 inodes Filesystem UUID: 5c9daa97-c0f4-44bc-9cfa-f466ebd8895e Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736 Allocating group tables: done Writing inode tables: done Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: doneĬheck the file system of the partition and make sure it has changed (note that the print command displays the list of partitions on the disk, their numbers, type, size and file system). Let’s format the partition to ext4 file system: # (parted) mkpart "home part" ext4 2.5GiB 100% You can also set the partition size in % and assign a label: Or specify any partition size as follows: You can create a partition that spans the whole disk: To display the amount of free space left on a disk, use the following command: In our example, we have entered 5,000, it means that a 5 GB partition will be created. End this is the last sector of the partition (in megabytes).ext2 is offered by default (we will change it later) Partition type - specify a partition type (primary or extended).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |