Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   External hdd changing device node mid-use (http://www.linux-archive.org/debian-user/467662-external-hdd-changing-device-node-mid-use.html)

Panayiotis Karabassis 12-20-2010 06:15 AM

External hdd changing device node mid-use
 
I have an external usb 2.0 LG hard disk. It is part of an md array which
is in turn part of an lvm array. The strange thing is that while the
drive is in use, it will suddenly change device nodes, for example from
/dev/sda to /dev/sdb. This will cause the md driver to mark it as
faulty. This is very disruptive. Why is this happening and how to solve it?



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4D0F02AE.1090402@gmail.com">http://lists.debian.org/4D0F02AE.1090402@gmail.com

Juha Tuuna 12-20-2010 06:39 AM

External hdd changing device node mid-use
 
On 20.12.2010 9:15, Panayiotis Karabassis wrote:
> I have an external usb 2.0 LG hard disk. It is part of an md array which is in
> turn part of an lvm array. The strange thing is that while the drive is in
> use, it will suddenly change device nodes, for example from /dev/sda to
> /dev/sdb. This will cause the md driver to mark it as faulty. This is very
> disruptive. Why is this happening and how to solve it?
>
>

Difficult to say without access to the logs, maybe if you posted a piece of
your syslog and output of dmesg from around the moment the nodes changes. This
is a good place for long logs and stuff: http://pastebin.com/

--
Juha Tuuna


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4D0F0833.60505@iki.fi">http://lists.debian.org/4D0F0833.60505@iki.fi

Alex Mestiashvili 12-20-2010 08:44 AM

External hdd changing device node mid-use
 
Panayiotis Karabassis wrote:
I have an external usb 2.0 LG hard disk. It is part of an md array
which is in turn part of an lvm array. The strange thing is that while
the drive is in use, it will suddenly change device nodes, for example
from /dev/sda to /dev/sdb. This will cause the md driver to mark it as
faulty. This is very disruptive. Why is this happening and how to
solve it?



Might be it is better to write a special udev rule and name this usb
drive with some non-standard way


like /dev/usb_drive1 for example

for example these are the rules for 2x sas drives on my workstation


/etc/udev/rules.d/61-persistent-storage.rules

KERNEL=="sd?", SUBSYSTEM=="block" , ATTR{removable}=="0" ,
ENV{ID_BUS}=="scsi", ATTRS{vendor}=="HITACHI " SYMLINK+="sasdrive%n"


KERNEL=="sd?", SUBSYSTEM=="block" , ATTR{removable}=="0" ,
ENV{ID_BUS}=="scsi", ATTRS{vendor}=="FUJITSU " SYMLINK+="sasdrive2%n


so they appear as /dev/sasdrive
and /dev/sasdrive2


http://reactivated.net/writing_udev_rules.html

Regards ,
Alex


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4D0F257D.5040904@biotec.tu-dresden.de">http://lists.debian.org/4D0F257D.5040904@biotec.tu-dresden.de

Camaleón 12-20-2010 11:18 AM

External hdd changing device node mid-use
 
On Mon, 20 Dec 2010 09:15:58 +0200, Panayiotis Karabassis wrote:

> I have an external usb 2.0 LG hard disk. It is part of an md array which
> is in turn part of an lvm array. The strange thing is that while the
> drive is in use, it will suddenly change device nodes, for example from
> /dev/sda to /dev/sdb. This will cause the md driver to mark it as
> faulty. This is very disruptive. Why is this happening and how to solve
> it?

You should not trust anymore the old method for naming devices ("/dev/
sda...") as it can change at a random basis, but use persistent naming¹
(by-label, by-uuid², by-id, by-path) for your disks, even more with USB/
hot pluggable devices.

BTW, shouldn't lvm2 care about this automatically? :-?

¹ http://wiki.debian.org/Part-UUID
² AFAIK, this is the preferred/recommended method in Debian

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2010.12.20.12.18.22@gmail.com">http://lists.debian.org/pan.2010.12.20.12.18.22@gmail.com

Panayiotis Karabassis 12-21-2010 03:58 AM

External hdd changing device node mid-use
 
Thanks all. I tried toying with udev to create a persistent node name,
but to no avail. The problem seem to be that the hdd is periodically
disconnecting. By the time it has disconnected, it is too late. Md has
already faulted the device. If anyone has any ideas about preventing the
drive from disconnecting... I tried running sdparm in a cron job, as I
read somewhere, but it didn't work. I suspect it is disconnecting by
design, as this as an external usb-powered disk. It's model is LG HXD5
320GB if it helps.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4D10340F.6060606@gmail.com">http://lists.debian.org/4D10340F.6060606@gmail.com

Johann Spies 12-21-2010 05:35 AM

External hdd changing device node mid-use
 
On Tue, Dec 21, 2010 at 06:58:55AM +0200, Panayiotis Karabassis wrote:
> Thanks all. I tried toying with udev to create a persistent node name,
> but to no avail. The problem seem to be that the hdd is periodically
> disconnecting. By the time it has disconnected, it is too late. Md has
> already faulted the device. If anyone has any ideas about preventing the
> drive from disconnecting... I tried running sdparm in a cron job, as I
> read somewhere, but it didn't work. I suspect it is disconnecting by
> design, as this as an external usb-powered disk. It's model is LG HXD5
> 320GB if it helps.

It may be worth while checking your cable. Try it with another
USB-cable. I have had several bad cables in the past causing the drive
to be unmounted continually.

Regards
Johann
--
Johann Spies Telefoon: 021-808 4699
Databestuurder / Data manager

Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
Centre for Research on Evaluation, Science and Technology
Universiteit Stellenbosch.

"For unto us a child is born, unto us a son is given:
and the government shall be upon his shoulder: and his
name shall be called Wonderful, Counsellor, The mighty
God, The everlasting Father, The Prince of Peace."
Isaiah 9:6


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20101221063501.GB5606@sun.ac.za">http://lists.debian.org/20101221063501.GB5606@sun.ac.za

Panayiotis Karabassis 12-21-2010 06:29 AM

External hdd changing device node mid-use
 
Hmm, it seems to be a power issue. I had a usb hub connected to the same
bus and I disconnected it. Since then there have been no problems.


Regards,
Panayiotis


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4D105750.7060602@gmail.com">http://lists.debian.org/4D105750.7060602@gmail.com

Camaleón 12-21-2010 06:51 AM

External hdd changing device node mid-use
 
On Tue, 21 Dec 2010 06:58:55 +0200, Panayiotis Karabassis wrote:

> Thanks all. I tried toying with udev to create a persistent node name,
> but to no avail. The problem seem to be that the hdd is periodically
> disconnecting. By the time it has disconnected, it is too late. Md has
> already faulted the device. If anyone has any ideas about preventing the
> drive from disconnecting... I tried running sdparm in a cron job, as I
> read somewhere, but it didn't work. I suspect it is disconnecting by
> design, as this as an external usb-powered disk. It's model is LG HXD5
> 320GB if it helps.

I see here two possible causes for the random disconnects:

1/ USB hard disk has embedded in firmware a power management routine that
puts the drive into sleeping state if no actitivy is detected in a given
interval of time. But if the drive is inside an array, this shoud not
happen. Also, you are running a cron task with a job that should prevent
the device from going down :-?

2/ USB hard disk is not getting enough power. If it is being powered by
the USB port maybe this is not providing the required voltaje to the
device.

Another possibility is the USB cable, as Johann pointed out.

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2010.12.21.07.51.26@gmail.com">http://lists.debian.org/pan.2010.12.21.07.51.26@gmail.com

Panayiotis Karabassis 12-21-2010 01:37 PM

External hdd changing device node mid-use
 
2/ turned out to be the case.

Regards,
Panayiotis


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4D10BBA4.4070205@gmail.com">http://lists.debian.org/4D10BBA4.4070205@gmail.com

Jimmy Johnson 12-21-2010 06:54 PM

External hdd changing device node mid-use
 
Panayiotis Karabassis wrote:
Hmm, it seems to be a power issue. I had a usb hub connected to the same
bus and I disconnected it. Since then there have been no problems.


Regards,
Panayiotis



Best way to get persistent name for USB device is to use UUID and add it
to your fstab, 'blkid' as root (su) to get UUID.

--
Jimmy Johnson

Debian Squeeze Beta-2 - KDE 4.5.3 - EXT4 at sda7
Registered Linux User #380263


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4D1105DF.5070002@gmail.com">http://lists.debian.org/4D1105DF.5070002@gmail.com


All times are GMT. The time now is 01:59 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.