Skip to content

Commit 6ba2f97

Browse files
Staphylolguohan
authored andcommitted
[devices]: Align flash partition at 1M (sonic-net#2104)
Flashes used for the 7050QX-32 and 7050QX-32S have a fw issue. The best option to solve the problem is to upgrade to a newer firmware. However this can only be done while in memory and take 10 seconds. Adding an upgrade mechanism is possible but would need more consideration as flashing the firmware and reformating the flash will exceed the fast-reboot requirements. A quick mitigation is to align the ext4 partition that we create on these vfat based system on a 4k boundary. Here we chose 1M instead but it's the same. Newer version of sfdisk do this automatically but the one in SONiC today doesn't have this behavior. This workaround will only reduce the pace of the flash health degradation. The only long term fix is to flash the firmware.
1 parent dedd562 commit 6ba2f97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

files/initramfs-tools/arista-convertfs.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ umount "$root_mnt"
175175
if [ $(echo -n "$root_dev" | tail -c 1) == "1" ]; then
176176
# Create a new partition table (content in flash_dev will be deleted)
177177
err_msg="Error: repartitioning $flash_dev failed"
178-
cmd="echo ';' | sfdisk $flash_dev || (sleep 3; blockdev --rereadpt $flash_dev && fdisk -l $flash_dev | grep -q ${root_dev}.*Linux)"
178+
cmd="echo '2048' | sfdisk $flash_dev || (sleep 3; blockdev --rereadpt $flash_dev && fdisk -l $flash_dev | grep -q ${root_dev}.*Linux)"
179179
run_cmd "$cmd" "$err_msg"
180180
fi
181181

0 commit comments

Comments
 (0)