[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: why is my local user (/dev/sda5) drive not being displayed by df?



On Wed 11 Mar 2020 at 11:13:30 (-0400), rhkramer@gmail.com wrote:
> On Wednesday, March 11, 2020 10:41:19 AM David Wright wrote:
> > Well, I'm glad that's all sorted. Now all I've got to figure out is
> > the connection between df and whoami.
> 
> Pretty much, there is no relation.
> 
> Maybe you're wondering about why some directories or files (on partitions that 
> can be shown by df) might allow certain things (reading, writing, ...) by some 
> users and not others?
> 
> If so, you have to learn about the permissions -- try an ls -al on some file or 
> directory that you have questions about -- if that helps pinpoint your 
> question but you need some help in understanding, ask a question about that.

I'm not aware of permissions being important for df, excepting the
reserved blocks that root keeps in its back pocket. But the use of
grep suggests that the script is looking for clarity.

I never normally type "df", but run my script, dfree, instead.

$ dfree
Filesystem      IUse%  Type  1MB-blocks    Used   Avail  Use%  Mounted  on
/dev/sda1         18%  ext4       29393    9833   18044   36%  /
/dev/sdb4          1%  ext4       30830      47   29194    1%  /ya
/dev/sda2         16%  ext4       29199    7998   19694   29%  /wasps
/dev/sdb5          1%  ext4       30830      47   29194    1%  /yb
/dev/dm-0          1%  ext4      428072   26182  380073    7%  /home
/dev/dm-1          1%  ext4      428223  381266   25134   94%  /agoghome
$ 

That's what most people want to keep an eye on as they go about
their ordinary business. 1MB-blocks are more suited to modern
disk sizes, but give a physical expression of size, unlike -h.

dfree is a function
dfree () 
{ 
    local Outfile=/dev/null;
    [ -n "$1" ] && Outfile=/tmp/df-"$HOSTNAME"-"$(date +%Y-%m-%d-%H-%M-%S)";
    df --output=source,ipcent,fstype,size,used,avail,pcent,target -B 1000000 -x tmpfs -x devtmpfs | sed -e 's/\([^ ] \)/\1 /g' | tee -a "$Outfile"
}

Cheers,
David.


Reply to: