mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-06 04:36:29 +00:00
correctly remove partitions for ceph bluestore osds
we now have to remove 5 types of partitions: data/metadata journal block block.db block.wal this patch fixes the detection of block/block.db/block.wal generalizes it Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
8d64bd8c3b
commit
bb7d5aa955
@ -386,25 +386,29 @@ __PACKAGE__->register_method ({
|
||||
warn $@ if $@;
|
||||
};
|
||||
|
||||
my $journal_part;
|
||||
my $data_part;
|
||||
my $partitions_to_remove = [];
|
||||
|
||||
if ($param->{cleanup}) {
|
||||
my $jpath = "$mountpoint/journal";
|
||||
$journal_part = abs_path($jpath);
|
||||
|
||||
if (my $fd = IO::File->new("/proc/mounts", "r")) {
|
||||
while (defined(my $line = <$fd>)) {
|
||||
my ($dev, $path, $fstype) = split(/\s+/, $line);
|
||||
next if !($dev && $path && $fstype);
|
||||
next if $dev !~ m|^/dev/|;
|
||||
if ($path eq $mountpoint) {
|
||||
$data_part = abs_path($dev);
|
||||
my $data_part = abs_path($dev);
|
||||
push @$partitions_to_remove, $data_part;
|
||||
last;
|
||||
}
|
||||
}
|
||||
close($fd);
|
||||
}
|
||||
|
||||
foreach my $path (qw(journal block block.db block.wal)) {
|
||||
my $part = abs_path("$mountpoint/$path");
|
||||
if ($part) {
|
||||
push @$partitions_to_remove, $part;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "Unmount OSD $osdsection from $mountpoint\n";
|
||||
@ -413,8 +417,9 @@ __PACKAGE__->register_method ({
|
||||
warn $err;
|
||||
} elsif ($param->{cleanup}) {
|
||||
#be aware of the ceph udev rules which can remount.
|
||||
&$remove_partition($data_part);
|
||||
&$remove_partition($journal_part);
|
||||
foreach my $part (@$partitions_to_remove) {
|
||||
$remove_partition->($part);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user