parted
parted
- see also: btrfs
Assistant: Parted is a Linux utility used for partitioning hard drives. It allows users to create, delete, resize, and move partitions on their hard drives.
format / partition new drive
parted -s /dev/nvme1n1 mklabel gpt
parted -s /dev/nvme1n1 mkpart primary 4MiB 100% # use any name instead of *primary*
mkfs.btrfs -L data /dev/nvme1n1p1 # use any name for the label (-L)resize partition to 100%
for all the commands, replace sda, sda1 with your actual disk and partition
if you just resized the disk, you might need to rescan the device:
echo 1 > /sys/block/sda/device/rescandisplay available space on /dev/sda:
parted -s -a opt /dev/sda "print free"resize disk:
it uses the /dev/sda disk, partition 1 and just resizes the partition to the maximum amount available
parted /dev/sda resizepart 1 100%
resize2fs /dev/sda1