LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Volume label problem (https://www.linuxquestions.org/questions/slackware-14/volume-label-problem-418749/)

hondapowered 02-23-2006 10:11 AM

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
mount: wrong fs type, bad option, bad superblock on /dev/hdg2,
      missing codepage or other error
      (could this be the IDE device where you in fact use
      ide-scsi so that sr0 or sda or so is needed?)
      In some cases useful info is found in syslog - try
      dmesg | tail  or so

Code:

# dmesg | tail
hdg2: bad access: block=2, count=2
end_request: I/O error, dev 22:02 (hdg), sector 2
EXT2-fs: unable to read superblock

Mount is still trying to use the old hdg partitions when looking for volume labels.
I would like it to mount the firewire disk instead.

Thanks in advance.

michaelk 02-23-2006 10:49 AM

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 .....

hondapowered 02-23-2006 11:44 AM

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?

lord-fu 02-23-2006 11:53 AM

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.

hondapowered 02-23-2006 12:22 PM

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.

cwwilson721 02-23-2006 12:27 PM

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.

hondapowered 02-23-2006 12:35 PM

[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]

hondapowered 02-23-2006 12:42 PM

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?

lord-fu 02-23-2006 12:47 PM

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.

hondapowered 02-23-2006 01:46 PM

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
<device DEVNO="0x0200" TIME="1152735226" UUID="B4D9-1CC6" SEC_TYPE="msdos" TYPE="vfat">/dev/fd0</device>
<device DEVNO="0x1600" TIME="1153144667" TYPE="iso9660">/dev/cdrom</device>
<device DEVNO="0x2201" TIME="1154544886" UUID="3a041223-c421-4a09-84c2-196365c05470" TYPE="ext2">/dev/hdg1</device>
<device DEVNO="0x0301" TIME="1140646418" UUID="5e083e63-c4f7-49f6-8e71-e53036cd640e" TYPE="ext2">/dev/hda1</device>
<device DEVNO="0x0302" TIME="1140646418" UUID="02a99be6-a3c8-4787-a25a-efc00ee81d88" TYPE="ext2">/dev/hda2</device>
<device DEVNO="0x0303" TIME="1140646418" UUID="096f9975-3db9-4cc4-9d82-fb5f11dafd19" TYPE="ext2">/dev/hda3</device>
<device DEVNO="0x0304" TIME="1140646418" TYPE="swap">/dev/hda4</device>
<device DEVNO="0x2101" TIME="1140646418" UUID="7645043b-70eb-4cb2-bfac-021180b2e7f3" SEC_TYPE="ext2" TYPE="ext3">/dev/hde1</device>
<device DEVNO="0x2202" TIME="1153076086" LABEL="firedisk1" UUID="ed6642f8-9cbc-473a-a1d3-c1eadcec80bc" TYPE="ext2">/dev/hdg2</device>
<device DEVNO="0x2203" TIME="1153680886" LABEL="firedisk2" UUID="12a91773-5a8d-46bd-85db-a8fa01290a37" TYPE="ext2">/dev/hdg3</device>
<device DEVNO="0x2204" TIME="1154285686" LABEL="firedisk3" UUID="0f1c2535-8fa0-4c10-b416-a7efaa70c54e" TYPE="ext2">/dev/hdg4</device>


I deleted the last 3 lines and no more problems. Thank you all who replied.

cwwilson721 02-23-2006 03:34 PM

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.