Re: [SLUG] hot swapping hard drives

2009-05-16 Thread Tony Sceats
On Sat, May 16, 2009 at 6:19 PM, Daniel Pittman  wrote:

> Tony Sceats  writes:
> >>> The CLI command "umount" does this within the Linux / Unix OS.
> >>
> >> That should have the filesystem flush data, but doesn't actually push
> >> out dirty pages for the device — if you accessed it raw at any point
> >> this will not be sufficient.
> >>
> >> (Also, lower layers such as LVM, software RAID, etc, might not flush
> >>  their data during the unmount process.)
> >>
> >>> The "sync" command/programming API call is another way to do this
> >>> programmatically.
> >>
> >> That will flush raw blocks from the device also.
> >>
> >>> That is all that is required.
> >>
> >> Those are necessary, but not sufficient, steps, I fear.
> >
> > so if our raw partitions are up-to-date and the file systems are also,
> > thanks to the 'sync' and 'umount' commands done before device removal,
> > what else are you implying would be necessary before the drive is
> > safely pulled?
>
> Didn't I already answer this in the text you cut?
>
> Your controller needs to support SATA hotplug sanely.  Your controller
> needs to report the event to the driver.  The driver needs to handle the
> event sanely.




o sorry :(  I had taken all that on board and I had just read it as though
you were alluding to more things being necessary even again, that's all.. in
fact it's precisely because I thought you'd had it all pretty well covered
that I was confused by that line..


anyway, classically wrong reading of language in an email, who would ever
have thought ;)
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] hot swapping hard drives

2009-05-16 Thread Daniel Pittman
Tony Sceats  writes:
>>> The CLI command "umount" does this within the Linux / Unix OS.
>>
>> That should have the filesystem flush data, but doesn't actually push
>> out dirty pages for the device — if you accessed it raw at any point
>> this will not be sufficient.
>>
>> (Also, lower layers such as LVM, software RAID, etc, might not flush
>>  their data during the unmount process.)
>>
>>> The "sync" command/programming API call is another way to do this
>>> programmatically.
>>
>> That will flush raw blocks from the device also.
>>
>>> That is all that is required.
>>
>> Those are necessary, but not sufficient, steps, I fear.
>
> so if our raw partitions are up-to-date and the file systems are also,
> thanks to the 'sync' and 'umount' commands done before device removal,
> what else are you implying would be necessary before the drive is
> safely pulled?

Didn't I already answer this in the text you cut?

Your controller needs to support SATA hotplug sanely.  Your controller
needs to report the event to the driver.  The driver needs to handle the
event sanely.

> (obviously I'm referring only to on the hot un-plug side, the hot-plug
> side obviously involves a different sequence of events, or is that
> what you're referring to with 'not sufficient'?)

No, I mean specifically that what you listed is necessary, but not
sufficient, to have function hot-unplug of SATA devices under Linux.

Regards,
Daniel
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: lshal, gnome-device-manager, was Re: [SLUG] hot swapping hard drives

2009-05-16 Thread Jeff Waugh


> lshal is PERFECT and I didn't know it existed. Much nicer than the gnome
> version. Having said that, why did Ubuntu take it out?

Given that it is only a diagnostic tool and serves no other purpose (and we
have lshal anyway), it lost out during one of the difficult "we have two
days until release and we need to shave 1MB off the ISO image" (or it won't
fit on a CD-ROM) discussions.

(From memory, that was just one release before g-d-m was rewritten in C and
had more useful device management functions added -> it's now much smaller!)

- Jeff

-- 
linux.conf.au 2010: Wellington, NZ   http://www.penguinsvisiting.org.nz/
 
 Broken hearts rarely come with "Some Assembly Required" stickers.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


lshal, gnome-device-manager, was Re: [SLUG] hot swapping hard drives

2009-05-16 Thread david

Thanks Jeremy,

lshal is PERFECT and I didn't know it existed. Much nicer than the gnome 
version. Having said that, why did Ubuntu take it out?


I now know that I have an
82801GB/GR/GH (ICH7 Family) SATA IDE Controller

which may help with the original question ;-)

David

Jeremy Visser wrote:

On Sat, 2009-05-16 at 13:49 +1000, david wrote:
While on the subject, Ubuntu used to have a convenient little applet that gave a 
list of installed hardware. It seems to have vanished. Does anyone know what it 
was called and whether it still exists?


