Skip to content

Commit

Permalink
Fix Bug #831327: Device name issue when using btrfs on nVME device
Browse files Browse the repository at this point in the history
  • Loading branch information
KerimG authored and Thomas Lange committed Sep 15, 2016
1 parent 57760d4 commit c16d1a4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/setup-storage/Commands.pm
Expand Up @@ -322,7 +322,11 @@ sub build_btrfs_commands {
$FAI::configs{$config}{volumes}{$volume}{mount_options} = $FAI::configs{$c}{partitions}{$p}{mount_options};
$FAI::configs{$c}{partitions}{$p}{mount_options} = '-';
$FAI::configs{$config}{volumes}{$volume}{fstabkey} = $FAI::configs{$c}{fstabkey};
$FAI::configs{$config}{volumes}{$volume}{devices}{$device . $p} = {};
if ($device =~ m|^/dev/nvme|) {
$FAI::configs{$config}{volumes}{$volume}{devices}{$device . "p" . $p} = {};
} else {
$FAI::configs{$config}{volumes}{$volume}{devices}{$device . $p} = {};
}
$FAI::configs{$config}{opts_all} = {};
$single_vol_index++;
}
Expand All @@ -332,7 +336,7 @@ sub build_btrfs_commands {
next unless ($config eq "BTRFS");

#create BTRFS RAIDs
foreach my $id (&numsort(keys %{ $FAI::configs{$config}{volumes} })) {
foreach my $id (keys %{ $FAI::configs{$config}{volumes} }) {
#reference to current btrfs volume
my $vol = (\%FAI::configs)->{$config}->{volumes}->{$id};

Expand All @@ -352,6 +356,9 @@ sub build_btrfs_commands {
$tmp =~ s/\d//;
$pre_req = "${pre_req}pt_complete_${tmp}," unless ($pre_req =~ m/pt_complete_$tmp/);
}
if (scalar @devs == 1) {
$pre_req = "exist_" . $devs[0];
}
# creates the BTRFS volume/RAID
if ($raidlevel eq 'single') {
&FAI::push_command("mkfs.btrfs -d single $createopts ". join(" ",@devs),
Expand Down

0 comments on commit c16d1a4

Please sign in to comment.