Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 have a Windows 7 installed as my primary operating system on my C:\ drive. I have another ntfs partition, D:.

Ubuntu is installed using WUBI on C:\Ubuntu, which makes C:\ accessible through "/host". D:\ is mounted and can be reached via /media/some-hash, so each time I restart my machine, D:\ gets a different hashed-like name. This whole arrangement causes problems when I try to make links to files and folders located in D:\, which turn useless after each restart.

I know I need to mount D:\ drive permanently, somehow, by editing /etc/fstab. But I couldn't manage to figure out how exactly should I do that.

Any specific and friendly help for noobs would be very much appreciated.

share|improve this question
It's really strange that the "hash" would change. By default, it's either /media/drive-label or /media/drive-uuid (if no label), both of which are stored on the drive itself. If you run lsblk -f or sudo blkid, do they report the same "hash", and does it change across reboots? – grawity Aug 20 '12 at 19:31
It's strange, I have just rebooted and the "hash" stayed the same as you claimed. Don't know if it has something to do with the fact that It's a fresh installation, but I've been using wubi for a while now, and I know for certain that links to the drive that is not the host for Ubuntu become useless from time to time. I don't know exactly if it's rebooting that does that. It was an assumption based on the only thing I made that could have made a difference (that I noticed). – user1364136 Aug 20 '12 at 19:41
NAME FSTYPE LABEL MOUNTPOINT loop0 / sda ├─sda1 /host ├─sda2 └─sda5 /media/2C545B29545AF4D4 sr0 – user1364136 Aug 20 '12 at 19:44
UUIDs are usually added with the specific purpose of always being the same; a drive's UUID should change only when the drive is reformatted. – grawity Aug 20 '12 at 19:47
After reading about UUID, it makes sense since UUID starts with "Unique"... don't know, I was quite sure it changed. – user1364136 Aug 20 '12 at 19:51
up vote 2 down vote accepted

The fstab syntax is fairly simple:

device mountpoint fstype options dump pass
  • device is the device name, which can be made from information displayed in lsblk -f or sudo blkid commands:

    • LABEL=foo or /dev/disk/by-label/foo to select by the label (which can be changed in Windows by opening Computer and simply renaming the disk).

    • UUID=foo or /dev/disk/by-uuid/foo to select by the filesystem's unique ID (for NTFS it looks like a 16-letter "hash"). Normally, the UUID never changes.

    • /dev/sdXY (e.g. /dev/sda4) to select by Linux device name, which can sometimes change

  • mountpoint is the directory, such as "/media/Windows-D" or "/d:". If it doesn't exist, you need to create it yourself.

  • fstype is the word "ntfs"

  • options is the word "defaults"

  • both dump and pass should be set to "0"

So it should look like this:

UUID=2C545B29545AF4D4  /media/Data  ntfs  defaults  0  0

Or, if you label the drive as Data disk in Windows...

LABEL=Data\040disk  /media/Data  ntfs  defaults  0  0
share|improve this answer
Surprisingly I did labeled the drive as "Data"... but I didn't get any indication for that name when I used lsblk -f and sudo blkid. Thanks for the explanation anyway. But if I do that, won't at create a duplicate? – user1364136 Aug 20 '12 at 19:55

Your Answer


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.