List Info

Thread: growfs(8) for NetBSD




growfs(8) for NetBSD
country flaguser name
Spain
2008-03-27 18:50:10
Hey,

I've just adapted growfs(8) from OpenBSD (they adapted the
FreeBSD code),
which is able to grow FFSv1 and FFSv2 filesystems.

I tested growing a partition in FFSv1 and FFSv2 from 1GB to
4GB and the
process was smooth (and fast); after this I ran 'fsck_ffs
-yf /fs' and it
found one error that was fixed correctly.

I didn't find any error, so I'd think it should be safe to
use it
everywhere. Also please note that I only tried it on i386,
perhaps it needs
changes for BE and/or LP64 archs.

http://www.netbsd.org/~xtraeme/growfs-20080328.tar.gz

Please review and/or test it, thanks!

-- 
Juan Romero Pardines - xtraeme at gmail|netbsd dot org
	The NetBSD Project

Make your own NetBSD/x86 Live CD:
http://www.n
etbsd.org/~xtraeme/mklivecd/

Re: growfs(8) for NetBSD
country flaguser name
Canada
2008-03-27 19:03:54
> I tested growing a partition in FFSv1 and FFSv2 from
1GB to 4GB and
> the process was smooth (and fast); after this I ran
'fsck_ffs -yf
> /fs' and it found one error that was fixed correctly.

> I didn't find any error, so I'd think it should be safe
to use it
> everywhere.

I would hesitate to call it safe to use *anywhere* - except,
of course,
a crash-and-burn test machine - until and unless someone has
figured
out where the error fsck caught came from and made sure it's
OK.

/~ The ASCII				der Mouse
 / Ribbon Campaign
 X  Against HTML	       mouserodents.montreal.qc.ca
/  Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3
27 4B

Re: growfs(8) for NetBSD
country flaguser name
Sweden
2008-03-27 19:19:07
On Fri, 28 Mar 2008 00:50:10 +0100
Juan RP <xtraemegmail.com> wrote:

> Hey,
> 
> I've just adapted growfs(8) from OpenBSD (they adapted
the FreeBSD code),
> which is able to grow FFSv1 and FFSv2 filesystems.
> 
> I tested growing a partition in FFSv1 and FFSv2 from
1GB to 4GB and the
> process was smooth (and fast); after this I ran
'fsck_ffs -yf /fs' and it
> found one error that was fixed correctly.
> 
> I didn't find any error, so I'd think it should be safe
to use it
> everywhere. Also please note that I only tried it on
i386, perhaps it needs
> changes for BE and/or LP64 archs.
> 
> http://www.netbsd.org/~xtraeme/growfs-20080328.tar.gz
> 
> Please review and/or test it, thanks!

I tried it on sparc64. Grew a 3GB FFSv2 populated with 200MB
of data to
12GB. Seems to have worked for the most part, except I also
got one fsck
error:

SUMMARY INFORMATION BAD
SALVAGE? yes
BLK(S) MISSING IN BIT MAPS
SALVAGE? yes

It also needed the attached diff to compile on LP64.
(Looks good, now I only need a tool that can add more
components into an
existing raidframe RAID5 set!)

Cheers,
-Tobias

  
Re: growfs(8) for NetBSD
user name
2008-03-28 10:30:09
On Fri, 28 Mar 2008, Juan RP wrote:
> I've just adapted growfs(8) from OpenBSD (they adapted
the FreeBSD code),
> which is able to grow FFSv1 and FFSv2 filesystems.
>
> I tested growing a partition in FFSv1 and FFSv2 from
1GB to 4GB and the
> process was smooth (and fast); after this I ran
'fsck_ffs -yf /fs' and it
> found one error that was fixed correctly.
>
> I didn't find any error, so I'd think it should be safe
to use it
> everywhere. Also please note that I only tried it on
i386, perhaps it needs
> changes for BE and/or LP64 archs.
>
> http://www.netbsd.org/~xtraeme/growfs-20080328.tar.gz
>
> Please review and/or test it, thanks!

I've not tested it yet, but it appears that the -y flag
(expert mode) 
doesn't quite behave as documented as it doesn't check that
the filesystem 
is not mounted (but it does check for an active snapshot
which isn't 
documented either).

-- 
Stephen


Re: growfs(8) for NetBSD
country flaguser name
Spain
2008-03-28 10:57:09
On Fri, 28 Mar 2008 15:30:09 +0000 (GMT)
Stephen Borrill <netbsdprecedence.co.uk>
wrote:

> On Fri, 28 Mar 2008, Juan RP wrote:
> > I've just adapted growfs(8) from OpenBSD (they
adapted the FreeBSD code),
> > which is able to grow FFSv1 and FFSv2
filesystems.
> >
> > I tested growing a partition in FFSv1 and FFSv2
from 1GB to 4GB and the
> > process was smooth (and fast); after this I ran
'fsck_ffs -yf /fs' and it
> > found one error that was fixed correctly.
> >
> > I didn't find any error, so I'd think it should be
safe to use it
> > everywhere. Also please note that I only tried it
on i386, perhaps it needs
> > changes for BE and/or LP64 archs.
> >
> > http://www.netbsd.org/~xtraeme/growfs-20080328.tar.gz
> >
> > Please review and/or test it, thanks!
> 
> I've not tested it yet, but it appears that the -y flag
(expert mode) 
> doesn't quite behave as documented as it doesn't check
that the filesystem 
> is not mounted (but it does check for an active
snapshot which isn't 
> documented either).

No, that's not right. The -y flag *supresses* this check and
others:

     -y         Expert mode.  Usually growfs will ask you if
you have taken
		 a backup of your data and will test whether special is
		 currently mounted.  The -y flag suppresses this, so use
		 this option with great care!

And the snapshot code is in an ifdef FSMAXSNAP code, so it's
built by
default.

-- 
Juan Romero Pardines - xtraeme at gmail|netbsd dot org
	The NetBSD Project

Make your own NetBSD/x86 Live CD:
http://www.n
etbsd.org/~xtraeme/mklivecd/

Re: growfs(8) for NetBSD
country flaguser name
Spain
2008-03-28 10:59:15
On Fri, 28 Mar 2008 16:57:09 +0100
Juan RP <xtraemegmail.com> wrote:

> And the snapshot code is in an ifdef FSMAXSNAP code, so
it's built by
> default.

Erm... "the snaphot code is in an ifdef FSMAXSNAP
block, so it's not built
by default" I meant.

-- 
Juan Romero Pardines - xtraeme at gmail|netbsd dot org

Make your own NetBSD/x86 Live CD:
http://www.n
etbsd.org/~xtraeme/mklivecd/

Re: growfs(8) for NetBSD
country flaguser name
Spain
2008-03-28 11:15:59
On Fri, 28 Mar 2008 16:09:49 +0000 (GMT)
Stephen Borrill <netbsdprecedence.co.uk>
wrote:

> That's not quite what I meant...
> 
> I can't see a check for whether it is mounted that is
skipped by 
> ExpertFlag being 1, i.e. -y doesn't skip the check for
whether it is 
> mounted. In fact, I can't see the check at all.
> 
> > And the snapshot code is in an ifdef FSMAXSNAP
code, so it's built by
> > default.
> 
> In your later mail you say you mean NOT built. But it
includes
> <ufs/ffs/fs.h> which defines FSMAXSNAP.

Ah yes, you are right in both points. We can add the code to
be sure the
partition is not already mounted.

--
Juan Romero Pardines - xtraeme at gmail|netbsd dot org
	The NetBSD Project

Make your own NetBSD/x86 Live CD:
http://www.n
etbsd.org/~xtraeme/mklivecd/

Re: growfs(8) for NetBSD
user name
2008-03-28 11:09:49
On Fri, 28 Mar 2008, Juan RP wrote:
>> On Fri, 28 Mar 2008, Juan RP wrote:
>>> I've just adapted growfs(8) from OpenBSD (they
adapted the FreeBSD code),
>>> which is able to grow FFSv1 and FFSv2
filesystems.
>>>
>>> I tested growing a partition in FFSv1 and FFSv2
from 1GB to 4GB and the
>>> process was smooth (and fast); after this I ran
'fsck_ffs -yf /fs' and it
>>> found one error that was fixed correctly.
>>>
>>> I didn't find any error, so I'd think it should
be safe to use it
>>> everywhere. Also please note that I only tried
it on i386, perhaps it needs
>>> changes for BE and/or LP64 archs.
>>>
>>> http://www.netbsd.org/~xtraeme/growfs-20080328.tar.gz
>>>
>>> Please review and/or test it, thanks!
>>
>> I've not tested it yet, but it appears that the -y
flag (expert mode)
>> doesn't quite behave as documented as it doesn't
check that the filesystem
>> is not mounted (but it does check for an active
snapshot which isn't
>> documented either).
>
> No, that's not right. The -y flag *supresses* this
check and others:

That's not quite what I meant...

I can't see a check for whether it is mounted that is
skipped by 
ExpertFlag being 1, i.e. -y doesn't skip the check for
whether it is 
mounted. In fact, I can't see the check at all.

> And the snapshot code is in an ifdef FSMAXSNAP code, so
it's built by
> default.

In your later mail you say you mean NOT built. But it
includes
<ufs/ffs/fs.h> which defines FSMAXSNAP.

-- 
Stephen


Re: growfs(8) for NetBSD
country flaguser name
Spain
2008-03-28 12:07:00
On Fri, 28 Mar 2008 17:15:59 +0100
Juan RP <xtraemegmail.com> wrote:

> Ah yes, you are right in both points. We can add the
code to be sure the
> partition is not already mounted.

Ok, I added this check (copied from newfs(8)). This now
checks if the
partition is mounted as the manpage states.

Also I merged the changes for LP64 by tnn.

http://www.netbsd.org/~xtraeme/growfs-20080328-1.tar.gz

--
Juan Romero Pardines - xtraeme at gmail|netbsd dot org
	The NetBSD Project

Make your own NetBSD/x86 Live CD:
http://www.n
etbsd.org/~xtraeme/mklivecd/

[1-9]

about | contact  Other archives ( Real Estate discussion Medical topics )