[pve-devel] [PATCH container] Fix: fsck: rbd volume not mapped

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jan 13 18:33:31 CET 2020


On 1/13/20 12:04 PM, Alwin Antreich wrote:
> Signed-off-by: Alwin Antreich <a.antreich at proxmox.com>
> ---
>  src/PVE/CLI/pct.pm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
> index 98e2c6e..9dee68d 100755
> --- a/src/PVE/CLI/pct.pm
> +++ b/src/PVE/CLI/pct.pm
> @@ -247,7 +247,7 @@ __PACKAGE__->register_method ({
>  		die "unable to run fsck for '$volid' (format == $format)\n"
>  		    if $format ne 'raw';
>  
> -		$path = PVE::Storage::path($storage_cfg, $volid);
> +		$path = PVE::Storage::map_volume($storage_cfg, $volid);
>  
>  	    } else {
>  		if (($volid =~ m|^/.+|) && (-b $volid)) {
> @@ -264,6 +264,7 @@ __PACKAGE__->register_method ({
>  		die "cannot run fsck on active container\n";
>  
>  	    PVE::Tools::run_command($command);
> +	    PVE::Storage::unmap_volume($storage_cfg, $volid);

this breaks the "pass block devices directly" case, e.g.:
unable to parse volume ID '/dev/sdb1

only unmap if you mapped but then always.


>  	};
>  
>  	PVE::LXC::Config->lock_config($vmid, $do_fsck);
> 




More information about the pve-devel mailing list