Skip to content

Transferring Data to an External Disk

This guide details the recommended procedure for copying large ROS bags from the SMapper's internal storage to an external USB disk. This method is significantly faster than downloading files through the web application, especially for large datasets.

Prerequisites

  • An external USB disk, preferably formatted with a Linux-native filesystem like ext4 to support file permissions correctly.

Step 1: Identify the External Disk

Before mounting, you must correctly identify the device path for your external disk. Using the wrong path can lead to data loss.

  1. Connect the external disk to one of the device's USB ports.

  2. Run the lsblk (list block devices) command to see all connected storage devices.

    lsblk
    
  3. Examine the output to find your disk. You can typically identify it by its SIZE and NAME. New devices usually appear as /dev/sda, /dev/sdb, etc. The partition you want to mount will be listed underneath, such as /dev/sda1.

    ```
    Example Output:
    
    NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    ...
    sda           8:0    0   1.8T  0 disk
    └─sda1        8:1    0   1.8T  0 part
    nvme0n1     259:0    0 465.8G  0 disk
    ├─nvme0n1p1 259:1    0   100M  0 part /boot/efi
    ...
    ```
    

    In this example, the internal drive is nvme0n1, and the 1.8TB external disk is sda, with the partition to mount being /dev/sda1.

    Note

    Throughout this guide, we will use /dev/sda1 as an example. Replace it with the actual device path you identified.

Step 2: Create a Mount Point

Note

This step only needs to be performed once

A mount point is the directory where the files on your external disk will be accessible. We will create a dedicated directory for this purpose.

Create the directory:

sudo mkdir -p /media/smapper/smapper_ssd

Set the correct permissions. This command changes the directory's owner to the default user (UID 1000), allowing you to read and write files without using sudo for every operation.

sudo chown 1000:1000 -R /media/smapper/smapper_ssd

Step 3: Mount the Disk

Now, attach the external disk's filesystem to the mount point you just created.

sudo mount /dev/sda1 /media/smapper/smapper_ssd

You can verify that the disk is mounted correctly by running lsblk again or by using the df -h command.

Step 4: Copy Your Data

You can now copy your ROS bags to the external disk. The bags are typically stored in /bags.

Step 5: Safely Unmount the Disk

Warning

This is a critical step. You must unmount the disk before unplugging it. Failing to do so can result in incomplete file transfers and data corruption.

Run the umount command to safely detach the disk from the filesystem.

sudo umount /media/smapper/smapper_ssd

After the command completes without errors, you can safely unplug the external disk.