From: Jeff Moyer <jmoyer@redhat.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Daniel Drake <dsd@laptop.org>, linux-ext4@vger.kernel.org
Subject: Re: Determining if an ext4 fs uses the whole partition
Date: Mon, 30 Apr 2012 13:37:42 -0400 [thread overview]
Message-ID: <x49ty01i0ih.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <4F9ECC0E.8020201@redhat.com> (Eric Sandeen's message of "Mon, 30 Apr 2012 12:29:50 -0500")
Eric Sandeen <sandeen@redhat.com> writes:
> On 4/30/12 12:19 PM, 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?
>>
>>
>> The numbers produced by dumpe2fs (e.g. block count) or "df" don't seem
>> to exactly line up with the sizes produced by fdisk.
>
> Do you have an example of this?
>
> For starters, use fdisk -u to get 512-byte sector units,
> otherwise it's just inscrutable CHS magic.
Note that fdisk -u gives sector units, which may or may not be 512
bytes:
$ sudo fdisk -lu /dev/sdb
Note: sector size is 4096 (not 512)
Disk /dev/sdb: 300.1 GB, 300069052416 bytes
255 heads, 63 sectors/track, 4560 cylinders, total 73259046 sectors
Units = sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Cheers,
Jeff
next prev parent reply other threads:[~2012-04-30 17:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-30 17:19 Determining if an ext4 fs uses the whole partition Daniel Drake
2012-04-30 17:29 ` Eric Sandeen
2012-04-30 17:37 ` Jeff Moyer [this message]
2012-04-30 19:01 ` Ted Ts'o
2012-04-30 18:18 ` Daniel Drake
2012-04-30 18:26 ` Eric Sandeen
2012-04-30 17:33 ` djwong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=x49ty01i0ih.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=dsd@laptop.org \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).