2015-03-30 3 views
-2

У меня есть внешний жесткий диск для резервного копирования, который подключается через USB с моим Linux-компьютером. Поскольку hdparm не работает, я попытался свернуть диск с sudo sdparm -C stop /dev/sdf1. Как я могу узнать, действительно ли диск спит?информация о состоянии жесткого диска с sdparm

+0

это относится к [su]. –

+0

Я обновляю команду до sudo – Harald

+0

нет - для этого вопроса есть лучший сайт для стека. –

ответ

0

Если вы не хотите использовать hdparm, вы также можете использовать smartctl для сбора этой информации.

Для того, чтобы сделать это, вы могли бы запустить что-то вроде:

sudo smartctl -a -n sleep /dev/sda 

Вы в основном заинтересованы в -n аргумент, который содержит следующую документацию.

-n POWERMODE, --nocheck=POWERMODE 
      [ATA only] Specifies if smartctl should exit before performing any checks when the device is in a low-power mode. It may be used to prevent 
      a disk from being spun-up by smartctl. The power mode is ignored by default. A nonzero exit status is returned if the device is in one of 
      the specified low-power modes (see RETURN VALUES below). 

      Note: If this option is used it may also be necessary to specify the device type with the ´-d´ option. Otherwise the device may spin up due 
      to commands issued during device type autodetection. 

      The valid arguments to this option are: 

      never - check the device always, but print the power mode if ´-i´ is specified. 

      sleep - check the device unless it is in SLEEP mode. 

      standby - check the device unless it is in SLEEP or STANDBY mode. In these modes most disks are not spinning, so if you want to prevent a 
      disk from spinning up, this is probably what you want. 

      idle - check the device unless it is in SLEEP, STANDBY or IDLE mode. In the IDLE state, most disks are still spinning, so this is probably 
      not what you want. 
+0

Не могли бы вы дать мне команду smartctl? Было бы неплохо;) – Harald

+0

Просто улучшил ответ. –

Смежные вопросы