It's called gnome-device-manager, which indeed is no longer installed by
default. There is, however, an eponymous package which will get it back
for you. (Unlike the one that used to be in Ubuntu, it puts itself in
Applications → System Tools → Device Manager.)

gnome-device-manager (which I almost abbreviated as 'gdm' just then) is
just a graphical frontend to HAL. You can get the exact same
information, albeit in text form, with the lshal utility.

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] hot swapping hard drives

2009-05-15 Thread Jeremy Visser
On Sat, 2009-05-16 at 13:49 +1000, david wrote:
> While on the subject, Ubuntu used to have a convenient little applet that 
> gave a 
> list of installed hardware. It seems to have vanished. Does anyone know what 
> it 
> was called and whether it still exists?

It's called gnome-device-manager, which indeed is no longer installed by
default. There is, however, an eponymous package which will get it back
for you. (Unlike the one that used to be in Ubuntu, it puts itself in
Applications → System Tools → Device Manager.)

gnome-device-manager (which I almost abbreviated as 'gdm' just then) is
just a graphical frontend to HAL. You can get the exact same
information, albeit in text form, with the lshal utility.


signature.asc
Description: This is a digitally signed message part
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Re: [SLUG] hot swapping hard drives

2009-05-15 Thread Tony Sceats
>
> > The CLI command "umount" does this within the Linux / Unix OS.
>
> That should have the filesystem flush data, but doesn't actually push
> out dirty pages for the device — if you accessed it raw at any point
> this will not be sufficient.
>
> (Also, lower layers such as LVM, software RAID, etc, might not flush
>  their data during the unmount process.)
>
> > The "sync" command/programming API call is another way to do this
> > programmatically.
>
> That will flush raw blocks from the device also.
>
> > That is all that is required.
>
> Those are necessary, but not sufficient, steps, I fear.



so if our raw partitions are up-to-date and the file systems are also,
thanks to the 'sync' and 'umount' commands done before device removal, what
else are you implying would be necessary before the drive is safely pulled?

(obviously I'm referring only to on the hot un-plug side, the hot-plug side
obviously involves a different sequence of events, or is that what you're
referring to with 'not sufficient'?)
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] hot swapping hard drives

2009-05-15 Thread Daniel Pittman
Adrian Chadd  writes:

> Uhm, I'm reasonably sure there's more to hot swap than the physical
> and electrical connections.

*nod*  You are quite correct here.

[...]

> There also may be a requirement for you to manually tell the OS
> to "detach" and "attach" disk devices.

This is no longer true: while you risk data corruption if there are
unwritten pages, it is "safe" to pull a SATA disk at any time on a
hotplug supporting controller.

In normal operation this makes no difference; when one of the disks in
your RAID array starts to fail and become unresponsive then knowing that
you can pull it without warning can save you (literally, in some cases)
hours of waiting for it to not-ever-get-through the sync process.

Regards,
Daniel
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] hot swapping hard drives

2009-05-15 Thread Daniel Pittman
Grahame Kelly  writes:

> Of the seven systems I look after, three have hot-swapping HDA's via a
> RAID5/6 drive enclosures, two systems have add-on SATAII caddies for
> hot-swap and the others are without hot-swapping.  If your interested,
> and to reset your angst a little, I have been in the
> computing/engineering industry for 25++ years.
>
> On the software level the OS only has to ensure that all dirty
> (written too) memory pages are written out to the drives and such
> buffering flushed, drive index tables updated and written ALL before
> the drive is removed.

That only handles the hot *UN*-plug side of things, and can cause
significant grief to you if the driver doesn't cope: anything from
several minutes in which *all* disks on that controller are unavailable
during error handling, through to a controller hang.

(Admittedly, the last is only on really bad hardware, but hey, that
 hardware is out there and still within the reasonable life of machines
 for home users.)

Anyway, once the hardware doesn't die completely you still need the
driver stack to notice and remove the now absent hardware from the
software "shadow" representation.

After all, you don't want /dev/sdb hanging about when the disk itself
has been removed, taking up a slot and making life miserable. :)

(Oh, and, of course, the hardware needs to be able to notify the driver
 that the device did actually go away, which not all hardware can.)

> The CLI command "umount" does this within the Linux / Unix OS.

