Bug 133600

Summary: Can't find used/available space on usb drive - subfs
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Bryce Nesbitt <bryce2>
Component: BasesystemAssignee: Dr. Werner Fink <werner>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: dkukawka
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: SuSE Linux 10.0   
URL: http://portal.suse.com/sdb/en/2005/05/dkukawka_subfs_nomount.html
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Bryce Nesbitt 2005-11-12 22:49:21 UTC
When I plug a USB hard drive in, KDE identifies it as a USB Stick.  A bit strange, but OK.

But not fine is that I can't see how much space is used either from the KDE GUI or from the command line:

bryce@linux:/media> df usb*
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda7                    0         0         0   -  /media/usbdisk
/dev/sda3                    0         0         0   -  /media/usbdisk_1
/dev/sda5                    0         0         0   -  /media/usbdisk_2
/dev/sda6                    0         0         0   -  /media/usbdisk_3
/dev/sda2                    0         0         0   -  /media/usbdisk_4
/dev/sda1                23393        14     22171   1% /media/usbdisk_5
/dev/sda9                    0         0         0   -  /media/usbdisk_6
/dev/sda8                    0         0         0   -  /media/usbdisk_7

The blocks/used/available show up ONLY on the partition most recently written to.  If I write to /media/usbdisk_6 then the blocks will go to zero on /media/usbdisk_5:

Linux:/media # cd usbdisk_6
linux:/media/usbdisk_6 # echo > foo
linux:/media/usbdisk_6 # cd ..
linux:/media # df usbdisk*
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda7                    0         0         0   -  /media/usbdisk
/dev/sda3                    0         0         0   -  /media/usbdisk_1
/dev/sda5                    0         0         0   -  /media/usbdisk_2
/dev/sda6                    0         0         0   -  /media/usbdisk_3
/dev/sda2                    0         0         0   -  /media/usbdisk_4
/dev/sda1                    0         0         0   -  /media/usbdisk_5
/dev/sda9              4623456   2930800   1457796  67% /media/usbdisk_6
/dev/sda8                    0         0         0   -  /media/usbdisk_7

Is SUSE mounting these in some strange way?
Comment 1 Bryce Nesbitt 2005-11-12 22:51:00 UTC
bryce@linux:/> df /dev/sda*
Filesystem           1K-blocks      Used Available Use% Mounted on
-                       257876       224    257652   1% /dev
/dev/sda1                    0         0         0   -  /media/usbdisk_5
/dev/sda2                    0         0         0   -  /media/usbdisk_4
/dev/sda3                    0         0         0   -  /media/usbdisk_1
-                       257876       224    257652   1% /dev
/dev/sda5              9076744     78964   8536700   1% /media/usbdisk_2
/dev/sda6                    0         0         0   -  /media/usbdisk_3
/dev/sda7                    0         0         0   -  /media/usbdisk
/dev/sda8                    0         0         0   -  /media/usbdisk_7
/dev/sda9              4623456   2930800   1457796  67% /media/usbdisk_6
Comment 2 Danny Al-Gaaf 2005-11-13 20:25:27 UTC
This is full normal behavior. The devices are automatically mounted with subfs. If nobody access the partitions (e.g. for read/write) they are not directly mounted. They are only mounted for subfs. This mean they get mounted if you access them and only in this case. If you no longer access them they are automatically umounted by submountd. If you take a look at /proc/mounts you will see for the partitions you currently use/access two entries. One for subfs and one for the real mount. Because the not used partitions are umounted df can't know anything about them.

They are deteced/named as usbstick, because you can't currently say if this is a harddisk or a usb-stick. Maybe a littlebit ugly buts not a bug.
Comment 3 Bryce Nesbitt 2005-11-14 18:11:05 UTC
Ok, I found instructions on disabling subfs:

http://portal.suse.com/sdb/de/2004/05/hmeyer_91_revert_from_subfs.html
http://portal.suse.com/sdb/en/2005/05/dkukawka_subfs_nomount.html

But they are out of date for SUSE 10.0, and they don't completely remove subfs.  Now I've had several troubles with subfs, how can I get rid of it?
Comment 4 Danny Al-Gaaf 2005-11-14 18:20:22 UTC
If you wan't to disable subfs completly you must remove the submount package and you must do the mounts manually. No automount in this case. This is not supported by suse linux 10.0.

Yes there are not up-to-date because the SDB should be merged in the wiki. We make updates after this merge.
Comment 5 Dr. Werner Fink 2005-11-14 18:24:31 UTC
Is there a way to hold the usb drive data into mind read from
the last mount session? Clearly such data have to be cleared
if the usb drive is unpluged. 
Comment 6 Danny Al-Gaaf 2005-11-14 18:50:26 UTC
I don't think so, but better ask a kernel guy (maybe Jeff or Chris)
Comment 7 Dr. Werner Fink 2005-11-15 11:11:41 UTC
Done
Comment 8 Bryce Nesbitt 2005-11-15 17:59:44 UTC
This must be the same reason that "Remove Safely" from KDE fails with "device is not in fstab"!

Also: It sure would be nice if the "Remove Safely" menu from KDE worked, and also spun the disk down (e.g. hdparm -y /dev/xxxx or sdparm --command=stop /dev/sda or http://sourceforge.net/projects/noflushd/ or hdarm -S1 /dev/sda ).

It simply does not feel safe to just unplug the drive!