> command “sg_start --stop /dev/sdX” really spin-downs my drive (sometimes
> on 2nd or 3rd attempt - I don’t know why), device remains in system and
> spin-up again only on my demand.
Btw, this is because the sg_start command opens the device node with O_RDWR which causes an uevent 'change' event to fire when the command completes. This in turn causes udev rules to fire which accesses the disk which causes it to spin up again. In the patch I committed to udisks to do this, we use O_RDONLY to avoid this.
> command “sg_start --stop /dev/sdX” really spin-downs my drive (sometimes
> on 2nd or 3rd attempt - I don’t know why), device remains in system and
> spin-up again only on my demand.
Btw, this is because the sg_start command opens the device node with O_RDWR which causes an uevent 'change' event to fire when the command completes. This in turn causes udev rules to fire which accesses the disk which causes it to spin up again. In the patch I committed to udisks to do this, we use O_RDONLY to avoid this.