Volume label problem
How does "mount" associate the volume label with a device? Is it stored in a file some where?
Is there a way to reset or clear the association? Searching returned a lot of info on how to create volume labels and there intended use. Nothing I have read deals with how it works, or the files/info used to preform mounts from labels. Running Slack 10.2. I had a hard drive, hdg, 4 partitions formatted ext2, hdg1 = no label, hdg2 = "extradisk1", hdg3 = "extradisk2", & hdg4 = "extradisk3". I mounted them using the label instead of the device name and everything was good. I repartioned hdg with 1 partition and no volume label. I added a firewire drive, sda, 3 partitions formatted ext2, sda1 = "extradisk1", sda2 = "extradisk2", & sda3 = "extradisk3". Mounting them using the label doesn't work. Code:
# mount -L extradisk1 /mnt/hd Code:
# dmesg | tail I would like it to mount the firewire disk instead. Thanks in advance. |
You can use tune2fs to change the labels. However I would
change the fstab entry to use device IDs instead of labels. i.e. /dev/sda2 /mnt/hd .... instead of label=extradisk1 /mnt/hd ..... |
The labels are already set. I am not using fstab to mount these partitions because I don't want them auto mounted.
I want to know why, after removing the volume labels & partitions from hdg and re-using the label names on the sda partitions, "mount -L <label>" would still try to mount the old hdg partitions even though they no longer exist. And is there a way to correct this? |
Just a shot in the dark, you sure there is no fstab entries for those drives? And just because its in fstab does not mean that it is auto mounted. You can add the option noauto and it will not mount at boot. You really should add all to fstab with device ids not labels.
Hope that helps some. |
No fstab entries for these devices.
these partitions are to be mounted with an automated script. I had the understanding that with the lables, my script would not be conserned what the device name or id was. I have used the labels on partitions that no longer exist and then reused the labels on a different disk, but mounting with the label still trys to mount the nonexistent hdg partitions instead of the new sda partitions. |
Did you check you /etc/fstab entries?
Using volume labels is not a good idea, like everybody else has stated, for EXACTLY the reasons that you are having a problem with. Volume labels can change, but devices do not (unless you physically remove/replace them). Check your fstab entries. Tell us the result. Or don't check them, and keep asking the same question. Your system. Your choice. |
[CODE]# cat /etc/fstab
/dev/hda4 swap swap defaults 0 0 /dev/hda1 / ext2 defaults 1 1 /dev/hda2 /usr ext2 defaults 1 2 /dev/hda3 /home ext2 defaults 1 2 /dev/hde1 /mnt/shared ext3 defaults 1 2 /dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0 /dev/fd0 /mnt/floppy auto noauto,owner 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 proc /proc proc defaults 0 0[CODE] |
cwwilson721: i understand that volume labels change. I changed the volume labels for the drives in question, because I want to mount the new partiitions not the old ones. My understanding of mounting by label, is that it is possible to mount the filesystem by its label regardless of what device it is on. Am I wrong in that thinking?
|
Hello,
I can only tell you that maybe you should add the entry to fstab for the correct device names and mount points with the option of no auto like you wanted. That will at least give you access to the drives. I do not know why when you try to mount that there is still a reference to your other drive labels, other than there may be a reference to the drive in /dev . If this is the case maybe you can delete the entry for hdg in /dev and see if that helps. I do not know if you should delete this or if it will fix your issue. Sorry I cant be of more help and good luck!, I am sure/hope someone will come along and offer greater guidance. Good day. |
I have fixed my problem. The file /etc/blkid.tab is what mount uses for association of device ids and volume labels to the device.
Code:
# cat blkid.tab I deleted the last 3 lines and no more problems. Thank you all who replied. |
I was just stating that mounting by volume labels is not a good practice, because of the problems you were having. It is a classic example of why you should not do so.
|
All times are GMT -5. The time now is 09:34 AM. |