Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hd-idle not starting on Ubuntu 20.4.01 #37

Closed
cannondale0815 opened this issue Dec 5, 2020 · 7 comments
Closed

hd-idle not starting on Ubuntu 20.4.01 #37

cannondale0815 opened this issue Dec 5, 2020 · 7 comments

Comments

@cannondale0815
Copy link

cannondale0815 commented Dec 5, 2020

I tried installing the latest 1.11 amd64 package on Ubuntu 20.04.1 LTS. No matter which command line option I choose, even when I just use -h, it only prints the following and then hangs:

symlinkPolicy=0, defaultIdle=600, defaultCommand=scsi, debug=false, logFile=, devices=

I previously had the original hd-idle from C. Mueller installed on my system (built from source). Before installing this new version of hd-idle, I made sure to remove the old binary to ensure there are no conflicts, but unsure if there are any other residual files that may cause issues on my end.

I also tried building this version of hd-idle from source but having the same issue above still. I can confirm that on my system, /proc/diskstats is present.

Would love to use this version of hd-idle on my Ubuntu system, but am stuck. Any help is appreciated :)

@adelolmo
Copy link
Owner

adelolmo commented Dec 5, 2020

Hi @cannondale0815

I'm not sure what you mean by "hangs". hd-idle runs in the background.

Could you please share the results of the following commands?

  • ls /dev/s*
  • tree /dev/disk/
  • cat /etc/default/hd-idle

@cannondale0815
Copy link
Author

cannondale0815 commented Dec 5, 2020

@adelolmo by hangs, I mean it outputs that one line I mentioned above and doesn't return to the command prompt.

Here is the output of the commands you requested:

1)

/dev/sda   /dev/sdb2  /dev/sde   /dev/sdg1  /dev/sdj   /dev/sdl1  /dev/sdo   /dev/sdq1  /dev/sg12  /dev/sg2  /dev/sg7       /dev/stdin
/dev/sda1  /dev/sdc   /dev/sde1  /dev/sdh   /dev/sdj1  /dev/sdm   /dev/sdo1  /dev/sg0   /dev/sg13  /dev/sg3  /dev/sg8       /dev/stdout
/dev/sda2  /dev/sdc1  /dev/sdf   /dev/sdh1  /dev/sdk   /dev/sdm1  /dev/sdp   /dev/sg1   /dev/sg14  /dev/sg4  /dev/sg9
/dev/sdb   /dev/sdd   /dev/sdf1  /dev/sdi   /dev/sdk1  /dev/sdn   /dev/sdp1  /dev/sg10  /dev/sg15  /dev/sg5  /dev/snapshot
/dev/sdb1  /dev/sdd1  /dev/sdg   /dev/sdi1  /dev/sdl   /dev/sdn1  /dev/sdq   /dev/sg11  /dev/sg16  /dev/sg6  /dev/stderr

/dev/serial:
by-id  by-path

/dev/shm:
sem.9334581e-7251-4ef7-a8ec-5bfe8e89ff68  sem.F8EEB26D-AB23-4061-8250-130AB5285A4A

/dev/snd:
by-path  controlC0  hwC0D3  pcmC0D3p  pcmC0D7p  seq  timer

2)

