coreutils
[Top][All Lists]
Advanced

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

Re: Add --dereference option to df


From: Pádraig Brady
Subject: Re: Add --dereference option to df
Date: Wed, 15 May 2013 15:39:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 05/15/2013 03:32 PM, Ondrej Oprala wrote:
> On 05/15/2013 04:19 PM, Pádraig Brady wrote:
>> On 05/15/2013 02:55 PM, Ondrej Oprala wrote:
>>> Hi, this patch adds the --dereference option to df, so if a symlink is 
>>> specified
>>> as an argument to df (possibly /dev/disk/by-uuid/*), df outputs info about 
>>> the
>>> filesystem the symlinked file is on instead. Now, I realize the option's 
>>> name is
>>> a bit misleading, since the arguments are stat-ed anyway, but IMHO that's 
>>> exactly
>>> what it looks like from a user's perspective.
>> I don't get this sorry.
>> Well the naming is very confusing since symlinks are already deferenced?
> Yes, but since the best_match is mostly "guessed" the way it is, the user has
> no way of knowing that.
> 
>> Also I don't see a change for your stated example:
>>
>> $ df -L /dev/disk/by-uuid/3030-3030
>> Filesystem     1K-blocks  Used Available Use% Mounted on
>> udev             1454732     0   1454732   0% /dev
>>
>> $ df $(realpath /dev/disk/by-uuid/3030-3030)
>> Filesystem     1K-blocks  Used Available Use% Mounted on
>> udev             1454732     0   1454732   0% /dev
>>
>> If I do create a symlink to a different FS,
>> I'm not sure I get results you're expecting?
>>
>> $ ln -nsf /dev/shm shm
>>
>> $ src/df shm
>> Filesystem     1K-blocks  Used Available Use% Mounted on
>> tmpfs            1464412  6292   1458120   1% /dev/shm
>>
>> $ src/df -L shm
>> Filesystem     1K-blocks  Used Available Use% Mounted on
>> udev             1464412  6292   1458120   1% /dev
>>
>> thanks,
>> Pádraig.
>>
> 
> Let me explain by example from my system:
> 
> /dev/sda1 is mounted on /boot
> /dev/disk/by-uuid/37a5c8d4-78ff-408f-8ae8-70555df51f7f is a symlink to 
> /dev/sda1
> 
> #in the following example df prints info about the fs where the symlink file 
> is.
> $ df /dev/disk/by-uuid/37a5c8d4-78ff-408f-8ae8-70555df51f7f
> Filesystem     1K-blocks  Used Available Use% Mounted on
> devtmpfs         1013888     0   1013888   0% /dev
> 
> #with -L, information about the symlinked FS is printed.
> $ df -L /dev/disk/by-uuid/37a5c8d4-78ff-408f-8ae8-70555df51f7f
> Filesystem     1K-blocks  Used Available Use% Mounted on
> /dev/sda1        1013888     0   1013888   0% /boot
> 
> So although the argument is stat-ed(dereferenced) in both cases, different 
> parts
> of the information are used to decide what to output if -L is specified 
> (which is why
> I find the option name misleading).

Ah /dev/sda1 (/boot) isn't mounted on my system
(as I don't want that disk spinning up (long story)).
That's why I got the results I presented.
More thinking required...

thanks,
Pádraig.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]