Skip to content

Commit 927974f

Browse files
rhvgoyalrh-atomic-bot
authored andcommitted
Fix sfdisk failure on older sfdisk
We used to use following input file for sfdisk. units:sectors {dev}1: start=2048, size=4096, Id=8e And this worked both with old and new sfdisk. But this required hardcoding partition name and we wanted to move away from that as it did not work for pmem and loop devices. So we started using following format instead. units:sectors start=2048, size=4096, Id=8e As per latest sfdisk man page this should work but it does not seem to work with sfdisk shipped with older util-linux (util-linux-2.23.2-33), and we get errors like following. sfdisk: trailing junk after number sfdisk: bad input But following format seems to work with old sfdisk format. So switch to using that one. units:sectors 2048, 4096, 8e Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Closes: #246 Approved by: rhvgoyal
1 parent 9b77bcb commit 927974f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

container-storage-setup.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,8 +821,7 @@ create_partition_sfdisk(){
821821
size=$(( $( awk "\$4 ~ /"$( basename $dev )"/ { print \$3 }" /proc/partitions ) * 2 - 2048 ))
822822
cat <<EOF | sfdisk $dev
823823
unit: sectors
824-
825-
start= 2048, size= ${size}, Id=8e
824+
2048,${size},8e
826825
EOF
827826
}
828827

0 commit comments

Comments
 (0)