NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Stopping USB HDD



riza.dindir%gmail.com@localhost (Riza Dindir) writes:

>I will not be using poweroff but use shutdown. I think this is the
>proper way of stopping the system.

The proper way would be 'shutdown -p', but poweroff finally does the
same.

In any case, there should be no difference for USB drives. While
ATA drives are spun down on poweroff (but not on halt), SCSI drives
(USB drives are seen as SCSI) are not. And many portable USB drives
just ignore such details.


>This drive has the main NetBSD OS in it (I will be explaining the
>reason for that below). Would that be a problem? I am thinking when
>you shutdown, the system will unmount everything and then wait for the
>user to reset or power down the system, no matter what. Would that
>assumption be correct?

With 'halt' that's what happens. With 'poweroff' the firmware
(ACPI in this case) is asked to power down the system.




>> 1. Unmount it.
>> 2. Sleep it.
>> 3. Power off the system.
>>
>> You could achieve this with a script.

>Yes, I was thinking the same, writing a script for that, in the rc
>system (probably). But I'm not sure yet, reading the guide, and the rc
>system architecture. The drive might be a scsi drive, or seen as a
>scsi drive. I will have to check the dmesg.

The biggest problem will be unmounting. You cannot unmount the root
partition. This is done by the kernel on halt or poweroff, but then
you cannot run any scripts.

Since USB drives are seen as SCSI 'atactl' might not work, it knows
how to pass through ATA commands, but if and how that works depends
on your enclosure. The equivalent for SCSI is something like
'scsictl sdX stop'. But, being the system disk, the next access will
spin it up again.

You can try 'scsictl sdX stop' to see if that generates the same noise.
In that case, the noise is probably caused by spinning down and
retracting the heads.



Home | Main Index | Thread Index | Old Index