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)



jschauma%netmeister.org@localhost (Jan Schaumann) writes:

>Hi,

Hi,

>$ sudo newfs -C 2 /dev/rvnd0a

There is no '-C'. Maybe -O 2 ?

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


>[ back to two '1048576' sized partitions ]

>$ sudo fsck_ffs -y -f /dev/rvnd0b
>[ all ok ]

The 'b' filesystem was probably never changed but maybe trashed in
a way that fsck doesn't understand.


>$ sudo resize_ffs -v /dev/rvnd0b
>No change requested: already 524288 blocks

The superblock and partition agree. Nothing
to do and nothing to check.


>$ sudo fsck_ffs -y -f /dev/rvnd0a
>** /dev/rvnd0a

>CANNOT READ: BLK 2010160
>CONTINUE? yes

The 'a' filesystem still thinks it is 1GB and you try to shrink
it. But the disklabel already restricts access to the lower half.
Any attempt to access data from the upper half fails.


>$ sudo resize_ffs -v /dev/rvnd0a
>resize_ffs: read failed: Invalid argument

Dito. Shrinking requires access to all the data.


>So... how do I shrink a filesystem?

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






Home | Main Index | Thread Index | Old Index