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

Check sleep status of HDD's in layered structures before scanning volumes #868

Closed
Markus-N opened this issue Mar 29, 2021 · 4 comments · Fixed by #949
Closed

Check sleep status of HDD's in layered structures before scanning volumes #868

Markus-N opened this issue Mar 29, 2021 · 4 comments · Fixed by #949

Comments

@Markus-N
Copy link

Markus-N commented Mar 29, 2021

This issue is a follow-up of #611 (comment). Having two aspects, I think it helps to separate them into individual issues, starting with the bigger one.

System and version info:
udisks2 2.9.2-1 on Arch Linux

My PC is running mostly 24/7, and I'm trying to keep the RAID disks sleeping as much as possible, especially when the summer comes, every watt not heating up my room is valuable :-) but I often need to mount/ unmount file systems on USB devices and also remote filesystems (the latter ones covered in the second issue: #869).

However, the HDD's wake up on any mount / unmount operation. I've followed this advice to replacedumpe2fs with a logger:
https://unix.stackexchange.com/questions/408757/why-is-dumpe2fs-called-without-user-interaction/408763
and when I mount a USB device, dumpe2fs is called for the dm devices that correspond to the logical volumes, e.g. /dev/dm-6.

This is my storage layout (I think this table is clearer than a udisksctl dump):

hardware /dev/nvme0n1 /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde
partitions p1: EFI p2: /boot p3: all the rest one partition each, part of the md-raid
encryption crypt 1 crypt 2
LVM PV's PV 1 PV 2
LVM VG's VG 1 VG 2
LVM LV's /, /var, /home, ... /BigData

As you can see, everything on the RAID is separated from the rest of the system. And it contains data I don't access every day. But the HDD's spin up multiple times per day because of the mount/unmount operations on USB and remote filesystems.

I did a few further reading a while ago and I remember stumbling upon someone explaining that the volume scan is there "for a reason" but unfortunately without explaining the reason. I'd like to learn about this reason. :-)

@tbzatek
Copy link
Member

tbzatek commented Jan 6, 2022

I suppose the problem here is that an ATA drive lookup done in UDisksLinuxFilesystem only attempts to sniff an interface on a direct UDisksLinuxBlockObject, not taking a layered structure in account. In this case, it would need to walk the tree and find all physical devices and check them all. This is not easy to implement and adds quite a bit of complexity.

However, in your case, if you are not running any UDisks client that consumes the org.freedesktop.UDisks2.Filesystem.Size property, I think this change might cover your case: #949

Would you have a way to verify that it solves your issue please?

@Markus-N
Copy link
Author

Markus-N commented Jan 6, 2022

Welll ... although I consider myself an advanced user, I don't think I'm advanced enough to run a self-built system component. As I use my PC for my job, I also don't want to risk the stability of the OS.
On the other hand, running Arch Linux, I think I will get an updated udisks very early when #949 is merged. I'd like to wait for that.

@tbzatek
Copy link
Member

tbzatek commented Jan 6, 2022

No worries. I've updated the pull request with a TODO about layered structure. I don't think we'd get to it anytime soon.

I would like to keep this change in a development branch for the moment as the way the object properties are overriden is kinda hacky. Needs more testing in the CI over time. Distributors are of course welcome to pick the changes up at their consideration.

@Markus-N
Copy link
Author

Unfortunately, mounting USB devices still wakes up my internal HDDs.

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

Successfully merging a pull request may close this issue.

2 participants