Operating System - Linux
1830256 Members
1952 Online
110000 Solutions
New Discussion

Re: Remove SAN storage device from Linux server

 
Allison1
Occasional Contributor

Remove SAN storage device from Linux server

Hello, All,

How are you?

I have a quick question regarding removing SAN storage device from Linux server (RedHat).

We have some EMC storage devices attaching with Linux server. We would like to make sure no application running on those devices before we remove those storage from Linux server. The interesting thing is that we already see those non-used devices using "inq" (one of EMC commands) and fdisks (linux commands) after we reboot the Linux server, although we know no application is running on those devices.

There is a way in Solaris to exclude devices from system if we know those devices are not used by any application, they call it "exclude" file or black device file. Does Linux have this type of file, then we can put all non-used devices into the file and those devices won't display after we reboot server?

If you can advise when you get a chance, I would appreciate it.

Thank you in advance.
3 REPLIES 3
dirk dierickx
Honored Contributor

Re: Remove SAN storage device from Linux server

no such thing that i'm aware of. though, if you just leave the disks alone ea. dont mount, fdisk, etc them linux will not touch them so you should not worry about that.

why are you assigning disks to a server when you don't need them?
Matti_Kurkela
Honored Contributor

Re: Remove SAN storage device from Linux server

The "interesting thing" you mention is normal behavior: if they would vanish, how could you then change the filesystems on those disks in preparation for future applications? Or in this case, you might want to overwrite the disks using data from /dev/zero or /dev/urandom before physically disconnecting them: the operating system allows you to do this now, if you want.

You didnt say which version of RedHat you're using. The older RedHats normally used a static /dev directory, where all standard device nodes are always visible. If you try to use a device node that does not actually have hardware "behind" it, you get an error message.

Remember, the device node in /dev is *not* the actual device: it is just an interface node which translates the mostly-human-readable device name into major and minor device numbers for the kernel. Whether those numbers refer to anything usable or not, is another question entirely.
Normally, you don't need to think about the device numbers because everything is standardized and/or the administration tools do it for you.

RedHat AS/ES 4 has a 2.6 series kernel, so it uses the "udev" system by default. The "udev" system generates the /dev dynamically, so it contains device nodes for only the hardware that is actually present.

If you're intending to disconnect *all* SAN storage from the server, you could check the use count of your SAN HBA driver module.
Type "/sbin/lsmod" and find the correct driver module from the listing. The number in "Used by" column will tell if something is using the driver at the moment.

If it is zero, nothing is accessing the HBA driver and no disk is mounted through it. You could then use the "rmmod" command to remove the driver module.

To eliminate the possibility of autoloading the driver module again, you could add an "alias off" line in /etc/modules.conf (older RedHats) or /etc/modprobe.conf (ES/AS 4 and probably newer). You should run "depmod -a" to make this setting take effect immediately; otherwise, it will take effect at next reboot.

If you're removing only *some* of the SAN devices visible to the server, the problem is harder. As far as I know there is no standard way to permanently disable only some of the devices controlled by one driver, but you could use the "fuser" command to check if any process is using the devices you intend to remove.

You need root access or special privileges to mount disks, so if your applications are not running as root (good policy to have), you can just unmount the disks and comment them out of /etc/fstab to disable filesystem access.

If your software is using "raw" disks (typically only large databases or the like will do that), there should be a specific arrangement of permissions to allow the raw access for non-root processes, i.e. either the application userid is a member of the "disk" group or the disk devices have been changed to belong to the application userid. You should be able to just disable those permissions.
MK
Allison1
Occasional Contributor

Re: Remove SAN storage device from Linux server

Hello, Matti

Thank you very much for all the valuable information.

Our situation is that system admin would like to remove storage from OS before storage team remove storage (remove zoning & un-mask storage). The â remove storage from OS" includes umoutn FS, change /etc/fstab, export VGs and exclude storage device files from OS. Umoutn FS, change /etc/fstab and export VGs are ok, but the issue is how to exclude storage device files from OS, especially for Linux (Linux 3 & 4).

As you mentioned, the problem is harder, probably there is no standard process. I thought there might be a file in OS, and we can put exclude device files in that file, then those devices won't display by OS commands. I am not sure if it is doable, ???