]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
growfs: Expand FS even if underlying block expansion fails
authorundef <gitlab@undef.tools>
Thu, 14 Jul 2022 09:03:28 +0000 (09:03 +0000)
committerLennart Poettering <lennart@poettering.net>
Thu, 14 Jul 2022 16:13:23 +0000 (18:13 +0200)
This allows growfs to expand the filesystem even when the underlying
block device cannot be expanded. This has been useful for example on
LUKS devices that have already been expanded using systemd-repart.

This works around the following error:
```
root@mobian:/home/mobian# /usr/lib/systemd/systemd-growfs /
crypt_resize() of /dev/block/179:2 failed: Operation not permitted
```

src/partition/growfs.c

index 3d46efa51ce24a44d68e96f0ac3fb3fb2e8c087e..e105c0e151a56ea0f58827c13b407b7f5c913ae2 100644 (file)
@@ -235,7 +235,7 @@ static int run(int argc, char *argv[]) {
 
         r = maybe_resize_underlying_device(mountfd, arg_target, devno);
         if (r < 0)
-                return r;
+                log_warning_errno(r, "Unable to resize underlying device of \"%s\", proceeding anyway: %m", arg_target);
 
         r = device_path_make_major_minor(S_IFBLK, devno, &devpath);
         if (r < 0)