How to Mount a Newly Added Hard Drive in LINUX System

This article takes the addition of an 8GB hard drive as an example: (This article is merely a record and communication of daily work)The mounting steps are as follows:1. Check if the hard drive has been recognized by the system# lsblkHow to Mount a Newly Added Hard Drive in LINUX System2. Create a partition on the newly added hard drive# sudo fdisk /dev/sdb (Note: sdb should be based on the specific name recognized for the hard drive; my new hard drive is recognized as sdb as shown in the image above)How to Mount a Newly Added Hard Drive in LINUX System3. Format the newly created partition# mkfs.ext4 /dev/sdb1 (Note: Since I only created one partition, the partition name is sdb1. Additionally, the commonly used file system is ext4. It can also be formatted to other file systems as needed)How to Mount a Newly Added Hard Drive in LINUX System4. Check if the partition has been formatted successfully# lsblk -fHow to Mount a Newly Added Hard Drive in LINUX System5. Mount the newly created partition to the desired location# mount /dev/sdb1 /tmp (Since my /tmp location has insufficient space, I mounted it there)How to Mount a Newly Added Hard Drive in LINUX System6. Set up automatic mounting at startup# Vim /etc/fstabHow to Mount a Newly Added Hard Drive in LINUX SystemAdd the disk partition information for automatic mounting, with UUID being the partition ID recognized in step fourAfter modification, save and exit. Restart to apply changes. If this was helpful to you, please consider following and supportingHow to Mount a Newly Added Hard Drive in LINUX System

Leave a Comment