I have followed the manual of hdparm to try to make the drive spindown after a few minutes of inactivity but as soon as it spins down it turns back on again within 30 seconds but I don't hear any disk activity. Someone reported a bug with hdparm parameters here:
https://unix.stackexchange.com/questions/107165/hard-disk-spins-down-and-up-too-frequently-when-on-battery
So I was trying different values. I notice this setting:
hdparm -q -a 1 -B 128 -S 120 /dev/sda
...causes the hard drive to go slower as if it sometimes powers down then immediately powers up before completely powering down (so like tiny knocks).
Apparently this command fixes that yet keeps the drive always on even when I never touch the computer:
hdparm -q -a 1 -B 255 -S 120 /dev/sda
So I looked to see what could be doing IO at idle times and noticed a kworker thread doing it every second or so. I'm not sure if the udisk, upowerd, or udev are the cause behind this.
I have also made a ram drive (dev/ramX) and stored frequently accessed files there so that I/O to disk is minimized.
I don't know if I'm using ideal settings in my sysctl settings but these are the values I have:
for the /proc/sys/vm folder:
admin_reserve_kbytes=8192
block_dump=0
compact_unevictable_allowed=1
dirty_background_bytes=0
dirty_background_ratio=54
dirty_bytes=0
dirty_expire_centisecs=10
dirty_ratio=55
dirty_writeback_centisecs=300
dirtytime_expire_seconds=43200
drop_caches=0
extfrag_threshold=500
highmem_is_dirtyable=0
laptop_mode=1
legacy_va_layout=0
lowmem_reserve_ratio=256 32 32
max_map_count=65530
min_free_kbytes=43196
mmap_min_addr=98304
nr_pdflush_threads=0
oom_dump_tasks=0
oom_kill_allocating_task=1
overcommit_kbytes=0
overcommit_memory=0
overcommit_ratio=50
page-cluster=128
panic_on_oom=0
percpu_pagelist_fraction=0
swappiness=0
user_reserve_kbytes=64233
vdso_enabled=1
vfs_cache_pressure=10000
For the /proc/sys/fs folder:
aio-max-nr=65536
aio-nr=0
dentry-state=36019 23519 45 0 0 0
dir-notify-enable=1
file-max=205612
file-nr=4056 0 205612
inode-nr=27643 72
inode-state=27643 72 0 0 0 0 0
lease-break-time=45
leases-enable=1
nr_open=1048576
overflowgid=65534
overflowuid=65534
pipe-max-size=1048576
pipe-user-pages-hard=0
pipe-user-pages-soft=16384
protected_hardlinks=0
protected_symlinks=0
suid_dumpable=0
I don't know if the filesystem matters much but the drive has multiple partitions of ext3 and vfat.
I also do not use a swap drive as I have 2 GB memory installed.
how do I go about ensuring that the disk can shut off from inactivity until I'm ready to use the computer again?
I'm running slackware 14 with xfce on an older 32-bit PC.
I also checked the power settings both in xfce and KDE and I didn't see anywhere where I can specify a timeout to spin down a drive.
And no I don't have money to invest in an SSD and I recall someone recently having issues with one of them in a mac.
Asked by mike_s
(11 rep)
Dec 1, 2022, 04:42 AM