Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
38
rated 0 times [  38] [ 0]  / answers: 1 / hits: 180513  / 3 Years ago, mon, august 23, 2021, 5:01:15

I unmounted a disk (/dev/vdc1) on my server machine (it doesn't have a graphical environment) and then formatted it as an xfs file system. I forgot to mount it again and also didn't add the respective line to my fstab file.


Now, after rebooting the server, I want to mount this partition, but I can't access it. I get this error:


mount: can't find dev/vdc1 in /etc/fstab or /etc/mtab

So how should I edit my fstab file so that the system recognizes the partition again? The partition was mounted on /Data.


More From » disk

 Answers
3

So here we create an fstab entry for the partition.



  1. You need to create the folder for the partition and get the device id. Open a terminal. The folder can be created via:


    sudo mkdir /media/Data

    In addition, I would make the user the owner and give him the right to read/write:


    sudo chown [user]:[group] /media/Data
    sudo chmod +rw /media/Data


  2. Now the fstab entry.



    • Install libblkid1 to see device specific information:


      sudo apt-get install libblkid1


    • Enter sudo blkid and look for the stick. The output could be:


      /dev/sda2: UUID="32a4b76f-246e-486e-8495-31b8a781fb4c" TYPE="swap" 
      /dev/sda1: UUID="31f39d50-16fa-4248-b396-0cba7cd6eff2" TYPE="ext4"


    • Then we create the fstab entry:


      sudo nano /etc/fstab

      and append the line:


      UUID=31f39d50-16fa-4248-b396-0cba7cd6eff2     /media/Data   auto    rw,user,auto    0    0

      (and afterwards give a empty new line to avoid warnings).






To mount the partition, open a terminal and run:


mount /media/Data

Because of the entry auto it should be mounted automatically on next boot.


Before the next boot, don't forget to verify the entries! On any error in the fstab file, the system will not start and you will need to recover it, by reverting the changes. You can verify the entries with:


sudo findmnt --verify

[#30898] Tuesday, August 24, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ciousuntru

Total Points: 352
Total Questions: 124
Total Answers: 95

Location: Grenada
Member since Tue, Oct 12, 2021
3 Years ago
;