Skip to content

Commit

Permalink
[devices]: Fix arista-convertfs for aligning flash via sfdisk in Jess…
Browse files Browse the repository at this point in the history
…ie (sonic-net#2402)

The sfdisk in Jessie use unit Cylinder by default. To perform 1M
aligning partition, 2048 sector unit is desirable instead.
  • Loading branch information
shawnli-van committed Dec 31, 2018
1 parent 1a84813 commit 2b360c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/initramfs-tools/arista-convertfs.j2
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ umount "$root_mnt"

# Create a new partition table (content in flash_dev will be deleted)
err_msg="Error: repartitioning $flash_dev failed"
cmd="echo '2048' | sfdisk $flash_dev || (sleep 3; blockdev --rereadpt $flash_dev && fdisk -l $flash_dev | grep -q ${root_dev}.*Linux)"
cmd="echo '2048' | sfdisk -u S --force $flash_dev || (sleep 3; blockdev --rereadpt $flash_dev && fdisk -l $flash_dev | grep -q ${root_dev}.*Linux)"
run_cmd "$cmd" "$err_msg"

sleep 5
Expand Down

0 comments on commit 2b360c3

Please sign in to comment.