Fdisk

From CLONWiki
Jump to navigation Jump to search

How to add new disk to Linux machine

As root:

fdisk /dev/sdb

Press 'n', then 'p' and follow instructions. In the end, press 'w'.

To format ('-m 0' will prevent reserving space for superuser usage, do not need it for /data or similar partitions, needed for / partition only):

mkfs.ext4 -m 0 /dev/sdb1

Add new entry to /etc/fstab:

/dev/sdb1 /data	ext4	defaults     0   0

Mount new partition:

mount -a