That should have the filesystem flush data, but doesn't actually push
out dirty pages for the device — if you accessed it raw at any point
this will not be sufficient.

(Also, lower layers such as LVM, software RAID, etc, might not flush
 their data during the unmount process.)

> The "sync" command/programming API call is another way to do this
> programmatically.

That will flush raw blocks from the device also.

> That is all that is required.

Those are necessary, but not sufficient, steps, I fear.


Also, on the hotplug side, where a new device is added, your driver
needs to cope with detecting the device addition, probing it and
ensuring the hardware copes, and with reporting that up the software
stack.

> On the hardware side, the PSU socket must ensure that power is
> presented to the drive before logic is connected (ground first). This
> is why the +12v, +5v and GND pins are usually extended about 8mm
> before the rest of the pins are connected.

FWIW, SATA devices are hot-swap and the are ... a little less than 8mm
of coverage for those connections.  Just sayin'

Regards,
Daniel
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] hot swapping hard drives

2009-05-15 Thread Grahame Kelly

Hi Adrian, David & Slug list.

Of the seven systems I look after,  three have hot-swapping HDA's via  
a RAID5/6 drive enclosures, two systems have add-on SATAII caddies for  
hot-swap and the others are without hot-swapping.
If your interested, and to reset your angst a little, I have been in  
the computing/engineering industry for 25++ years.


On the software level the OS only has to ensure that all dirty  
(written too) memory pages are written out to the drives and such  
buffering flushed, drive index tables updated and written ALL before  
the drive is removed.  The CLI command "umount" does this within the  
Linux / Unix OS. The "sync" command/programming API call is another  
way to do this programmatically. That is all that is required.


On the hardware side, the PSU socket must ensure that power is  
presented to the drive before logic is connected (ground first). This  
is why the +12v, +5v and GND pins are usually extended about 8mm  
before the rest of the pins are connected. On the logic side, logic  
ground is the mandatory the first pin-out that is connected, together  
with any design "reset" or "set" pins.  Additionally, the ability of  
the PSU to cope with demanding surges especially on +12v, +5V lines is  
very important, as the switching regulator may be upset by such  
demands.  Most people wouldn't know this - that is why I mention it.


Of course, by all means - investigate and be satisfied your got all  
the facts, its your system that will have to "cope" with any hot- 
swapping PSU and logic levels.


Cheers. Grahame

On 16/05/2009, at 2:06 PM, Adrian Chadd wrote:


Uhm, I'm reasonably sure there's more to hot swap than the physical
and electrical connections.

I'd thus do a little more research on the topic (like reading the
datasheet(s) for your motherboard and SATA chipset) to ensure that
the hardware supports it.

There also may be a requirement for you to manually tell the OS
to "detach" and "attach" disk devices.




Adrian


On Sat, May 16, 2009, Grahame Kelly wrote:

Hi David.

As long as the drive in un-mounted you can safely remove/insert a
device.  You just need to make sure the drive Power connections allow
hot-swapping, but generally you will get away with it normally if you
haven't such PSU plug h/w. Just be aware that your PSU will require
better "surge" power - so if your current PSU is a bit iffy, it will
probably fail in time has been my experience.

Hope this helps.
Cheers. Grahame


From: david 
Date: 15 May 2009 11:58:14 PM
To: slug@slug.org.au
Subject: [SLUG] hot swapping hard drives


I've just installed a sata hard drive bay for a second drive, the
kind that has a little front door so you can slip the drive in and
out.

The point of installing it was to make it easy to change drives when
doing backups, but I had assumed that I would have to shut down
before taking the drive in or out.

When I unmount it, Gnome announces that I can now remove the media,
which surprised me a bit. Should I assume that this means I can
safely hot swap this drive as long as it's unmounted? The nice man
in the shop assured me that I needed all sorts of mobo magic to be
able to do that, but of course he was talking Windows. I would hate
to splat 500G of backup.

Thanks,

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


--
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial  
Squid Support -
- $25/pm entry-level VPSes w/ capped bandwidth charges available in  
WA -


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] hot swapping hard drives

2009-05-15 Thread Daniel Pittman
Luke Yelavich  writes:
> On Fri, May 15, 2009 at 11:58:14PM EST, david wrote:
>
>> I've just installed a sata hard drive bay for a second drive, the
>> kind that has a little front door so you can slip the drive in and
>> out.
>>
>> The point of installing it was to make it easy to change drives when
>> doing backups, but I had assumed that I would have to shut down
>> before taking the drive in or out.
>>
>> When I unmount it, Gnome announces that I can now remove the media,
>> which surprised me a bit.

