Web lists-archives.com

Re: Partition information as text file?




On 01/28/2019 01:43 PM, Pascal Hambourg wrote:
Le 28/01/2019 à 13:48, Richard Owlett a écrit :

So it looks as if   df --output -x tmpfs -x devtmpfs   gives you all
you want (and more) with the exception of LABELs.

No. The man pages states it only looks at mounted partitions due to "...nonportable intimate knowledge of file system structures]. As I only have FAT and ext partitions, what I want should be doable if not already done.

The total and used/free space in ext and FAT filesystems can be computed from the output of tune2fs -l/dumpe2fs -h and fsck.dos -n.


Murphy's Law has won this round, all my disks have "msdos Partition table". I get the following error message:
root@fromdell:/home/richard# tune2fs -l /dev/sda
tune2fs 1.43.4 (31-Jan-2017)
tune2fs: Bad magic number in super-block while trying to open /dev/sda
Found a dos partition table in /dev/sda

Additionally, all my machines have legacy BIOS.

I assume "fsck.dos" is a typo as
[https://dyn.manpages.debian.org/jump?suite=stretch&binarypkg=dosfstools&section=8&language=en&q=fsck.dos]
    yields
"Sorry, the manpage “fsck.dos” was not found!"

Thanks for trying.

What bugs me is Gparted [though it does not output text] reports used/unused space on each partition/file system.