/dev/disk
├── by-id
│   ├── ata-SAMSUNG_MZNLF128HCHP-00000_S28TNXAH209310 -> ../../sdn
│   ├── ata-SAMSUNG_MZNLF128HCHP-00000_S28TNXAH209310-part1 -> ../../sdn1
│   ├── ata-Samsung_SSD_840_EVO_250GB_S1DBNSAF354840P -> ../../sdb
│   ├── ata-Samsung_SSD_840_EVO_250GB_S1DBNSAF354840P-part1 -> ../../sdb1
│   ├── ata-Samsung_SSD_840_EVO_250GB_S1DBNSAF354840P-part2 -> ../../sdb2
│   ├── ata-Samsung_SSD_850_EVO_250GB_S3PZNF0JB05079T -> ../../sda
│   ├── ata-Samsung_SSD_850_EVO_250GB_S3PZNF0JB05079T-part1 -> ../../sda1
│   ├── ata-Samsung_SSD_850_EVO_250GB_S3PZNF0JB05079T-part2 -> ../../sda2
│   ├── ata-ST4000VN000-1H4168_Z300P70F -> ../../sdc
│   ├── ata-ST4000VN000-1H4168_Z300P70F-part1 -> ../../sdc1
│   ├── ata-ST4000VN000-1H4168_Z300TE47 -> ../../sdj
│   ├── ata-ST4000VN000-1H4168_Z300TE47-part1 -> ../../sdj1
│   ├── ata-ST4000VN000-1H4168_Z30135GV -> ../../sdi
│   ├── ata-ST4000VN000-1H4168_Z30135GV-part1 -> ../../sdi1
│   ├── ata-ST4000VN000-1H4168_Z301395T -> ../../sdk
│   ├── ata-ST4000VN000-1H4168_Z301395T-part1 -> ../../sdk1
│   ├── ata-ST4000VN000-1H4168_Z30139FG -> ../../sdh
│   ├── ata-ST4000VN000-1H4168_Z30139FG-part1 -> ../../sdh1
│   ├── ata-ST4000VN000-1H4168_Z30147EP -> ../../sdg
│   ├── ata-ST4000VN000-1H4168_Z30147EP-part1 -> ../../sdg1
│   ├── ata-ST4000VN008-2DR166_WDH1B545 -> ../../sdq
│   ├── ata-ST4000VN008-2DR166_WDH1B545-part1 -> ../../sdq1
│   ├── ata-TOSHIBA_HDWQ140_579IK0C3FPBE -> ../../sdl
│   ├── ata-TOSHIBA_HDWQ140_579IK0C3FPBE-part1 -> ../../sdl1
│   ├── ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E2XTY3KS -> ../../sde
│   ├── ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E2XTY3KS-part1 -> ../../sde1
│   ├── ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E3KZD3P1 -> ../../sdm
│   ├── ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E3KZD3P1-part1 -> ../../sdm1
│   ├── ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E3KZD5ZE -> ../../sdf
│   ├── ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E3KZD5ZE-part1 -> ../../sdf1
│   ├── ata-WDC_WD80EMAZ-00WJTA0_7HK2SSBN -> ../../sdo
│   ├── ata-WDC_WD80EMAZ-00WJTA0_7HK2SSBN-part1 -> ../../sdo1
│   ├── ata-WDC_WD80EMAZ-00WJTA0_7HK8WGVN -> ../../sdd
│   ├── ata-WDC_WD80EMAZ-00WJTA0_7HK8WGVN-part1 -> ../../sdd1
│   ├── ata-WDC_WD80EMAZ-00WJTA0_7HKAGDGN -> ../../sdp
│   ├── ata-WDC_WD80EMAZ-00WJTA0_7HKAGDGN-part1 -> ../../sdp1
│   ├── md-name-NAS:0 -> ../../md0
│   ├── md-uuid-b93d3ef7:3a319f4f:e5f862b9:4d980338 -> ../../md0
│   ├── wwn-0x50000397cbf809a9 -> ../../sdl
│   ├── wwn-0x50000397cbf809a9-part1 -> ../../sdl1
│   ├── wwn-0x5000c500641aa140 -> ../../sdc
│   ├── wwn-0x5000c500641aa140-part1 -> ../../sdc1
│   ├── wwn-0x5000c50064aaa8c2 -> ../../sdj
│   ├── wwn-0x5000c50064aaa8c2-part1 -> ../../sdj1
│   ├── wwn-0x5000c50065404633 -> ../../sdi
│   ├── wwn-0x5000c50065404633-part1 -> ../../sdi1
│   ├── wwn-0x5000c5006545175f -> ../../sdk
│   ├── wwn-0x5000c5006545175f-part1 -> ../../sdk1
│   ├── wwn-0x5000c500654529d0 -> ../../sdh
│   ├── wwn-0x5000c500654529d0-part1 -> ../../sdh1
│   ├── wwn-0x5000c500654f1939 -> ../../sdg
│   ├── wwn-0x5000c500654f1939-part1 -> ../../sdg1
│   ├── wwn-0x5000c5009de1c1b1 -> ../../sdq
│   ├── wwn-0x5000c5009de1c1b1-part1 -> ../../sdq1
│   ├── wwn-0x5000cca257eb886c -> ../../sdo
│   ├── wwn-0x5000cca257eb886c-part1 -> ../../sdo1
│   ├── wwn-0x5000cca257ee50a2 -> ../../sdd
│   ├── wwn-0x5000cca257ee50a2-part1 -> ../../sdd1
│   ├── wwn-0x5000cca257ef0849 -> ../../sdp
│   ├── wwn-0x5000cca257ef0849-part1 -> ../../sdp1
│   ├── wwn-0x50014ee20b3b4bd8 -> ../../sdf
│   ├── wwn-0x50014ee20b3b4bd8-part1 -> ../../sdf1
│   ├── wwn-0x50014ee20b3b7b1f -> ../../sdm
│   ├── wwn-0x50014ee20b3b7b1f-part1 -> ../../sdm1
│   ├── wwn-0x50014ee260908dbd -> ../../sde
│   ├── wwn-0x50014ee260908dbd-part1 -> ../../sde1
│   ├── wwn-0x50025387401a12be -> ../../sdn
│   ├── wwn-0x50025387401a12be-part1 -> ../../sdn1
│   ├── wwn-0x50025388a02af659 -> ../../sdb
│   ├── wwn-0x50025388a02af659-part1 -> ../../sdb1
│   ├── wwn-0x50025388a02af659-part2 -> ../../sdb2
│   ├── wwn-0x5002538d426c4e5c -> ../../sda
│   ├── wwn-0x5002538d426c4e5c-part1 -> ../../sda1
│   └── wwn-0x5002538d426c4e5c-part2 -> ../../sda2
├── by-label
│   ├── Disk1 -> ../../sdh1
│   ├── Disk2 -> ../../sdg1
│   ├── Disk3 -> ../../sdi1
│   ├── Disk4 -> ../../sdj1
│   ├── Disk5.1 -> ../../sdm1
│   ├── Disk6.1 -> ../../sdk1
│   ├── Disk7.1 -> ../../sdl1
│   ├── Disk8.1 -> ../../sde1
│   ├── Disk9 -> ../../sdf1
│   ├── DiskP1 -> ../../sdd1
│   ├── DiskP2 -> ../../sdp1
│   ├── DiskUnpooled -> ../../sdq1
│   ├── PlexData -> ../../sdn1
│   ├── Spare11_New8TB -> ../../sdo1
│   └── Spare12_OldP2 -> ../../sdc1
├── by-partlabel
│   └── Basic\x20data\x20partition -> ../../sdo1
├── by-partuuid
│   ├── 000ae10c-01 -> ../../sda1
│   ├── 000ae10c-02 -> ../../sda2
│   ├── 091e1532-b5a8-4692-8538-96b2c71947d5 -> ../../sde1
│   ├── 25dfcf71-78d5-4068-812e-54753a4f8e2d -> ../../sdk1
│   ├── 51d91771-afb4-4cb0-9147-044b0c468fb4 -> ../../sdm1
│   ├── 8a94f938-7e99-47f4-9632-3977f061445c -> ../../sdo1
│   ├── a1c90eae-0d93-40f1-8f27-e54b19d1b5d7 -> ../../sdp1
│   ├── a256216d-f7a8-4c14-8e96-6506da95e977 -> ../../sdf1
│   ├── a649d6d2-1dde-43ff-acf4-4e8238a7e6a3 -> ../../sdg1
│   ├── a784eaff-6e4b-45df-98d4-20a57f8f1973 -> ../../sdj1
│   ├── c0b40938-90ff-4591-bf21-75cd42fcebc6 -> ../../sdl1
│   ├── c80d0713-192c-4251-b6eb-04eb251c99f0 -> ../../sdi1
│   ├── f0e93e1b-b7f8-467d-83e9-d62f21bd78c5 -> ../../sdh1
│   ├── f89edd41-4da5-4aa7-9b5e-59bd1a60d3d1 -> ../../sdd1
│   ├── f8a7a7c1-f129-462e-bd68-fbae609f7c8c -> ../../sdq1
│   ├── fb747a6f-e680-47d0-b195-8acb3e99e3e7 -> ../../sdn1
│   └── fdee6c71-27b7-4524-a293-bc20c35d73ba -> ../../sdc1
├── by-path
│   ├── pci-0000:00:1f.2-ata-1 -> ../../sda
│   ├── pci-0000:00:1f.2-ata-1-part1 -> ../../sda1
│   ├── pci-0000:00:1f.2-ata-1-part2 -> ../../sda2
│   ├── pci-0000:00:1f.2-ata-2 -> ../../sdb
│   ├── pci-0000:00:1f.2-ata-2-part1 -> ../../sdb1
│   ├── pci-0000:00:1f.2-ata-2-part2 -> ../../sdb2
│   ├── pci-0000:00:1f.2-ata-3 -> ../../sdc
│   ├── pci-0000:00:1f.2-ata-3-part1 -> ../../sdc1
│   ├── pci-0000:00:1f.2-ata-4 -> ../../sdd
│   ├── pci-0000:00:1f.2-ata-4-part1 -> ../../sdd1
│   ├── pci-0000:00:1f.2-ata-5 -> ../../sde
│   ├── pci-0000:00:1f.2-ata-5-part1 -> ../../sde1
│   ├── pci-0000:00:1f.2-ata-6 -> ../../sdf
│   ├── pci-0000:00:1f.2-ata-6-part1 -> ../../sdf1
│   ├── pci-0000:01:00.0-ata-1 -> ../../sdg
│   ├── pci-0000:01:00.0-ata-1-part1 -> ../../sdg1
│   ├── pci-0000:01:00.0-ata-2 -> ../../sdh
│   ├── pci-0000:01:00.0-ata-2-part1 -> ../../sdh1
│   ├── pci-0000:01:00.0-ata-3 -> ../../sdi
│   ├── pci-0000:01:00.0-ata-3-part1 -> ../../sdi1
│   ├── pci-0000:01:00.0-ata-4 -> ../../sdj
│   ├── pci-0000:01:00.0-ata-4-part1 -> ../../sdj1
│   ├── pci-0000:02:00.0-ata-1 -> ../../sdk
│   ├── pci-0000:02:00.0-ata-1-part1 -> ../../sdk1
│   ├── pci-0000:02:00.0-ata-2 -> ../../sdl
│   ├── pci-0000:02:00.0-ata-2-part1 -> ../../sdl1
│   ├── pci-0000:02:00.0-ata-4 -> ../../sdm
│   ├── pci-0000:02:00.0-ata-4-part1 -> ../../sdm1
│   ├── pci-0000:03:00.0-ata-1 -> ../../sdn
│   ├── pci-0000:03:00.0-ata-1-part1 -> ../../sdn1
│   ├── pci-0000:03:00.0-ata-2 -> ../../sdo
│   ├── pci-0000:03:00.0-ata-2-part1 -> ../../sdo1
│   ├── pci-0000:03:00.0-ata-3 -> ../../sdp
│   ├── pci-0000:03:00.0-ata-3-part1 -> ../../sdp1
│   ├── pci-0000:03:00.0-ata-4 -> ../../sdq
│   └── pci-0000:03:00.0-ata-4-part1 -> ../../sdq1
└── by-uuid
    ├── 09b80de6-f621-4af8-b447-bc9e1b465d5e -> ../../sdg1
    ├── 2fd4d284-00a7-44dc-8ad7-701ee5e6fa31 -> ../../sdi1
    ├── 47710f43-cf4e-4576-81c5-2fc64181b271 -> ../../sdk1
    ├── 4d6d2542-17a2-4fbf-8673-27f8968de394 -> ../../sde1
    ├── 5d9833c2-f83d-451a-bda9-02a585ca3a23 -> ../../sdf1
    ├── 6a69193c-4641-4579-8690-92d6006a5166 -> ../../sdd1
    ├── 6ad9aa74-15a7-436d-83b6-fc537f62866e -> ../../sda2
    ├── 6e403ee0-3655-42ef-b840-eea5b0835421 -> ../../sdc1
    ├── 7020779c-6b0b-4400-b0f3-11965be1e785 -> ../../sdb2
    ├── 809EFCA59EFC94BE -> ../../sdo1
    ├── 922074af-0bcf-4d46-be15-880c81f37f2b -> ../../sdm1
    ├── a2f71a39-eb00-45ff-8880-fc5198dd5b1f -> ../../sdq1
    ├── ad2dd5be-cfc6-470e-9eb2-a4ccec5f03fe -> ../../sdh1
    ├── b0ad6cd5-8d98-4070-b125-b2dd119d04ec -> ../../md0
    ├── ba32a932-3626-4896-91aa-e17cb574a1a0 -> ../../sdp1
    ├── c5c0e903-31a4-4b6b-835e-0b39f8ce5bad -> ../../sdn1
    ├── cac074ae-af8e-4243-ae86-98feb5e739a0 -> ../../sdj1
    └── ff423396-2a59-41cc-849f-c5e2a5892a16 -> ../../sdl1

