How to Mount a New Linux Disk: Step‑by‑Step Guide
This guide walks you through checking a new Linux disk, creating a partition with fdisk, formatting it, mounting it temporarily, configuring /etc/fstab for automatic mounting, and verifying the setup after a reboot.
Linux Disk Mounting
1. Check Disk Partition Status
Run fdisk -l or lsblk to list disks. In the example, /dev/sdb has no partitions.
2. Add a Partition to the New Disk
Execute fdisk /dev/sdb and follow the interactive prompts to create a partition.
3. Format the Partition
Format the newly created partition with XFS using mkfs.xfs /dev/sdb1.
4. Verify Filesystem Types
Run blkid to list all filesystem types and confirm the new partition.
5. Mount the Partition to a Directory
Mount it temporarily with mount /dev/sdb1 /ynat/. This mount will disappear after a reboot.
Note: This is a temporary mount; it will be lost after a reboot.
7. Configure Automatic Mount on Boot
First, obtain the partition UUID with blkid and copy it. Then edit /etc/fstab (using vi or another editor) to add a line that references the UUID, ensuring fields are separated by spaces.
8. Reboot to Apply Changes
Reboot the system (e.g., reboot) and verify the mount persists with df -h. If the mount is missing, revisit step 6 to correct the /etc/fstab entry.
Source: https://www.cnblogs.com/nicoKie/p/18034736
(Copyright belongs to the original author; removed if infringed)
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
