Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I 've unmounted a disk /dev/vdc1 on my machine, after I format it into xfs file system, I didn't mount it again, either didn't add the adequate line to fstab file.

Now when i want to mount this partition, but I can't access to it: mount: can't find dev/vdc1 in /etc/fstab or /etc/mtab. So how should I put in fstab file so the system recognizes it again ? the partition was mounted on /Data

share|improve this question
    
Try running (or installing) GParted, this allows you to play with all your partitions. – SimplySimon Jun 3 '13 at 10:00
    
Thank you for the replay, I'm on a server, i don't have graphical environment. – Dady Jun 3 '13 at 12:21
up vote 5 down vote accepted

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 gedit /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 type

mount /media/Data
Because of the entry auto it should be mounted automatically on next boot.

share|improve this answer
    
Thank you for the detailed replay, but i think i didn't well explain my problem, i've attached a storage disk to my server mounted on /Data (configured when creation), after that, i wanted to format it to xfs, so i unmounted the disk, formated it, and then...forget to remount it again and the same thing with fstab....the server was rebooted, and now when i want to mount the disk so it can be listed with the other disks....it's impossible cause there is no entry in fstab,...i think your solution is for creating a new mounting folder and assign to it the disk. – Dady Jun 3 '13 at 12:22
    
my proble is that i didn't find the disk even with "sudo blkid", sorry for the late replay – Dady Jun 3 '13 at 12:23

First you need to find out UUID of your disk by following command

sudo blkid

Note your disk UUID.

Now open fstab file with gedit

sudo gedit /etc/fstab

Replace your old disk UUID with your noted UUID.
Save file and reboot your system. You will be able to mount disk.

share|improve this answer
    
Thank you for the replay, i tried "sudo blkid" i got only UUID for : /dev/vda1 and /dev/vda2, is like there is no /dev/vdc1 disk (on the same time, there is this partition, cause i attached a storage disk to my server mounted on /Data and worked on it, before i do the unmount), sorry for the late replay – Dady Jun 3 '13 at 12:20
    
If your problem is solved, mark as accepted answer. It will help others. – K.K Patel Jun 3 '13 at 12:53
    
Not yet, but i'm gonna do it, cause i think my problem has no relation with linux, it's the storage disk's catalogue – Dady Jun 3 '13 at 13:05
    
Can you tell us more about your hardware setup? Doesn't seem to be an standard HDD – Manuel Jun 4 '13 at 5:50

While Manuel seems to have answered the asked question quite fully, the question you seem to have meant to ask was: "After I unmounted a disk /dev/vdc1 from /Data and formatted it to XFS, I can't remount it. How do I remount it at /Data?"

You seem to be misunderstanding (reasonably) the error message help text that results, which is what's caused confusion about your question.

You unmounted the device, /dev/vdc1, from /Data, formatted the device to XFS, then tried to remount it and it's saying there's no such device. Since you didn't give details on the exact command(s) you ran to "format the device to XFS", I'm going to assume what you did was:

sudo mkfs.xfs -f /dev/vdc1

If you forgot the -f, or didn't answer yes to a prompt to overwrite the existing file system, the mkfs command failed.

After doing this, you should just be able to run the command

sudo mount -t xfs /dev/vdc1 /Data

Looking at the error that was generated, it appears you entered "dev/vdc1" rather than "/dev/vdc1", and/or reversed the arguments to the mount command.

If it's still giving you an error for some reason, confirm that /dev/vdc1 actually exists. You can check /var/log/syslog or run dmesg to see what the system did after you created the new file system to determine if it decided to change the device associated with the partition for some reason, or what explicit error occurred when you ran the mount command that failed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.