It probably shouldn't.  Hot-swap is a standard SATA feature.

>> Should I assume that this means I can safely hot swap this drive as
>> long as it's unmounted?

Almost certainly.

>> The nice man in the shop assured me that I needed all sorts of mobo
>> magic to be able to do that, but of course he was talking Windows.

No, he was right: you do have to have a suitable "motherboard" (really,
SATA controller in the chipset), as well as a suitable driver, and a
suitable SATA enclosure.

It sounds like you have the last, most modern SATA controllers are
suitable for the first ... and the driver, well, are reasonable.

>> I would hate to splat 500G of backup.
>
> As far as I am aware, new SATA standards, such as AHCI, allow the hot
> plugging of drives/cables, in fact without AHCI, machines wouldn't be
> able to offer E-Sata ports.

That isn't quite right.  AHCI had /driver/ support, and exposed enough
hotplug information to the driver, that Linux got support for it early.

Other hardware might be supported; see here:
http://ata.wiki.kernel.org/index.php/SATA_hardware_features

If you do have an AHCI controller then, yes, it should be hotplug
suitable and just work(tm).


Meanwhile, eSATA is just a wiring standard on top of stock SATA, more or
less, so it doesn't have much to do with AHCI, or vice-versa.

[...]

> I am no expert on this stuff, but this is from what I've read and done
> with my own drives via E-Sata ports.

You were more or less on target. :)

Regards,
Daniel
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] hot swapping hard drives

2009-05-15 Thread Adrian Chadd
Uhm, I'm reasonably sure there's more to hot swap than the physical
and electrical connections.

I'd thus do a little more research on the topic (like reading the
datasheet(s) for your motherboard and SATA chipset) to ensure that
the hardware supports it.

There also may be a requirement for you to manually tell the OS
to "detach" and "attach" disk devices.




Adrian


On Sat, May 16, 2009, Grahame Kelly wrote:
> Hi David.
> 
> As long as the drive in un-mounted you can safely remove/insert a  
> device.  You just need to make sure the drive Power connections allow  
> hot-swapping, but generally you will get away with it normally if you  
> haven't such PSU plug h/w. Just be aware that your PSU will require  
> better "surge" power - so if your current PSU is a bit iffy, it will  
> probably fail in time has been my experience.
> 
> Hope this helps.
> Cheers. Grahame
> 
> >From: david 
> >Date: 15 May 2009 11:58:14 PM
> >To: slug@slug.org.au
> >Subject: [SLUG] hot swapping hard drives
> >
> >
> >I've just installed a sata hard drive bay for a second drive, the  
> >kind that has a little front door so you can slip the drive in and  
> >out.
> >
> >The point of installing it was to make it easy to change drives when  
> >doing backups, but I had assumed that I would have to shut down  
> >before taking the drive in or out.
> >
> >When I unmount it, Gnome announces that I can now remove the media,  
> >which surprised me a bit. Should I assume that this means I can  
> >safely hot swap this drive as long as it's unmounted? The nice man  
> >in the shop assured me that I needed all sorts of mobo magic to be  
> >able to do that, but of course he was talking Windows. I would hate  
> >to splat 500G of backup.
> >
> >Thanks,
> -- 
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

-- 
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -
- $25/pm entry-level VPSes w/ capped bandwidth charges available in WA -
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] hot swapping hard drives

2009-05-15 Thread Grahame Kelly

Hi David.

As long as the drive in un-mounted you can safely remove/insert a  
device.  You just need to make sure the drive Power connections allow  
hot-swapping, but generally you will get away with it normally if you  
haven't such PSU plug h/w. Just be aware that your PSU will require  
better "surge" power - so if your current PSU is a bit iffy, it will  
probably fail in time has been my experience.


Hope this helps.
Cheers. Grahame


From: david 
Date: 15 May 2009 11:58:14 PM
To: slug@slug.org.au
Subject: [SLUG] hot swapping hard drives


I've just installed a sata hard drive bay for a second drive, the  
kind that has a little front door so you can slip the drive in and  
out.


