I've got 4 internal and two external hard drives.
Every time I boot and log in I find at least one of my internal drives mounts in a different directory than it had previously (the others may as well, but I've not yet noticed - read on).
It's never the same directory (it's either "/media/disk" "/media/disk-1", or "/media/disk-2" or "/media/disk-3").
I've got a symlink from a directory in ~/ to a subdirectory on one of my internal drives and it breaks with every boot.
Is this a bug or a feature? ;)
How might I get my drives to mount in the same place every time?
Thanks.
On Fri, 2008-02-22 at 11:10 -0700, Scott wrote:
I've got 4 internal and two external hard drives.
Every time I boot and log in I find at least one of my internal drives mounts in a different directory than it had previously (the others may as well, but I've not yet noticed - read on).
It's never the same directory (it's either "/media/disk" "/media/disk-1", or "/media/disk-2" or "/media/disk-3").
I've got a symlink from a directory in ~/ to a subdirectory on one of my internal drives and it breaks with every boot.
Is this a bug or a feature? ;)
How might I get my drives to mount in the same place every time?
Thanks.
-- Scott http://angrykeyboarder.com I've never used an OS I didn't (dis)like. I'm angrykeyboarder™ and I approved this message.
I now always label my disk partitions both for hotplug mounting and for /etc/fstab type mounting.
If they are Linux ext2/ext3 then use e2label blkid is also useful to check what's what.
If they are MS then I picked up these instructions from the web ################################################################## fuerte labeling_disks 999# cat labelling_fat32_partitions.txt2 I wanted to rename the fat32 partitions that get automounted when they are plugged in to the USB drive. Two were exactly similar external hard disk drives, and one was an iPod. The exactly similar hard disk drives (one each at home and work) were both getting mounted at /media/sda1 or sda2 etc, and it was impossible to distinguish one from the other easily. Also, I found that it wasn't that easy to edit the partition labels for FAT32 partitions. So I thought I would summarize how I named my fat32 partitions to have consistent names. This has the benefit that when these drives are automounted, they will be at the location /media/partition-label, where partition-label is the label that you give the partition.
Step by step instructions to re-label FAT partitions follow:
1) Install mtools: $sudo apt-get install mtools
2) After the usb drive is automounted after plugging in, find out the device descriptor using: $mount and Note down where it says "csda1" or similar
3) copy the mtools.conf to ~/.mtoolsrc $cp /etc/mtools.conf ~/.mtoolsrc
4) Edit ~/.mtoolsrc to add one line at the very end: drive i: file="/dev/sda2" you may have to change sda2 to something else depending on what you got in step 2 above.
5) Change to the "cdrive" i: $mcd i:
6) Check what the label for the drive is currently: $sudo mlabel -s i:
7) Change the label to something pretty: $sudo mlabel i:my-ipod
8) Check if the label has changed: $sudo mlabel -s i: I got the following output - Volume label is MY-IPOD
You're all set!! The next time that partition gets automounted, it will be at /media/MY-IPOD fuerte labeling_disks 1000# ####################################################################
I don't know about NTFS
Good luck
John
John Austin wrote:
[........]
Step by step instructions to re-label FAT partitions follow:
- Install mtools:
$sudo apt-get install mtools
I thought this was a Fedora list. :)
Don't you mean
$ sudo yum install mtools ?
I don't know about NTFS
One of my external drives is formatted in FAT32 but it was also labeled to begin with. It has not been a problem.
The others are either ext3 or NTFS and are not labeled. Hence my problems (I think).
Scott wrote:
I've got 4 internal and two external hard drives.
Every time I boot and log in I find at least one of my internal drives mounts in a different directory than it had previously (the others may as well, but I've not yet noticed - read on).
It's never the same directory (it's either "/media/disk" "/media/disk-1", or "/media/disk-2" or "/media/disk-3").
I've got a symlink from a directory in ~/ to a subdirectory on one of my internal drives and it breaks with every boot.
Is this a bug or a feature? ;)
How might I get my drives to mount in the same place every time?
Use the UUID in /etc/fstab instead of whatever you are using now. Some people may use the filesystem label, but I'm always afraid that when or if I move the f/s to a larger device the name will not change, and if I plug in the old device it will mount. Using UUID will keep you from that particular problem.
Bill Davidsen wrote:
Scott wrote:
I've got 4 internal and two external hard drives.
Every time I boot and log in I find at least one of my internal drives mounts in a different directory than it had previously (the others may as well, but I've not yet noticed - read on).
It's never the same directory (it's either "/media/disk" "/media/disk-1", or "/media/disk-2" or "/media/disk-3").
I've got a symlink from a directory in ~/ to a subdirectory on one of my internal drives and it breaks with every boot.
Is this a bug or a feature? ;)
How might I get my drives to mount in the same place every time?
Use the UUID in /etc/fstab instead of whatever you are using now. Some people may use the filesystem label, but I'm always afraid that when or if I move the f/s to a larger device the name will not change, and if I plug in the old device it will mount. Using UUID will keep you from that particular problem.
If you put a label on your drive it will mount under the label.
If you name your drive Scott_1, it will be mounted as /media/Scott_1 not disk-x. I do this with all my sticks and cards to identify them easier. It is nice at work as we all have the same brand/model/type of stick. I can plug mine in and my name shows up.
Robin Laing wrote:
Bill Davidsen wrote:
Scott wrote:
I've got 4 internal and two external hard drives.
Every time I boot and log in I find at least one of my internal drives mounts in a different directory than it had previously (the others may as well, but I've not yet noticed - read on).
It's never the same directory (it's either "/media/disk" "/media/disk-1", or "/media/disk-2" or "/media/disk-3").
I've got a symlink from a directory in ~/ to a subdirectory on one of my internal drives and it breaks with every boot.
Is this a bug or a feature? ;)
How might I get my drives to mount in the same place every time?
Use the UUID in /etc/fstab instead of whatever you are using now. Some people may use the filesystem label, but I'm always afraid that when or if I move the f/s to a larger device the name will not change, and if I plug in the old device it will mount. Using UUID will keep you from that particular problem.
If you put a label on your drive it will mount under the label.
Perhaps I wasn't clear. If you put a "LABEL=" line in your /etc/fstab file it will mount where you tell it to. But if you move an external filesystem from a small drive to a larger drive and keep the same name for the filesystem so it will mount where you want it, then accidentally plug in the old drive instead, you could have a problem. By specifying the "UUID=" in /etc/fstab you avoid that learning experience.
If you name your drive Scott_1, it will be mounted as /media/Scott_1 not disk-x. I do this with all my sticks and cards to identify them easier. It is nice at work as we all have the same brand/model/type of stick. I can plug mine in and my name shows up.
Name your filesystem, not drive, but your meaning is clear. Just be sure someone else with the same filesystem name doesn't visit. Seriously.
Bill Davidsen wrote:
Use the UUID in /etc/fstab instead of whatever you are using now.
UDIDs (in Debian/Ubuntu) have had their own set of problems.
In addition all "problem" drives aren't showing up in fstab at all (which I find rather odd).
I've got 2 external drives (1 partition each) and 2 other internal drives (several partitions).
All were mounted as I wrote this.
However..
$ cat /etc/fstab /dev/VolGroup00/LogVol00 / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 /dev/VolGroup00/LogVol01 swap swap defaults 0 0
Where are they here?
Scott wrote:
In addition all "problem" drives aren't showing up in fstab at all (which I find rather odd).
I've got 2 external drives (1 partition each) and 2 other internal drives (several partitions).
All were mounted as I wrote this.
However..
$ cat /etc/fstab /dev/VolGroup00/LogVol00 / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 /dev/VolGroup00/LogVol01 swap swap defaults 0 0
Where are they here?
Did you configure mount points for them during install, or are they being mounted automatically on mount points in /media? If you did not set up mount points for them during install, and did not add them later, then they will not show up in /etc/fstab. You may want to create entries and mount points for the internal drives if they are not removable. For removable drives, you will probably not want to create fstab entries for them - it can cause problems when booting with the drives disconnected.
Mikkel
Mikkel L. Ellertson wrote:
Scott wrote:
In addition all "problem" drives aren't showing up in fstab at all (which I find rather odd).
I've got 2 external drives (1 partition each) and 2 other internal drives (several partitions).
All were mounted as I wrote this.
However..
$ cat /etc/fstab /dev/VolGroup00/LogVol00 / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 /dev/VolGroup00/LogVol01 swap swap defaults 0 0
Where are they here?
Did you configure mount points for them during install, or are they being mounted automatically on mount points in /media?
Mounted automatically (albeit sporadicly).
If you did not set up mount points for them during install, and did not add them later, then they will not show up in /etc/fstab. You may want to create entries and mount points for the internal drives if they are not removable.
I'll give that a try.
For removable drives, you will probably not want to create fstab entries for them - it can cause problems when booting with the drives disconnected.
True.
Thanks.