Jump to content

Mounting Disks using Disk Label


Guest Plisgyn
 Share

Recommended Posts

Guest Plisgyn

I have several hard disks in caddies which plug into one receptacle in my PC, the disks are Vfat and ext2/ext3. What I need

to do is be able to supermount each disk to a different mount point depending on the disk label. My first problem is to label the

disks, in MLCC Mount Points I can add a Label to the fstab entry but how do I write a label to the disk it self. Any help will be

gratefully received.

 

Phil Jones

 

 

[moved from Software by spinynorman]

Link to comment
Share on other sites

Guest Plisgyn

Thanks I have now labeled my ext2/ext3 disks and my Vfat disk shows a label in Windows but not in Linux, I think this is because

the label is i.e in hdc rather than hdc1. I still have the problem getting the system to mount the removeable disk on different mount

points according to label.

 

Phil Jones

Edited by Plisgyn
Link to comment
Share on other sites

Any particular reason why you want to mount by label, rather than the partition information?

 

I've still been trying to figure out what benefits it has mounting via label, than /dev/hdax or whatever :P

 

I honestly think it'd be better to mount by the partition, for example:

 

mount /dev/hda1 /mnt/fatpartition

 

assuming hda1 is the partition of course, just an example. /etc/fstab can be edited accordingly with this information to auto-mount where necessary.

Link to comment
Share on other sites

Guest Plisgyn

The problem is a I have several disks ext2/3 and vfat in caddies, and when any disk is plugged in to my sole PC receptacle

they are all seen as as hde1. This is why I need labels unless you know another way I can mount different disks on various

mount points.

Link to comment
Share on other sites

As I mentioned, ext2/ext3 can be mounted by label. I've also just checked, and you cannot mount vfat/Fat32 partitions by label.

 

The command in Linux for creating labels on DOS type partitions, or FAT/FAT32/VFAT if you like is:

 

mlabel

 

do:

 

man mlabel

 

to read up on it. However, when reading the man page for mount command, it can only mount by label for ext2/ext3 and xfs. Maybe even reiserfs too, but definitely not vfat type partitions.

Link to comment
Share on other sites

Is uuid a linux thing only? I do not do windows, so do not know

At boot time in mdv both label and uuid are displayed.

 

I suppose for the vfat, a bit of scripting might do the trick

Say once it is mounted on default mountpoint a script

looks at the label and mount the HD on another location...

 

I believe uuid are unique, but label not necessarily

Link to comment
Share on other sites

I have a usb thumbdrive that is labeled. I'm able to mount it by label by having the following line in my /etc/fstab.

 

/dev/disk/by-label/THUMBDRIVE /mnt/thumbdrive vfat noauto,umask=0,user 0 0

 

I don't know why that wouldn't work with the mount command directly. Give it a shot...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...