LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-18-2009, 07:01 PM   #1
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Rep: Reputation: 15
Can OS recognize new drive w/o a reboot


I just replaced a failed member of a raid1 volume and I can't get the OS (Gentoo) to recognize the new drive. I really can't reboot this server right now. Is there a way to poll the hard drives without rebooting?

thanks.
 
Old 08-18-2009, 08:14 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I assume we are talking about IDE here? IDE drives are not hot-swappable (aside from things like some laptop drive bays), which is a hardware problem and not something you can resolve in software.

SATA is another story though, and you shouldn't have any problems swapping them out.
 
Old 08-18-2009, 08:31 PM   #3
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
You can make the system rescan the bus. How you do that depends on what bus you want to scan.

For scsi, execute this command:
echo "- - -" > /sys/class/scsi_host/host0/scan

I believe the same or very similar syntax works for rescanning a sata bus.

I don't believe you need to rescan an ide bus; just try to mount the device with its ID based on its position in the IDE chain.
 
Old 08-19-2009, 08:14 AM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Hi,
Quote:
Originally Posted by MS3FGX View Post
I assume we are talking about IDE here? IDE drives are not hot-swappable (aside from things like some laptop drive bays), which is a hardware problem and not something you can resolve in software.

SATA is another story though, and you shouldn't have any problems swapping them out.
You can only hot swap IDE if the drive is mounted in a special tray that converts to a SATA;

Quote:
excerpt from 'http://www.addonics.com/products/mobile_rack/aenrhd25.asp';

The Mobile Rack25 is one of few removable hard drive kit in the market for 2.5" hard drive. It turns practically any 2.5" IDE hard drive instantly into a removable IDE hard drive or a hot swappable Serial ATA hard drive in any desktop computer or equipment. With the Serial ATA option, you can use the hard drive like a drive cartridge, without the need to reboot the system when you remove or insert the hard drive into the drive bay. The enclosure, when is removed from the drive cradle, can also be connected to any computer as an external hard drive using one of the Addonics optional interface cables - USB2.0, Firewire, PCMCIA or Serial ATA.
This has been done but by the time you purchase the kit you might as well get the rack designed for Hotswap SATA and the drive kit for that. You wouldn't need to get the additional shockmount kit for the IDE.

Yes, you shouldn't hotswap IDE drives unless you have specifical designs to allow such.
 
Old 08-19-2009, 09:49 AM   #5
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jiml8 View Post
You can make the system rescan the bus. How you do that depends on what bus you want to scan.

For scsi, execute this command:
echo "- - -" > /sys/class/scsi_host/host0/scan

I believe the same or very similar syntax works for rescanning a sata bus.

I don't believe you need to rescan an ide bus; just try to mount the device with its ID based on its position in the IDE chain.
That's what I needed to know. Thank you! I'll try that as soon as I get into the office.


BTW, they are hot swappable SATA drives. I should have been more specific in my original post.
 
Old 08-20-2009, 11:45 AM   #6
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Original Poster
Rep: Reputation: 15
OK. I tried the command and this is what I got:

echo "- - -" >/sys/class/scsi_host/host0/scan
bash: /sys/class/scsi_host/host0/scan: No such file or directory

The drives are definately hot swappable SATA drives, but the system identified them as /dev/hda and /dev/hdb. I've tried two different replacement drives and neither one is automatically recognized by the system. This is more complicated than I thought.

I inherited this server and there's no documentation, but I'm fairly certain the RAID volumes were created using mdadm. Here's the output from mdadm - D:

*********************
webdev / # mdadm -D /dev/md0
/dev/md0:
Version : 00.90.03
Creation Time : Thu Sep 29 07:19:53 2005
Raid Level : raid1
Array Size : 72192 (70.51 MiB 73.92 MB)
Used Dev Size : 72192 (70.51 MiB 73.92 MB)
Raid Devices : 2
Total Devices : 1
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Wed Aug 19 14:55:47 2009
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0

UUID : 0c9e4f51:eeed1593:ad4f1fcc:48abf372
Events : 0.386

Number Major Minor RaidDevice State
0 0 0 0 removed
1 3 65 1 active sync /dev/hdb1
**************************************************

Here's the contents of /etc/raidtab:

