From: Andreas Dilger <adilger@dilger.ca>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Simon Matthews <simon.d.matthews@gmail.com>,
Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: Filesystem size problem.
Date: Mon, 12 Dec 2016 15:36:27 -0700 [thread overview]
Message-ID: <7393F8E6-AD83-430E-AE3E-A800DAB91FD3@dilger.ca> (raw)
In-Reply-To: <46f8665e-c3b5-b2e9-346b-4bbb380bb6e2@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2730 bytes --]
On Dec 9, 2016, at 9:35 PM, Eric Sandeen <sandeen@redhat.com> wrote:
>
> On 12/9/16 2:29 PM, Andreas Dilger wrote:
>> On Dec 8, 2016, at 10:40 PM, Simon Matthews <simon.d.matthews@gmail.com> wrote:
>>>
>>> I have an ext3 filesystem that will not mount under newer versions of
>>> the kernel and I hope someone here can help.
>>>
>>> Obviously, one solution is "backup and re-create from scratch". I have
>>> the backups, but I hope that there may be a quicker method to fix the
>>> issues.
>>>
>>> The root issue is that the filesystem is very slightly smaller than
>>> the allocated space.
>
> So the device is now smaller than the filesystem thinks, right?
>
>> The filesystem exists on a MDRAID device and I
>>> think that when I converted the MDRAID to a newer metadata version, it
>>> truncated the available size, slightly. However, how I got here isn't
>>> really important, fixing it now is.
>>
>> Running "e2fsck -fy" should fix this. I'd recommend to use the latest
>> version of e2fsck.
>
> Reaslly? e2fsck can change total blocks in the superblock to accomodate a
> shrunken device? That's a new one for me...
Strange, I thought this case was handled properly by e2fsck.
You could probably fix this with:
# debugfs -R "ssv blocks_count 693359326" /dev/md5
# e2fsck -f /dev/md5
to set the blocks count. It is unlikely anything is in the last 18 blocks
of the filesystem, and if it is then it is probably already corrupted by
the RAID superblock stored there.
>
> I don't think so:
>
> $ truncate --size=101m testfile
> $ mkfs.ext3 testfile
> $ truncate --size=100m testfile
> $ e2fsck -f testfile
> ...
> The physical size of the device is 102400 blocks
> Either the superblock or the partition table is likely to be corrupt!
> Abort<y>? n
> ...
> $ e2fsck -f testfile
> ...
> The physical size of the device is 102400 blocks
> Either the superblock or the partition table is likely to be corrupt!
> Abort<y>? n
> $ e2fsck -f testfile
> ...
> The physical size of the device is 102400 blocks
> Either the superblock or the partition table is likely to be corrupt!
> Abort<y>? n
>
> etc.
>
>
> The proper solution is to fix your block device, not the filesystem;
> it was the block device which was inappropriately shortened.
This may be more easily said than done...
> I don't know if just poking a smaller total blocks number into the
> superblock via debugfs would be safe or not.
It would probably be better to have e2fsck fix this problem itself,
but it is uncommon enough that there is a danger someone will also
shoot themselves in the foot for cases where this isn't working right.
Cheers, Andreas
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2016-12-12 22:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAEUYfyP7U9L4mB12awB_YWEqixh9R8RpRZXjYTG6mpiZeBW4OQ@mail.gmail.com>
2016-12-09 5:40 ` Fwd: Filesystem size problem Simon Matthews
2016-12-09 20:29 ` Andreas Dilger
2016-12-10 2:18 ` Simon Matthews
2016-12-10 4:35 ` Eric Sandeen
2016-12-10 5:27 ` Simon Matthews
2016-12-12 22:36 ` Andreas Dilger [this message]
2016-12-13 2:48 ` Simon Matthews
2016-12-13 20:48 ` Andreas Dilger
2016-12-14 1:43 ` Simon Matthews
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=7393F8E6-AD83-430E-AE3E-A800DAB91FD3@dilger.ca \
--to=adilger@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=simon.d.matthews@gmail.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