6 directories, 161 files

3)

# defaults file for hd-idle

# start hd-idle automatically?
START_HD_IDLE=false

# hd-idle command line options
# Options are:
#  -a <name>               Set device name of disks for subsequent idle-time
#                          parameters (-i). This parameter is optional in the
#                          sense that there's a default entry for all disks
#                          which are not named otherwise by using this
#                          parameter. This can also be a symlink
#                          (e.g. /dev/disk/by-uuid/...)
#  -i <idle_time>          Idle time in seconds.
#  -c <command_type>       Api call to stop the device. Possible values are "scsi"
#                          (default value) and "ata".
#  -s symlink_policy       Set the policy to resolve symlinks for devices.
#                          If set to "0", symlinks are resolve only on start.
#                          If set to "1", symlinks are also resolved on runtime
#                          until success. By default symlinks are only resolve on start.
#                          If the symlink doesn't resolve to a device, the default
#                          configuration will be applied.
#  -l <logfile>            Name of logfile (written only after a disk has spun
#                          up). Please note that this option might cause the
#                          disk which holds the logfile to spin up just because
#                          another disk had some activity. This option should
#                          not be used on systems with more than one disk
#                          except for tuning purposes. On single-disk systems,
#                          this option should not cause any additional spinups.
#
# Options not exactly useful here:
#  -t <disk>               Spin-down the specified disk immediately and exit.
#  -d                      Debug mode. It will print debugging info to
#                          stdout/stderr (/var/log/syslog if started as with systemctl)
#  -h                      Print usage information.

