Bug 830468

Summary: YaST2 spins up unmounted harddisks for many harddisk-unrelated config tasks
Product: [openSUSE] openSUSE 12.2 Reporter: Andreas Nordal <andreas_nordal_4>
Component: YaST2Assignee: E-mail List <yast2-maintainers>
Status: RESOLVED WONTFIX QA Contact: Jiri Srain <jsrain>
Severity: Minor    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 12.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Andreas Nordal 2013-07-20 21:37:32 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0

When YaST2 is opened, it shows a lot of icons (bootloader, network, …). I have noticed that the first thing that happens when clicking many of those, is that all harddisks spin up.

I have several harddisks that I like to keep spun down:
1. My backup harddisk.
2. My failed raid1 array that I'm perpetually rescuing data from.
3. My family's failed harddisk that I'm perpetually rescuing data from.
4. My backup-backup harddisk that vibrates and squeals like a pig.

Problem 1 — inconvenience: After say, adjusting bootloader settings, I have to open a terminal and do `for i in c d e f g; do hdparm -Y /dev/sd$i; done` as root to spin them down again.

Problem 2 — unnecessity: Some settings are just totally harddisk-unrelated, e.g. network settings! Arguably all settings are unrelated, because these harddisks are not part of the system.

Problem 3 — fragility: Don't rely on my failed harddisks! You won't be able to read the partition table of my family's failed harddisk anyway, and this apparently broke kernel upgrading…

Reproducible: Always

Steps to Reproduce:
1. Open YaST2 
2. Click the network settings

Actual Results:  
Harddisks spin up.
It gets noisy.
The mere presence of my family's failed harddisk causes things to take extremely long time and/or fail.

Expected Results:  
Unused harddisks should remain spun down.
Comment 1 Thomas Fehr 2013-07-22 16:43:02 UTC
As soon as libstorage data is initialized it need to determine
some stuff from block devices. So far there is no way as to
determine these with call to e.g parted and blkid. Both
need to access disks/partitions to read metadata 
(partition table/filesystem type/raid superblocks).

As long as there is no "libstorage-daemon" that keeps
that information available forever after system startup
I see no way to avoid this.
Comment 2 Andreas Nordal 2014-06-12 03:04:33 UTC
Enumerating disks and partitions without spinning them up can be done by looking at /dev/disk/by-id/.

Is it necessary to determine filesystem type/raid superblocks for non-mounted filesystems? If not, that's the answer:
- Filesystems, just look at /proc/mounts.
- Raid superblocks, I'm guessing there must be (similar) ways to see how block devices are in use by mdadm/lvm.

If it ain't in use, don't look at it ;)