# df
# cat /etc/fstab
# mount -a
# umount -a
sudo fdisk -l
Find the newly added hard disk,
To create the partition on the second Hard drive,
sudo fdisk /dev/sdx
u
n
p
w
Now we need to format our newly created partition using the following command:
sudo mkfs /dev/sdb1 -t ext4
verify
sudo fdisk -l
mount the newly created sdb1 partition into other directory
or
{
cd /mnt/ sudo mkdir 2ndHDD sudo chmod 0777 2ndHDD ls -l
sudo mount /dev/sdb1 /mnt/2ndHDD -t ext4
sudo chmod 0777 2ndHDD
touch /mnt/2ndHDD/test.txt ls /mnt/2ndHDD/*
}
mount -t ext4 -v /dev/sdb1 /opt/repository/myDir
sudo vim /etc/fstab
/dev/sdb1 /opt/repository/myDir ext4 defaults 0 1
sudo mount -a