@adelolmo
Copy link
Owner

adelolmo commented Dec 5, 2020

@cannondale0815

by hangs, I mean it outputs that one line I mentioned above and doesn't return to the command prompt

I suggest you have a look to the section Run hd-idle in the README. Specially the part that mentions If the Debian package was installed.

Also, your configuration in /etc/default/hd-idle is missing the entry HD_IDLE_OPTS. Please check the configuration section. This is the original /etc/default/hd-idle content in case you need it.

@cannondale0815
Copy link
Author

cannondale0815 commented Dec 5, 2020

@cannondale0815
I suggest you have a look to the section Run hd-idle in the README. Specially the part that mentions If the Debian package was installed.

Also, your configuration in /etc/default/hd-idle is missing the entry HD_IDLE_OPTS. Please check the configuration section. This is the original /etc/default/hd-idle content in case you need it.

@adelolmo For now, I am just trying to run it on the command line, not as a service, And when I just say hd-idle -h, it only shows:

user@NAS:~$ sudo /usr/sbin/hd-idle -h
symlinkPolicy=0, defaultIdle=600, defaultCommand=scsi, debug=false, logFile=, devices=

And doesn't return (I have to Ctrl+C to get back to prompt). Am I misunderstanding how this version of hd-idle has changed from the original one? That one, I could just invoke from the command line.

For comparison, this is what the older version (from C Mueller) shows:

user@NAS:~$ sudo /usr/local/sbin/hd-idle -h
usage: hd-idle [-t <disk>] [-a <name>] [-i <idle_time>] [-l <logfile>] [-d] [-h]

@adelolmo
Copy link
Owner

adelolmo commented Dec 5, 2020

Am I misunderstanding how this version of hd-idle has changed from the original one? That one, I could just invoke from the command line.

It depends on what's you expectation here. What are you trying to achieve?

hd-idle works like a service: it's started and it runs until stopped.
The only usecase that returns to the prompt is when invoked with the flag -t to spin down a single disk.

As a side note: I noticed a bug invoking help via -h flag. I'll fix it in the next release.

@cannondale0815
Copy link
Author

cannondale0815 commented Dec 5, 2020

Ah -- I guess that may explain it. Since I have been using the old hd-idle for a few years, I was stuck thinking I could just invoke your version the same way on the command line. And the first thing I always do is to have a program print its own help screen to familiarize myself with it. So let me go ahead and configure it to run as a service and if I run into any issues, I'll report back -- thank you!

@cannondale0815
Copy link
Author

I set it up to run as a service with systemctl and it works great, so thank you for the explanations above, I appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants