[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: |
Tue, 03 Dec 2013 14:35:24 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 11/22/2013 01:52 AM, Pádraig Brady wrote:
> On 11/12/2013 07:45 AM, Bernhard Voelker wrote:
>> On 05/15/2013 04:39 PM, Pádraig Brady wrote:
>>> On 05/15/2013 03:32 PM, Ondrej Oprala wrote:
>>
>>>> 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...
>>
>> Isn't that what the findmnt(8) command achieves with
>> the -S,--source option, i.e. it's not only about dereferencing
>> per se but rather telling the tool that we're searching for
>> the source of a mount instead of the target?
>>
>> Therefore, I think making the changes in get_point() is abusing the
>> semantics of that function. Instead, get_disk() should be enhanced
>> in a similar way as in get_point() via canonicalize_file_name().
>
> Makes sense.
>
>> Another question is if such behavior could/should be made the default
>> or if a new option has to be introduced.
>
> I'd make it default to dereference. No new options needed I think.
This would be appropriate for the imminent release I think.
I'll have a look later if you've no time.
thanks,
Pádraig.
- Re: Add --dereference option to df,
Pádraig Brady <=
- Re: Add --dereference option to df, Bernhard Voelker, 2013/12/03
- Re: Add --dereference option to df, Pádraig Brady, 2013/12/03
- Re: Add --dereference option to df, Bernhard Voelker, 2013/12/03
- Re: Add --dereference option to df, Pádraig Brady, 2013/12/03
- Re: Add --dereference option to df, Bernhard Voelker, 2013/12/03
- Re: Add --dereference option to df, Pádraig Brady, 2013/12/04
- Re: Add --dereference option to df, Bernhard Voelker, 2013/12/05
- Re: Add --dereference option to df, Pádraig Brady, 2013/12/05
- Re: Add --dereference option to df, Bernhard Voelker, 2013/12/05
- Re: Add --dereference option to df, Pádraig Brady, 2013/12/05