The point of installing it was to make it easy to change drives when  
doing backups, but I had assumed that I would have to shut down  
before taking the drive in or out.


When I unmount it, Gnome announces that I can now remove the media,  
which surprised me a bit. Should I assume that this means I can  
safely hot swap this drive as long as it's unmounted? The nice man  
in the shop assured me that I needed all sorts of mobo magic to be  
able to do that, but of course he was talking Windows. I would hate  
to splat 500G of backup.


Thanks,

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] hot swapping hard drives

2009-05-15 Thread david



Luke Yelavich wrote:

On Fri, May 15, 2009 at 11:58:14PM EST, david wrote:
I've just installed a sata hard drive bay for a second drive, the kind 
that has a little front door so you can slip the drive in and out.


The point of installing it was to make it easy to change drives when 
doing backups, but I had assumed that I would have to shut down before 
taking the drive in or out.


When I unmount it, Gnome announces that I can now remove the media, which 
surprised me a bit. Should I assume that this means I can safely hot swap 
this drive as long as it's unmounted? The nice man in the shop assured me 
that I needed all sorts of mobo magic to be able to do that, but of 
course he was talking Windows. I would hate to splat 500G of backup.


As far as I am aware, new SATA standards, such as AHCI, allow the hot 
plugging of drives/cables, in fact without AHCI, machines wouldn't be able to 
offer E-Sata ports.


I would check the type of connection for the drive and the rack that you 

mount it in. Since its new, I'd say it will be SATA, however you will have
to find out whether the rack itself supports hot-plugging of drives, due to
how the power to the drive is managed, as well as whether the controller on
the motherboard supports AHCI, and if so, whether its running in AHCI mode.




It's certainly a SATA drive and connection.

I don't know how to check if the drive bay  or my system supports AHCI. It's a 
Vantec MRK-100ST-BK and the only info I can find says "Device supports SATA 
I/II, internal interface SATA I/II requires Windows  98SE --> Vista, or MacOS, 
requires SATA equipped system." Nothing about AHCI. Nothing about hot swapping. 
Google gives me plenty of places to buy it, but no hard information. There is a 
vantec website but this product isn't listed, although a later model is listed :(


While on the subject, Ubuntu used to have a convenient little applet that gave a 
list of installed hardware. It seems to have vanished. Does anyone know what it 
was called and whether it still exists?

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] hot swapping hard drives

2009-05-15 Thread Luke Yelavich
On Fri, May 15, 2009 at 11:58:14PM EST, david wrote:
> I've just installed a sata hard drive bay for a second drive, the kind 
> that has a little front door so you can slip the drive in and out.
>
> The point of installing it was to make it easy to change drives when 
> doing backups, but I had assumed that I would have to shut down before 
> taking the drive in or out.
>
> When I unmount it, Gnome announces that I can now remove the media, which 
> surprised me a bit. Should I assume that this means I can safely hot swap 
> this drive as long as it's unmounted? The nice man in the shop assured me 
> that I needed all sorts of mobo magic to be able to do that, but of 
> course he was talking Windows. I would hate to splat 500G of backup.

As far as I am aware, new SATA standards, such as AHCI, allow the hot plugging 
of drives/cables, in fact without AHCI, machines wouldn't be able to offer 
E-Sata ports.

I would check the type of connection for the drive and the rack that you mount 
it in. Since its new, I'd say it will be SATA, however you will have to find 
out whether the rack itself supports hot-plugging of drives, due to how the 
power to the drive is managed, as well as whether the controller on the 
motherboard supports AHCI, and if so, whether its running in AHCI mode.

I am no expert on this stuff, but this is from what I've read and done with my 
own drives via E-Sata ports.

Hope this helps

Luke
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] hot swapping hard drives

2009-05-15 Thread david
I've just installed a sata hard drive bay for a second drive, the kind that has 
a little front door so you can slip the drive in and out.


The point of installing it was to make it easy to change drives when doing 
backups, but I had assumed that I would have to shut down before taking the 
drive in or out.


When I unmount it, Gnome announces that I can now remove the media, which 
surprised me a bit. Should I assume that this means I can safely hot swap this 
drive as long as it's unmounted? The nice man in the shop assured me that I 
needed all sorts of mobo magic to be able to do that, but of course he was 
talking Windows. I would hate to splat 500G of backup.


Thanks,

David.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html