Find the answer to your Linux question:
Results 1 to 9 of 9
I support an application that runs on RHEL 5.X and uses multipath to access a SAN. A Bare Metal Restore backup is done using Storix which needs to write directly ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2004
    Posts
    14

    How to make a USB drive show up the same way everytime


    I support an application that runs on RHEL 5.X and uses multipath to access a SAN. A Bare Metal Restore backup is done using Storix which needs to write directly to a /dev/sd* device, or at least what you configure it to use.

    The problem is if the USB drive is plugged in when the system is booted it can be identified as /dev/sdb and the the SAN LUNs are /dev/sdc and up. If the configuration file is then set up to use /dev/sdb and then later the system is booted with the USB drive not plugged in the SAN LUNs use /dev/sdb and up, which is fine because multipathd handles that. But when the USB drive is plugged in and becomes say /dev/sdx and the Storix configuration file is not changed, the Storix backup will still use /dev/sdb and corrupt what is there on the SAN.

    I assume a udev rule could be used to make the USB drive appear as the same name, maybe /dev/storix.

    So I am looking for some good pointers to how to do this with udev or what ever. The application will soon be running on RHEL 6.X also, so hopefully what ever solution someone points me to will still work on it as well.

    Thanks:
    Jack Allen

  2. #2
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Have you taken a look at persistent block device naming to see if it will work for you?

    https://wiki.archlinux.org/index.php..._device_naming
    oz

  3. #3
    Just Joined!
    Join Date
    Dec 2004
    Posts
    14
    Oz:
    Thanks for the quick reply.

    That is good information, but I don't think it will do what I need it to do. The USB disk may be blank or already partitioned. The reason the Storix configure needs to specify a device name is because it will write a boot program ti it and partition the way it needs it and then create files systems and mount them as needed. This is all done when the backup is run so the USB drive and be booted from and then used to restore the system. Which could even be on different hardware.

    Thanks:
    Jack Allen

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,596
    Me I label my file systems and mount using the LABEL=name format instead of /dev/sdxn. I don't supposed Storix can use a label instead of device id? In any case, the current and recent kernels specifically do not guarantee what device id is assigned. It depends upon the order it sees the drives in the system.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Dec 2004
    Posts
    14
    Storix uses the device name that is specified in its configuration file. The device may or may not be partitioned and it will take care of that and creating files systems and mounting them when it needs. It needs the base device name to do this and also write a boot record. So at the time it is doing a lot of this, there would not be any labels to use.

    Thanks:
    Jack Allen

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,596
    I would suggest that you contact Storix about this problem and see what they say about it.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Dec 2004
    Posts
    14
    I have thought about that, but that would be a major change for the way the program works and it would not help my customer that would probably not upgrade anytime soon. I have been able to write a udev rule that works when only 1 USB Drive is plugged in. If a second one is plugged, the symbolic links get changed to point to the just plugged in drive sd* name. But this is better than the drive name being different and causing problems. There is really no reason for them to have more than 1 USB Drive plugged in.

    Thanks:
    Jack allen

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,596
    Sorry we couldn't have been of more help. This bit of random ordering of storage devices by the Linux Kernel is FAD - functions as designed. Perhaps some clever lurker on the forums can come up with a way to generate device aliases that will be consistent, but I don't know what that may be, and unfortunately I don't have the time to do the research and experimentation that would require at this time.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Just Joined!
    Join Date
    Jun 2005
    Location
    Alstead, NH, USA
    Posts
    20
    I use storix and to circumvent the problem I use two methods. I have storix create a LVM backup disk instead of a partitioned disk. This gives it aan LVM logical volume label which will remain unchanged. Before use that disk needs to be mounted with the sequence:
    vgscan
    vgchange -ay stbackupvg
    mount /backups

    THe other method I use is to have storix create a partitioned disk and label it. It will then mount to /media/LabelName which can be entered into storix. I use this disk as a copy-to disk to copy previously made backups to it for offsite storage.

    Storix suggested tghis procedure and it works well.

    Rees

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •