Linux file system hard disk partition (mount) tutorial

Pankaj kushwaha
1 min readJun 20, 2020

--

After remote SSH login to the Centos server, perform the following operations
Reminder: The mount operation will clear the data, please confirm that the mounted disk has no data or is not used

Step 1: List all disk commands: ll /dev/disk/by-path

Tip: If you cannot confirm the name of the data disk device, use the df command to confirm the name of the system disk to rule out the wrong disk.

Step 2: Format hard disk command: fdisk /dev/sdb

Note: Continue typing manually at the arrow mark

Step 3: Create partition command: mkfs.ext4 /dev/sdb1

Step 4: Mount partition command: mkdir /home
mount /dev/sdb1 /home # Mount the sdb hard disk as /home

Step 5: Write the information to fstab to enable the system to automatically mount.
Command: echo “/dev/sdb1 /home ext4 defaults 0 0” >> /etc/fstab

--

--

Pankaj kushwaha
Pankaj kushwaha

Written by Pankaj kushwaha

Database/System Administrator | DevOPS | Cloud Specialist | DevOPS

No responses yet