lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <20120430173304.GF6938@tux1.beaverton.ibm.com> Date: Mon, 30 Apr 2012 10:33:04 -0700 From: djwong <djwong@...ibm.com> To: Daniel Drake <dsd@...top.org> Cc: linux-ext4@...r.kernel.org Subject: Re: Determining if an ext4 fs uses the whole partition On Mon, Apr 30, 2012 at 11:19:31AM -0600, Daniel Drake wrote: > Hi, > > OLPC has started using ext4 online resizing to grow our filesystems to > use the whole SD card on first boot - something we never did before. > Working very nicely, thanks! > > I'm trying to simplify/improve the scripts involved in doing this. > > How can I programatically check if an ext4 fs already fills its > partition, or if it has room to grow? Is it not the case that there's room to grow if: (ext4_block_count * ext4_block_size) - (bdev_size * 512) >= ext4_block_size > The numbers produced by dumpe2fs (e.g. block count) or "df" don't seem > to exactly line up with the sizes produced by fdisk. How far off are the counts? A small number of sectors, or many? --D > One easy solution, if possible, would be to find out the number of the > last sector used by the filesystem. I could then very easily compare > this to the "end" information found in sysfs for the partition. Then I > can make the decision on whether to grow or not. > > Thanks > Daniel > -- > To unsubscribe from this list: send the line "unsubscribe linux-ext4" in > the body of a message to majordomo@...r.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists