mount Failure after changing hard disk location SOLVED ;)

Date December 8, 2006

Imagine that you have a system with three SCSI drives (sda,sdb,sdc) and has a failure in sdb (or even you removed it), on the next boot, drive sdc will become sdb. Many different scenarios can produce similar results (even with IDE).

Look at this picture may be will explain what i am talking about: (this Picture from Red Hat documents)

One approach in solving this problem is to use filesystem labels, but it doesn't solve the problem in all cases given that some partitions don't have filesystems such as swap or rawdevices used in SAN environments and Oracle installations and lastly some filesystems don't support labels at all.
any way, LABEL solution can be a good one when your filesystem is EXT2, EXT3, NFS, ISO9660, MSDOS and VFAT. to mount using label then As you do with the devices then you can do with LABEL, in /etc/fstab just change the device with its LABEL. For example if we have /dev/hdc5 labeled as WIN-G and with the filesystem vfat, with /mnt/win-g as a mount point, then the normal entry in the fstab will be something like

/dev/hdc5 /mnt/win-g vfat defaults 1 0

If you want to use Label to mount that partition, then change /dev/hdc5 with LABEL=DeviceLabel, in our example it will be like this:

LABEL=WIN-G /mnt/win-g vfat defaults 1 0

Now try to change change your hard disk location (Shutdown before 😛), the system will mount that device without any problem, if you are interest in this then Google will give you a great help, this sites may give some:
Red Hat Documentation
good ubuntu how-to

Another approach is to use a script called devlabel produced by engineers at Dell, it will use the UUID of the partition to know it and then mount it every reload, what does it do is making a symlink to your device, and keep its UUID, when you change your hard disk location then it will know where is it now by its UUID, i will not explain any more about it you can know more about it and how it work by following this links:
Red Hat Documentation
Resolving Device Name Issues in Linux (Dell website)
devlabel project page, download the script from here

Linux Red Hat 9 Review --> look at "The introduction of Device Labels"

Okay, i use slackware, it was work with me good, but take a look at that script, you will know that it use /etc/sysconfig/ for its configuration, i dont like sysconfig approach so i changed the script to take the configuration from another folder, if you want to do change, just take a look at devlabel code and the installation script...
finally i want to thank Net_Spider to let me know about this tool (devlabel).
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • StumbleUpon
  • Technorati
  • Reddit
  • Webnews
  • MisterWong
  • Y!GG

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>