Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
Showing results for 
Search instead for 
Did you mean: 

how to repalce bad disk and create device file in linux red hat 4.5

Etienne Chebli
Occasional Contributor

how to repalce bad disk and create device file in linux red hat 4.5

I have a proliant server with Linux Operating system and a software RAID 1 configuration.
I want to replace a bad disk with a new one.
Before Removing the disk physically i have executed the following in order to remove it from the raid configuration:
# mdadm /dev/md0 -f /dev/sda1 --remove /dev/sda1
The disk was removed successfully.
When I insert the new disk, i can't open it using "# fdisk /dev/sda" command. I receive the following message:
unable to open /dev/sda
I am trying to create new device file for this disk using "MAKEDEV " command but it won't work.
If i try to restart the server it will not boot until I physically remove the new disk from the enclosure and reboot or until i boot in rescue mode and create on it new partition (boot partition) and reboot.

How can i replace a faulty disk under linux with sotware RAID 1 configuration ?
Honored Contributor

Re: how to repalce bad disk and create device file in linux red hat 4.5

You are using software RAID 1, but what's the disk controller hardware?

If it is a SmartArray, you must use SmartArray configuration tools (I prefer hpacucli) to tell the controller you wish to use the disk as a simple stand-alone disk. That should make the disk available to the kernel.

Other disk controllers may require something else.

After that, you'll need to partition the disk and rejoin it to the md0 configuration. Finally you must make sure the new disk is bootable, as the Master Boot Record is outside any partition and will not be mirrored with your md0 configuration.

The use of MAKEDEV is not necessary with RHEL4: it has a 2.6 series kernel, which uses a dynamic /dev filesystem (udev) as a standard feature. The device file should automatically appear as the Linux kernel detects a new disk.

However, it may not appear as /dev/sda but some other /dev/sd* device, as the kernel may notice that the new disk is not actually the same disk as the old /dev/sda. This is not a problem: Linux software RAID can handle device name changes quite well. The device naming will return to normal after a reboot.