2

I have 3 physical drives - SSD with / mounted, 1st HDD used as /var and /home, 2nd HDD - recovery storage for backups. The HDD with backups should stay most of the time in standby and unmounted state caused by cron and bash scripts with umount and hdparm -y.

The problem is external USB-drives mounting/umounting (with GUI or terminal) causes resuming of sleeping drive from standby state.

Deeper investigation shows that mount and umount utilities execute dumpe2fs -h /dev/sdXn command for every partition (including unmounted) of every drive installed, which causes directly sleeping drives wake up.

For example, if the external USB-drive/stick /dev/sdd is being mounted/dismounted, this causes in my case consequent execution of the commands (pieces from real log with some explanations):

dumpe2fs -h /dev/sda1 #this is / (root) partition at SSD
[...]
dumpe2fs -h /dev/sdc4 #this is /var partition at HDD #1
[...]
dumpe2fs -h /dev/sdc3 #this is /home partition at HDD #1
[...]
dumpe2fs -h /dev/sdb1 #this is recovery storage partition at HDD #2
[...]

Ubuntu 16.04 and earlier versions (I have migrated from Red Hat to Debian and Ubuntu in 2006) haven't such the strange behaviour. Thus, we can come to resonable conclusion the behavior caused by a bug of Ubuntu 18.04. Is there any way to solve the problem?

Note: There is related question (but not a duplicate) in Unix & Linux community: Why is dumpe2fs called without user interaction?.

UPDATE. I have discovered solution for the problem - it will be posted some later today. The problem is solved. My deepest appreciation for help to @神秘德里克 - thank you so much, friend!

17
  • 1
    I cannot confirm that the commands mount/umount do trigger a dumpe2fs on all devices. Just tested in a Ubuntu 18.04 VM. I guess you are running in a Desktop environment. In that case udisks2 is investigating the attached disks on USB add/removal to make it accessible in the GUI for the user.
    – Thomas
    Jul 22 '18 at 10:08
  • 1
    According to Thomas, if you're using udisks or some other tools instead of mount program, then other logic might happen. Please don't tell me when you say mount/umount you are referring to some Desktop Environment based auto mount functionality. As far I I know , mount/umount from util-linux never call dumpe2fs command. Jul 22 '18 at 10:40
  • 2
    Uh…Here's the thing, I'm a Chinese guy travelling on a train, my network can't access pastebin, so my personal suggestions is , since Ubuntu 18.04 use systemd, you can disable udisks service, umount all partitions on sdd, reboot, try to do mount/umount all by yourself, see what happened. Because I am not familiar with udisks2, maybe it's monitoring mount points and try to do wired stuff even when you umount manually…I guess? Jul 22 '18 at 11:09
  • 2
    @神秘德里克 Which pastebin service is available for you? I have followed your suggestion: stopped udisks daemon systemctl stop udisks2.service, checked its status: systemctl status udisks2.service (it was stopped) and inserted USB-drive. As result the stick wasn't mounted automatically. I have mounted it manually mount /dev/sdd1 /media/user/stick and the problem has disappeared - no dumpe2fs was called.
    – Bob
    Jul 22 '18 at 11:54
  • 2
    I reopened this since you deleted the copy on AU. I also removed your discussion of how you were treated since that doesn't belong here. Let's just try and keep the discussion limited to technical issues please.
    – terdon
    Jul 23 '18 at 17:26
1

udisksd calls dumpe2fs -h /dev/sd?? command for each ext2, ext3 and ext4 partition when the service is started and when it mounts/unmounts any disk. Any HDD that contains at least one ext* partition is waked by udisksd=>dumpe2fs.

Much more details can be found in comments to this udisks bug: https://github.com/storaged-project/udisks/issues/611. The bug is fixed in udisks 2.8.4, so it no longer wakes any HDDs when an unrelated partition is mounted or unmounted.

There is a similar question and answer here: https://superuser.com/questions/1371955/why-one-of-two-hdds-wakes-from-sleep-during-the-first-linux-graphical-login.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.