Data Migration for Persistent Partitions#

If the persistent partition data is not compatible in certain cases to migrate from one flashing to another, use the following steps to manually migrate the data to avoid erasing via --init_persistent_partitions.

Manual Data Migration Steps for Special Cases#

Setting Up to Migrate Data

These are common steps to use for backing up data from persistent metadata partition and copying backed up data to persistent metadata partition for both persistent metadata and data partitions.

  1. Enable a WAR in /usr/sbin/nv_init.sh script before it launches driveos-persistence.sh.

#!/bin/bash
...
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'

/bin/bash # <== Please add root shell here to get root prompt for manual data migration.
....
# Persistence service setup
 /bin/bash $DBG_OPTS /usr/sbin/driveos-persistence.sh
sync
....
systemctl --no-block isolate graphical.target || true
  1. Reboot the system.

  2. Wait for the root shell by pressing ENTER until you see the root prompt.

Backing Up from Persistent Partition The steps below enables user to backup the data from persistent partition device <pers_device> to an external storage <ext_storage_dev> (we assume it is an empty ext4 filesystem). The <pers_device> is /dev/vblkdev1 for persistent metadata partition and /dev/vblkdev2 for persistent data partition.

1. Mount persistent partition <pers_device> at /tmp/tmp_mount. Mount external storage <ext_storage_dev> at /tmp/ext_storage. .. code-block:: none

mkdir -p /tmp/tmp_mount /tmp/ext_storage mount <pers_device> /tmp/tmp_mount mount <ext_storage_dev> /tmp/ext_storage

  1. Copy persistent partition data to an external storage device.

cp -a /tmp/tmp_mount/. /tmp/ext_storage/
  1. Unmount the partition.

umount /tmp/tmp_mount /tmp/ext_storage/

Copying backed-up data to Persistent Partition The steps below enables user to copy backed-up data from external storage <ext_storage_dev> to persistent partition device <pers_device> to an (we assume it is an empty ext4 filesystem). The <pers_device> is /dev/vblkdev1 for persistent metadata partition and /dev/vblkdev2 for persistent data partition.

1. Mount persistent partition <pers_device> at /tmp/tmp_mount. Mount external storage <ext_storage_dev> at /tmp/ext_storage. .. code-block:: none

mkdir -p /tmp/tmp_mount /tmp/ext_storage mount <pers_device> /tmp/tmp_mount mount <ext_storage_dev> /tmp/ext_storage

  1. Copy backed-up data from <ext_storage_dev> to persistent partition <pers_device>.

rm -rf /tmp/tmp_mount/* /tmp/tmp_mount/.*
cp -a /tmp/ext_storage/. /tmp/tmp_mount/
  1. Unmount the partition.

umount /tmp/tmp_mount /tmp/ext_storage/

After Migration

Flash the NVIDIA DriveOS™ platform with the 7.2.5.0 SDK.