Simpler Navigation coming for Servers and Operating Systems
Coming soon: a much simpler Servers and Operating Systems section of the Community. We will combine many of the older boards, and you won't have to click through so many levels to get at the information you need. If you are looking for an older board and do not find it, check the consolidated boards, as the posts are still there.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

HOw to activate scsi hard disk in Linux

SOLVED
Go to solution
Jeeshan
Honored Contributor

HOw to activate scsi hard disk in Linux

I have two hard drive in my linux box and both are mirrored and used for swap.

suddenly i found the one hdd is disappear and found something.

from dmesg:
end_request: I/O error, dev sda, sector 0
Buffer I/O error on device sda, logical block 0
Buffer I/O error on device sda, logical block 1
Buffer I/O error on device sda, logical block 2
Buffer I/O error on device sda, logical block 3
sd 0:0:0:0: SCSI error: return code = 0x00040000


from mdstat:

cat /proc/mdstat
Personalities :
unused devices:

from lsscsi:

lsscsi
[0:0:0:0] disk ATA SAMSUNG HD080HJ WT10 /dev/sda
[3:0:0:0] disk ATA SAMSUNG HD080HJ WT10 /dev/sdb


do anyone have any idea how to activate hdd in Linux?
a warrior never quits
4 REPLIES
Matti_Kurkela
Honored Contributor
Solution

Re: HOw to activate scsi hard disk in Linux

Sorry, but your /proc/mdstat looks like there is actually no MD software RAID running at all (mirroring or otherwise).

Even if one half of a mirror set had failed, the output should be something like this:
(this is actual output from a system that currently has a mirror set with one half missing)

# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda2[0]
117116304 blocks super 1.2 [2/1] [U_]

But Linux systems can have more than one way of setting up disk mirroring.

What is the name and version of your Linux distribution?

For example, if you're running RHEL 4 or later, you might have been using LVM-based mirroring (instead of the usual MD software RAID). LVM-based mirroring is not as well-tested as the MD-based version and requires a third device for the mirror log, but it's much easier to set up if the system has already been installed.

Please post the output of this command to confirm the state of your possible LVM-based mirror:
vgs -P -o +devices

When a LVM mirror fails, the default behavior of the LVM mirror set is to automatically reduce the failing half of the mirror - so the mirror set becomes a regular LVM physical volume located on the disk that is still working OK.

To re-establish a LVM-level mirror, I think the procedure is the same as when originally setting it up.

The message
sd 0:0:0:0: SCSI error: return code = 0x00040000
seems to mean DID_BAD_TARGET: in other words, the disk seems to be completely gone. Trying to "activate" a disk that has a hardware failure is very likely useless. Take a full backup and replace the failed disk before trying anything else.

MK
MK
Jeeshan
Honored Contributor

Re: HOw to activate scsi hard disk in Linux

Its SuSE and there is no LVM mirroring.

I'm going to reboot the server. Do you think does it resolve the problem?
a warrior never quits
Matti_Kurkela
Honored Contributor

Re: HOw to activate scsi hard disk in Linux

It's worth a try. But generally, if the HDD has failed, you should prepare to replace it.

If the HDD's internal firmware diagnostic determines the drive is not usable, then the drive often "disappears" from the bus. At that point, normal operating systems can no longer access the disk at all; special diagnostic software and/or hardware may be required to even try to read the failing disk.

For the purposes of a normal sysadmin, such a HDD is completely "dead" and must be replaced.

If the disk comes back when the system is rebooted, you should make a complete backup ASAP: a disk that has completely failed once should be considered unreliable. The only exception is if the failure is caused by a known disk firmware bug: in that case, once the appropriate firmware update is applied, the disk can generally be expected to be good for its normal lifetime.

MK
MK
Jeeshan
Honored Contributor

Re: HOw to activate scsi hard disk in Linux

HI Matti

thanks for your valuable time.

The disk has been reappear after reboot.

I have no idea why this happened.

I'll let you know once i get the root cause.
a warrior never quits