There was a website that I was using an external hard drive as its storage.
After installing another external drive or two, the first hard drive was being identified
with a different file directory that then things did not work correctly.

Fortunately, the Top Coder, Linus Torvalds, his great Linux operating system, and the world’s
opensource incredibly fantastic Linux, there’s a solution to this.

This will list your storage drives on your computer.

lsblk

Ok, now.

The /etc/fstab file on the Linux operating system allows us to set the UUID of a hard drive.

Run the command

sudo blkid -o list

This will list the UUID of the hard drives on the computer that Linux is running on.

Make a new entry to the fstab file, for example the following statement.

UUID=12345abc-67ef-89gh-0123-4567890avzz /media/disk1 ext4 rw,relatime 0 0

Change the UUID with it’s actual entry from the blkid command.

Check that the /media/disk1 folder is created.

This will attempt to mount the storage drives listed in the /etc/fstab file.
mount -a

This post will ensure that adding or removing any external hard drives will not change a drive that is being used,
for example, a website.

Happy Coding!

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *