rolinh / dfc

Report file system space usage information with style
BSD 3-Clause "New" or "Revised" License
108 stars 9 forks source link

Proposal: Graphs of different width #23

Open scrouthtv opened 3 years ago

scrouthtv commented 3 years ago

Hello, first and foremost, I really like dfc. On my server I have multiple hard drives of different size:

FILESYSTEM      TYPE     (=) USED      FREE (-)  %USED   USED AVAILABLE  TOTAL MOUNTED ON
/dev/sdb1       fuseblk  [=================---]  81.0% 754.7G    176.9G 931.5G /media/00
/dev/mapper/vc1 ext4     [===================-]  90.2% 498.8G     57.1G 585.8G /media/01
/dev/mapper/vc2 ext4     [=================---]  82.0% 704.6G    164.6G 915.9G /media/02
/dev/mapper/vc3 ext4     [==============------]  69.0% 374.6G    181.4G 585.8G /media/03

Now, as you can see, the hard drives are of different sizes each so it's a bit hard at first glance to see which one has the most free space. For this reason I was thinking of an alternative graph display where each graph resembles the absolute size of the fs and is filled up accordingly, something like this:

FILESYSTEM      TYPE     (=) USED      FREE (-)  %USED   USED AVAILABLE  TOTAL MOUNTED ON
/dev/sdb1       fuseblk  [==============----]    81.0% 754.7G    176.9G 931.5G /media/00
/dev/mapper/vc1 ext4     [=========-]            90.2% 498.8G     57.1G 585.8G /media/01
/dev/mapper/vc2 ext4     [=============---]      82.0% 704.6G    164.6G 915.9G /media/02
/dev/mapper/vc3 ext4     [=======---]            69.0% 374.6G    181.4G 585.8G /media/03

This is a very crude mock up of what I have in mind. (I know that my specific scenario is rather a thing for LVM but I'm to lazy.)

Let me know what you think about this and if you're interested in a feature like this, I'd work on a PR.

rolinh commented 3 years ago

Hi! I like your proposal and it makes sense to me. I'm not sure how dealing with partitions/disks of very different sizes will work in practice though (I'm trying to picture, say, a 20G partition and a 4TB one for instance) but it's also not like this needs extreme accuracy. I'd totally accept a PR that adds this functionality but I think it should be hidden behind a flag and not a default.

EDIT: for instance, this is the output on my current machine. I have both a 256T mount and a 511M EFI partition:

$ dfc -dWT
FILESYSTEM     TYPE      (=) USED      FREE (-)  %USED   USED AVAILABLE  TOTAL MOUNTED ON                                                            
dev            devtmpfs  [--------------------]   0.0%   0.0B     31.4G  31.4G /dev                                                                  
run            tmpfs     [=-------------------]   0.0%   2.1M     31.4G  31.4G /run                                                                  
/dev/nvme1n1p2 ext4      [==========----------]  45.7% 371.5G    497.3G 915.4G /                                                                     
tmpfs          tmpfs     [=-------------------]   0.8% 267.6M     31.1G  31.4G /dev/shm                                                              
tmpfs          tmpfs     [--------------------]   0.0%   0.0B      4.0M   4.0M /sys/fs/cgroup                                                        
tmpfs          tmpfs     [=-------------------]   0.0%   3.8M     31.4G  31.4G /tmp                                                                  
/dev/nvme1n1p1 vfat      [=-------------------]   0.1% 292.0K    510.7M 511.0M /efi                                                                  
tmpfs          tmpfs     [=-------------------]   0.0%  56.0K      6.3G   6.3G /run/user/1001                                                        
s3fs           fuse.s3fs [--------------------]   0.0%   0.0B    256.0T 256.0T /mnt/s3fs/foo