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.
- 06-18-2011 #1Just 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
- 06-18-2011 #2forum.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_namingoz
- 06-18-2011 #3Just 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
- 06-19-2011 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,233
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!
- 06-19-2011 #5Just 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
- 06-21-2011 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,233
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!
- 06-21-2011 #7Just 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
- 06-21-2011 #8Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,233
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!
- 06-28-2011 #9Just 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


Reply With Quote
