Re: Extending file system after enlarging a logical volume
-----BEGIN PGP SIGNED MESSAGE-----
On Mon, Oct 03, 2016 at 04:24:42PM -0400, Ken Heard wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> In my jessie box I need to increase the non-encrypted root partition
> (/) size from 14G to 19G. I was able successfully to increase the
> logical volume (and decrease the space available in the volume group
> accordingly) but am not sure how to do the next step.
> The following command produced the result shown.
> root@BDS:~# fsadm resize /dev/BDS1/root
> resize2fs 1.42.12 (29-Aug-2014)
> Filesystem at /dev/mapper/BDS1-root is mounted on /; on-line resizing
Online resizing means "resizing a mounted file system". This is possible
(for ext*), as long as you are growing, not shrinking. But that's your
> old_desc_blocks = 1, new_desc_blocks = 2
> resize2fs: Read-only file system While checking for on-line resizing
> fsadm: Resize ext4 failed
That's because your / partition is mounted read-only. This might be
because there were some errors at mount, so perhaps running a file
system check (fsck.ext4) might be a good idea.
If you *know* your file system is OK, you could try to remount it
mount -orw,remount /dev/mapper/BDS1-root /
then resizing should work.
> Does the phrase "on-line resizing required" mean that I have to
> unmount /dev/BDS1/root, then run the fsadm command and finally remount
> /dev/BDS1/root? Is unmounting the basic partition (/) safe while
> presumably some of the files there are being used by the computer?
No, see above. And you can't umount / (you'd get an error stating
that the file system is busy. / is always busy).
> I think I read somewhere that to resize an ext4 partition did not
> require unmounting it. Perhaps it it is required.
Only for shrinking. In that case you'd have to mount the file system
from "another running system", e.g a rescue system.
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
-----END PGP SIGNATURE-----