diff --git a/files/initramfs-tools/union-mount.j2 b/files/initramfs-tools/union-mount.j2 index 1008148cd008..9152260c1ff6 100644 --- a/files/initramfs-tools/union-mount.j2 +++ b/files/initramfs-tools/union-mount.j2 @@ -167,7 +167,13 @@ mount --bind ${rootmnt}/host/$image_dir/boot ${rootmnt}/boot if $logs_inram; then # NOTE: some platforms, when reaching initramfs stage, have a small # limit of mounting tmpfs partition, potentially due to amount - # of RAM available in this stage. e.g. Arista 7050-qx32[s] and 7060-cx32s + # of RAM available in this stage. Therefore limiting the size + # set for tmpfs partitions. + # + # Another reason for using tmpfs /var/log partition is: + # Some platforms have a small flash and therefore the log partition takes valuable space. + # To improve the longevity of these devices storing the logs in memory will permit more + # SONiC image growth before being bottlenecked. set_tmpfs_log_partition_size mount -t tmpfs -o rw,nosuid,nodev,size=${varlogsize}M tmpfs ${rootmnt}/var/log if [ -f ${rootmnt}/host/disk-img/var-log.ext4 ]; then @@ -176,8 +182,6 @@ if $logs_inram; then else if [ -f ${rootmnt}/host/disk-img/var-log.ext4 ]; then fsck.ext4 -v -p ${rootmnt}/host/disk-img/var-log.ext4 2>&1 | gzip -c >> /tmp/fsck.log.gz - fi - if [ -f ${rootmnt}/host/disk-img/var-log.ext4 ]; then mount -t ext4 -o loop,rw ${rootmnt}/host/disk-img/var-log.ext4 ${rootmnt}/var/log fi fi