***********************************
webdev / # cat /etc/raidtab
# /boot (RAID 1 MIRROR)
raiddev /dev/md0
raid-level 1
nr-raid-disks 2
chunk-size 32
persistent-superblock 1
device /dev/sda1
raid-disk 0
device /dev/sdb1
raid-disk 1

# / (RAID 1 MIRROR)
raiddev /dev/md2
raid-level 1
nr-raid-disks 2
chunk-size 32
persistent-superblock 1
device /dev/sda3
raid-disk 0
device /dev/sdb3
raid-disk 1
***********************************************

Fdisk -l yields:

**************************************************
Disk /dev/hdb: 74.3 GB, 74355769344 bytes
255 heads, 63 sectors/track, 9039 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 9 72261 fd Linux raid autodetect
/dev/hdb2 10 259 2008125 82 Linux swap / Solaris
/dev/hdb3 260 9039 70525350 fd Linux raid autodetect

Disk /dev/md0: 73 MB, 73924608 bytes
2 heads, 4 sectors/track, 18048 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn't contain a valid partition table

Disk /dev/md2: 72.2 GB, 72217853952 bytes
2 heads, 4 sectors/track, 17631312 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md2 doesn't contain a valid partition table
*****************************************************

The SATA controller is:
IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02)


Right now, I'm afraid to even reboot this system because I'm not certain that hdb1 has an MBR or a valid partition table.

Any ideas? I'd be very grateful. Thanks.
 
Old 08-21-2009, 02:02 AM   #7
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
take a look in /sys/class/scsi to see if you have anything.

I don't run sata here at all (All SCSI but for a handful of PATA) so I haven't encountered the particular problem.

The design and intentions of the /sys virtual filesystem is such that there has to be some appropriate entry for sata someplace in it.

I can't help you with mdadm; where I run RAID it is hardware raid using Adaptec SCSI controllers.
 
Old 08-21-2009, 05:30 PM   #8
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jiml8 View Post
take a look in /sys/class/scsi to see if you have anything.

I don't run sata here at all (All SCSI but for a handful of PATA) so I haven't encountered the particular problem.

The design and intentions of the /sys virtual filesystem is such that there has to be some appropriate entry for sata someplace in it.

I can't help you with mdadm; where I run RAID it is hardware raid using Adaptec SCSI controllers.

I don't have a /sys/class/scsi on this system, but there are several scsi directories. They're all empty.

webdev class # ls -lah scsi_*
scsi_changer:
total 0
drwxr-xr-x 2 root root 0 Dec 22 2008 .
drwxr-xr-x 37 root root 0 Dec 22 2008 ..

scsi_device:
total 0
drwxr-xr-x 2 root root 0 Dec 22 2008 .
drwxr-xr-x 37 root root 0 Dec 22 2008 ..

scsi_disk:
total 0
drwxr-xr-x 2 root root 0 Dec 22 2008 .
drwxr-xr-x 37 root root 0 Dec 22 2008 ..

scsi_generic:
total 0
drwxr-xr-x 2 root root 0 Dec 22 2008 .
drwxr-xr-x 37 root root 0 Dec 22 2008 ..

scsi_host:
total 0
drwxr-xr-x 2 root root 0 Dec 22 2008 .
drwxr-xr-x 37 root root 0 Dec 22 2008 ..

scsi_tape:
total 0
drwxr-xr-x 2 root root 0 Dec 22 2008 .
drwxr-xr-x 37 root root 0 Dec 22 2008 ..
*********************************************

I'm totally stumped.
 
Old 08-21-2009, 05:32 PM   #9
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Ubuntu, mostly.
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jiml8 View Post
take a look in /sys/class/scsi to see if you have anything.



I can't help you with mdadm; where I run RAID it is hardware raid using Adaptec SCSI controllers.
Yah, I much prefer hardware raid and use it for the systems I build.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recognize dead drive jay73 Linux - Hardware 2 06-19-2009 05:59 PM
VL 5.9 on laptop doesn't recognize CD drive LinuxLiker VectorLinux 1 03-24-2008 05:36 PM
My PC cant recognize cd drive? frankkky Linux - Hardware 1 07-03-2007 12:14 PM
Linux doesn't recognize my CD drive joshknape Linux - Hardware 2 02-17-2006 08:57 PM
gcombust doesn't want to recognize cd-r drive The MCP Linux - Software 2 06-05-2004 03:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration