Automatically mounting a file system using by-id in Red Hat

You can automatically mount a file system using by-id in Red Hat as follows:
1. Run the fdisk command to create partition sdb1. An ID is generated in the /dev/disk/by-id directory. If a file system exists, go to step 3 to modify configuration.
2. Create a file system. Run the mkfs -t ext3 /dev/sdb1 command to format sdb1 as ext3 file system.
3. Modify the /etc/fstab file and add the by-id of sdb1 to the file.
4. Restart the system. You can see that sdb1 has been automatically mounted.

Scroll to top