NetBSD-Users archive

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

Re: shrinking a filesystem using resize_ffs(8)



Michael van Elst <mlelstv%serpens.de@localhost> wrote:
> jschauma%netmeister.org@localhost (Jan Schaumann) writes:

> >$ sudo newfs -C 2 /dev/rvnd0a
>
> There is no '-C'. Maybe -O 2 ?

Yes. :-)

> But resize_ffs doesn't support shrinking FFS2 and should
> complain when you try.

> You tell resize_fsck the new size with -s and then
> reduce the partition size accordingly.

Ah, the order is first resize_ffs, then update the
disklabel.  So the order is:

$ sudo newfs -O 1 vnd0a  # start out with 1GB
/dev/rvnd0a: 1024.0MB (2097152 sectors) block size
16384, fragment size 2048
        using 6 cylinder groups of 170.67MB, 10923 blks, 21504 inodes.
super-block backups (for fsck_ffs -b #) at:
33, 349568, 699104, 1048640, 1398176, 1747712,
$ sudo resize_ffs -s 1048576 /dev/rvnd0a  # shrink to 512MV
$ sudo disklabel -e vnd0                  # adjust disklabel
$ sudo mount /dev/vnd0a /mnt
$ df -h /mnt
Filesystem         Size       Used      Avail %Cap Mounted on
/dev/vnd0a         504M       2.0K       479M   0% /mnt
$ 

Nice, that works.

Thanks!
-Jan


Home | Main Index | Thread Index | Old Index