1

I'm posting here to have your points of view on my problem.

Part of my job is to manage backup servers but I'm new in LINUX world.

Today I had to repair a backup server running on CentOS 6.xx.

The problem is that the backup was set up to save the server data on an external hard drive. The hard drive was supposed to be mounted on sde1 part. But one day, the sde1 part became unreachable and the external HDD part became sdf1, screwing the backup.

So my question is : what can cause this to happen? Do you have an idea why, suddenly, sde1 became unusable? Can it be a hardware issue?

3

You can probably find why by running dmesg (or looking in /var/log/kern.log, or running journalctl -bk—sorry not sure which of these are around on CentOS). For some reason the disk disconnected, then later reconnected. sde was already in use, so the kernel gave the drive the next available: sdf. The disconnect/reconnect was probably a hardware problem (but maybe something non-worrying, like someone bumping a USB cable).

Ultimately, however, /dev/sd? are not stable. At minimum, if you have two identical external USB disks, you can expect them to flip around randomly every boot. Internal drive letter assignments are often much more stable, but you should really use /dev/disk/by-id/ (or any of the /dev/disk/by-*/ directories), a filesystem UUID, etc. With USB (or Firewire), by-path is best avoided (changing which USB port something is plugged in to is not supposed to matter—but that changes the path).

  • The comment about /dev/sd* not being stable goes double for any type of external storage, but especially with USB, where depending on your hardware, you may get random resets because of adding or removing other devices on the bus (or other devices being poorly behaved and triggering bus resets). – Austin Hemmelgarn Jul 18 '17 at 17:17
  • Ok thanks, i didn't even know about UUID. The problem is that the client has to switch between to external HDD and the backup setting accepts only one partition (sdf1 now). I fear that sde1 reappear and desappear again and again or maybe it's blocked forever... – ViouYek Jul 19 '17 at 6:45
  • And the client has to switch the 2 external HDD every day so it should take back the sde1 part... But it doesn't, that's why i guess there's a bigger problem here... – ViouYek Jul 19 '17 at 8:30
  • @ViouYek something is still references sde, so the kernel can't re-use it. E.g., maybe it's still mounted somewhere (though of course any access to the mount will just error out). If you can't find what's referencing it, a reboot will free it up. Your best bet might be to write a custom udev rule to keep a symlink to the correct device (if you need help writing a udev rule, that's probably best asked as a new question—if we don't already have it) – derobert Jul 19 '17 at 16:42
  • Thanks for the answers guys, i'll look at udev rule asap. – ViouYek Jul 26 '17 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.