fix #1912: find the partition instead of guessing it
instead of using '$dev1' as partition, get the information from /sys/block/$dev Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
dd1fa860d0
commit
401b56fc54
@ -220,7 +220,12 @@ __PACKAGE__->register_method ({
|
||||
print "# ", join(' ', @$cmd), "\n";
|
||||
run_command($cmd);
|
||||
|
||||
my $part = "${dev}1";
|
||||
my ($devname) = $dev =~ m|^/dev/(.*)$|;
|
||||
my $part = "/dev/";
|
||||
dir_glob_foreach("/sys/block/$devname", qr/\Q$devname\E.+/, sub {
|
||||
my ($partition) = @_;
|
||||
$part .= $partition;
|
||||
});
|
||||
|
||||
# create filesystem
|
||||
$cmd = [$MKFS, '-t', $type, $part];
|
||||
|
||||
Reference in New Issue
Block a user