Extfs terminal commands
Calling ioctl() to re-read partition table. Type w and hit Enter to apply the changes: Type p and hit Enter to print the partition table:ĭisk /dev/sdb: 8 GiB, 8589934592 bytes, 16777216 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 Disklabel type: dos Disk identifier: 0x3d06b4e3 Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 8390655 8388608 4G 83 Linux Filesystem/RAID signature on partition 1 will be wiped. Do you want to remove the signature? es/o: N Specify the size of the partition and hit Enter:Ĭreated a new partition 1 of type 'Linux' and size 4 GiB. Press Enter to create a primary partition: Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): Type n and hit Enter to create a new partition: Be careful before using the write command. Changes will remain in memory only until you decide to write them. In this section, we will create a partition on the/dev/sdb disk with a size of 1GB, format this partition (/dev/sdb1) with ext4 filesystem, and mount the partition on the/mnt directory, and create some directories inside /mnt directory.įirst, create a partition on disk /dev/sdb with 1GB size using the following command: dev/sdb : 8GB Disk without any partition. dev/sda : 15GB Disk with root and swap partitions. So it is recommended to backup your entire partition to prevent data loss.įor this tutorial, we are using the Linux system with the following partition scheme:
Note: Extending a filesystem is a moderately high-risk operation. The resize2fs is a command-line utility that allows you to resize ext2, ext3, or ext4 file systems. In that case, you can use the resize2fs utility to increase and decrease a filesystem size. If you are a system administrator working on the Linux system, resizing or growing the filesystem is challenging. However, when your partition size is complete, you will need to resize an existing partition.
Extfs terminal commands free#
Some partition is complete, while some partition still has sizeable free space. You will need to resize the partition when you are unsatisfied with the partition size and your system partition is running out of free space. You can either expand or shrink the partition as per your needs. Resizing or extending a partition is the process of increasing or decreasing the partition size.