Re: _maxSize in anaconda filesystem types

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 19 Jan 2010, Eric Sandeen wrote:

This has been in the back of my mind for a while, but maybe
it's worth addressing now that disks getting awfully large.

class XFS(FS):
   """ XFS filesystem """
   _type = "xfs"
   _mkfs = "mkfs.xfs"
   _modules = ["xfs"]
   _labelfs = "xfs_admin"
   _defaultFormatOptions = ["-f"]
   _defaultLabelOptions = ["-L"]
   _maxLabelChars = 16
   _maxSize = 16 * 1024 * 1024

...

XFS can actually go much bigger than this, as can some other
filesystems.  However, there is a VM limit on some architectures;
basically the page cache can't address > (2^(long bits) * (page size))

So for x86, it's 2^32 * 4096 = 16T hence the limit above.

But for 64-bit arches, the max fs size is well beyond 16T.

A lot of the _maxSize values were filled in by me, and I was looking around
wherever I could to find what the maximum sizes were of these filesystems.  If
there is a way to programatically set it for a filesystem, I'm all for that.
We just needed fs experts to weigh in on that, so thanks.

This stuff is available in C-land:

#include <unistd.h>
long sz = sysconf(_SC_PAGESIZE);

(most systems allow the synonym _SC_PAGE_SIZE for _SC_PAGESIZE), or

or:

#include <unistd.h>
int sz = getpagesize();

and sizeof(long) I guess; not sure how to get there from Python.

import resource
resource.getpagesize()

Anyway if Anaconda wants to be more correct, it'd be something like:

_maxSize = min((2^bits_per_long * page_size), fs_max_size)

Does that sound doable?

Sounds reasonable.  There's probably a better way to do this, but here's
something:

    import resource
    import struct

    bitsPerLong = struct.Struct("l").size * 8
    fsMaxSize = ???
    _maxSize = min((2^bitsPerLong * resource.getpagesize()), fsMaxSize)

A struct.Struct() object has the size property which gives the size in bytes.
"l" is the format char for a long.  Tried on x86_64 and bitsPerLong becomes 64
and on x86_32 it becomes 32.

- -- David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)

iEYEARECAAYFAktV9ycACgkQ5hsjjIy1Vknr/QCeIwOVqZbBT0HLNulTTWdIrRon
fzgAoO4wiI9O/tv6VroZKQv9OCsKf1S+
=365X
-----END PGP SIGNATURE-----

_______________________________________________
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