Re: [PATCH 03/13] Add method to get size of existing filesystems.

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

 



David Cantrell wrote:
> On 03/16/2009 03:19 AM, Jeremy Katz wrote:
>> On Sunday, March 15 2009, David Lehman said:
>>>>> Why not just do a temporary mount somewhere (if not already mounted) and
>>>>> run statfs on it?  Wouldn't that be simpler?</hand_wave>
>>>> It would be.  Attached is a new patch.  I didn't know we could call
>>>> statvfs() from Python (nor did I ever bother to look, but whatever).
>>> Much nicer.
>> Mounting can entail side effects, though, such as journal recovery and
>> has also in some cases ended up with filesystems having new,
>> incompatible features enabled.  While I guess it's possible that running
>> dumpe2fs, etc on a filesystem could do similar things, it just feels a
>> lot less likely.
> 
> While I'm not crazy about mounting the filesystem to get the existing 
> size, I do like using statvfs().  We won't have to worry about parsing 
> output from a variety of commands and we won't have to worry about 
> subtle changes in the output that breaks installations later on.
> 
> I'd rather work around the problems with mounting and running statvfs() 
> than try what I initially wrote.

regarding side effects... you could mount RO to be a bit safer at least
on some filesystems.  And in generalif you don't write anything, it
should not be writing any new features to the disk.  Generally that
comes in when you write your first big file, etc.  ext4 should
explicitly *not* write any new features from the kernel; it takes
tune2fs to do that now.

And if you're getting the size for resize purposes, aren't you planning
on mounting it soon anyway?  (I'm not sure of the flow, though; are you
mounting and stat-ing everything you can find?)

Regarding the problem of already-mounted filesystems why not just
check if it's mounted first and if so, just stat that mountpoint.

-Eric

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux