Я использую Kubuntu с внешнего жесткого диска. На моем внутреннем жестком диске есть Windows. Я не хочу использовать его в Ubuntu и хочу отключить его, чтобы производить меньше тепла, а также расходовать меньше энергии. Я думаю, что вращение жесткого диска не вариант для меня. Потому что он изнашивает жесткий диск, и я не планирую тратить его на жесткие диски :)
sudo hdparm -Y /dev/sdX
где / dev / sdX - это устройство, которое вы хотите выключить. Вы также можете запустить sudo blkid
, чтобы определить «отпечаток пальца» (UUID) устройства, что позволит вам более надежно контролировать, какое устройство выключается.
В этом случае вы должны запустить:
sudo hdparm -Y /dev/disk/by-uuid/DEVICE-IDENT-HERE
-Y Force an IDE drive to immediately enter the lowest power
consumption sleep mode, causing it to shut down completely. A
hard or soft reset is required before the drive can be accessed
again (the Linux IDE driver will automatically handle issuing a
reset if/when needed). The current power mode status can be
checked using the -C option.
Вы можете использовать следующее (здесь sdc
- имя соответствующего интересующего блочного устройства):
sync
echo 1 > /sys/block/sdc/device/delete
или (от пользователя без полномочий root) :
sync
echo 1 | sudo tee /sys/block/sdc/device/delete
Вероятно, у вас установлен пакет udisks2
; вы можете использовать
udisksctl power-off -b /dev/sdX
, где / dev / sdX
- это устройство, которое вы хотите выключить.
Из udisksctl
справочной страницы (версия 2.7.6):
power-off
Arranges for the drive to be safely removed and powered off. On the OS
side this includes ensuring that no process is using the drive, then
requesting that in-flight buffers and caches are committed to stable
storage. The exact steps for powering off the drive depends on the
drive itself and the interconnect used. For drives connected through
USB, the effect is that the USB device will be deconfigured followed
by disabling the upstream hub port it is connected to.
Note that as some physical devices contain multiple drives (for
example 4-in-1 flash card reader USB devices) powering off one drive
may affect other drives. As such there are not a lot of guarantees
associated with performing this action. Usually the effect is that the
drive disappears as if it was unplugged.