1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-09 09:57:26 +03:00

growfs: Expand FS even if underlying block expansion fails

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
```

(cherry picked from commit e9a28b8ccd3352da3e0a75a18fc1185e52476a80)
(cherry picked from commit 378e187ed49d28fed2adfb4848f89aa438854f28)
This commit is contained in:
undef 2022-07-14 09:03:28 +00:00 committed by Zbigniew Jędrzejewski-Szmek
parent e39019fd10
commit 71e8f6de62

View File

@ -222,7 +222,7 @@ static int run(int argc, char *argv[]) {
r = maybe_resize_underlying_device(arg_target, devno);
if (r < 0)
return r;
log_warning_errno(r, "Unable to resize underlying device of \"%s\", proceeding anyway: %m", arg_target);
mountfd = open(arg_target, O_RDONLY|O_CLOEXEC);
if (mountfd < 0)