Add storage and format disk in Debian

sudo fdisk -l
# take note of the added disk
sudo fdisk /dev/sdX
# where X is the value for the disk

# in fdisk:
n (ew)
p (rimary)
1
(first and last sector defaults)
w (rite)

sudo fdisk -l
# take note of disk partition, eg: sdX1
sudo mkfs -t ext4 /dev/sdX1

sudo mkdir /mnt/newdisk
lsblk -d -fs /dev/sdX1
# take note of UUID value
# edit /etc/fstab to add the following
UUID=$UUIDValueFromAbove /mnt/newdisk ext4 defaults 0 2

sudo mount -a
# or reboot to test

References:

https://linuxconfig.org/how-fstab-works-introduction-to-the-etc-fstab-file-on-linux

https://linuxconfig.org/how-to-add-new-disk-to-existing-linux-system

Leave a Reply

Your email address will not be published. Required fields are marked *