Keeping same /dev/sdX disk device name after hot swap
Keeping same /dev/sdX disk device name after hot swap
A Dell 730XD hot swap NLS SAS drive named /dev/sda failed and was replaced, but the replacement drive now has device name /dev/sdj. How do we make the device appear as /dev/sda again without rebooting ?
I've tried :
echo 1 > /sys/block/sda/device/delete
echo 1 > /sys/block/sdj/device/delete
followed by
echo "- - -" > /sys/class/scsi_host/host0/scan
with the result that the replacement drive just remains as /dev/sdj.
There is no hardware or software raid or LVM in use.
Background: There are many identically configured nodes and currently each physical drive slot maps to the same /dev/sdN device name on each node - hence I'd like to preserve that uniformity.
I've tried :
echo 1 > /sys/block/sda/device/delete
echo 1 > /sys/block/sdj/device/delete
followed by
echo "- - -" > /sys/class/scsi_host/host0/scan
with the result that the replacement drive just remains as /dev/sdj.
There is no hardware or software raid or LVM in use.
Background: There are many identically configured nodes and currently each physical drive slot maps to the same /dev/sdN device name on each node - hence I'd like to preserve that uniformity.
Re: Keeping same /dev/sdX disk device name after hot swap
You don't. It gets whatever device name it feels like giving it and that could potentially change at every reboot. This is why things like UUIDs and LABELs exist so that you can refer to the device by something that it carries with it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Keeping same /dev/sdX disk device name after hot swap
if you don´t have RAID you don´t have hot swap...
how the disk structure is rebuild?
how the disk structure is rebuild?
Re: Keeping same /dev/sdX disk device name after hot swap
Isn't "hotswap/hotplug" what we do with USB drives too?
However, if drive was named 'sda', not part of redundant layer, did fail, got filesystem(s) mounted from it into peculiar state ... and system is still "fine" ... then can we be envious or at least curious?
The hdX/sdX/vdX are not persistent and predictable names. LABELs, UUIDs, LVM identifiers, RAID metadata, iSCSI ids are more "in the disk". (With them one hos different challenges.)
A configuration is ideally parametrized so that unpredictable names are not part of it.
Re: Keeping same /dev/sdX disk device name after hot swap
no, try to remove it on the fly then tell me...
hotplug is not hotswap and if it was, there was no doubt, no post, the plugged HD should work "out of the swap"...
Re: Keeping same /dev/sdX disk device name after hot swap
My understanding is that hot swap isn't synonymous only with RAID eg many JBOD configurations are also hot swap. To me it seems the default way the OS behaves after a hot swap in this case makes it, well, just a swap rather than a "hot" swap.
Also my understanding is that UUIDs and LABELs are for logical not physical structures i.e. partitions, filesystems LVM entities not disk devices themselves. The drives in question do not contain either partitions or filesystems.
Disk WWNs may be viable but would require some level of human hard coding and maintenance of the 288 WWNs spread over 24 servers - exactly the kind of error prone task that computing technology was conceived to avert!
But all of this speaks to a different question than the one posed: namely how it might be best to re-implement that element of the system but as this is an inherited live production system it isn't amenable to such a fundamental change on the fly - hence my original question was necessarily limited to the expedient of solving the problem of reestablishing device naming for the single device in question on one node only.
Digressing into that same question myself though, if I was to re-implement that part of the system I'd currently be tempted to use the device names in /dev/disk/by-path (rather than /dev/sdN) as the final digit sequence of the filenames designates Host:Bus:Target:LUN where, after a bit of experimentation, Target always seems to be synonymous with the physical disk slot number on the chassis. This seems invulnerable to /dev/sdN or major/minor renumbering (but not controller renumbering) but avoids hard coding a large list of WWNs. If anyone has a better idea I'd like to hear it though.
Re: Keeping same /dev/sdX disk device name after hot swap
This discusses pros and cons of by-id and by-path: https://wiki.archlinux.org/title/persis ... ice_naming
Re: Keeping same /dev/sdX disk device name after hot swap
The tying first takes place when an Ansible setup script enumerates each disk (eg sda) to be used by the application for it's own storage. I'm trying to avoid the script needing to have some kind of conditional around the device name that matches say a list of WWNs with one list of hardcoded numbers for each server. In short I'm trying to retain just the one simple, correctly parameterised setup script for all 24 machines.