Copying Files to a USB Drive

This guide is about copying files from a CAT loaded Linux computer to a thumb drive physically connected to the machine.

 

Using a File Explorer

This is the graphical way to copy over your files if you aren’t super Linux or terminal savvy.

First, make sure you’re logged into a CAT Linux computer and your USB stick is plugged into a USB port on the machine.

Click into the application launcher menu in the bottom left hand corner of the screen (it looks like a 3 by 3 grid of dots).

A red arrow pointing to the bottom left side of the ubuntu main screen.

Click the search bar at the top of the screen now, and type in the word “Dolphin” and press enter to open the Dolphin file explorer.

The Ubuntu application menu

"Dolphin" being searched in the Ubuntu application menu

Once that program has opened, scroll to the bottom of the left section until you find the “Removable Devices” section at the bottom of the list. In that section you will be able to find the USB stick you have plugged in.

  • If you are unable to find the “Removable Devices” section, try removing your USB stick from the machine and plugging it back in

An arrow pointing to the "Removable Devices" section of Dolphin

Click your USB stick in that section.

View of an external USB drive in Ubuntu

From here, you will be able to drag and drop folders and files from the Linux machine you are sitting at to the USB stick you have opened.

  • When you drag a file or folder over to the USB, be sure to click the option “Copy Here” to copy your files to the USB drive. You can also click “Cancel” if you accidentally dragged a file or folder to the USB that you actually don’t want copied to the USB.

A folder from one dolphin instance is being dragged onto another to copy the folder

After you’re done copying all the files and folders you want:

  1. Right click your USB drive in Dolphin.
  2. Select “Safely Remove”.
  3. Now you can safely remove your USB stick from the machine

 

Using the Terminal

If you know more about the terminal, then you can go about using this method.

NOTE: The terminal has NO SAFE GUARDS on what you do with your files! Please be careful with theĀ  commands you enter because you can’t take back any actions that you do! If you accidentally delete important files from your Linux account, email support@cat.pdx.edu and we can try and restore those files for you.

First, make sure you’re logged into a CAT Linux computer and your USB stick is plugged into a USB port on the machine.

Then, click into the application launcher menu.

A red arrow pointing to the bottom left side of the ubuntu main screen.

Click the search bar at the top, type the word “Terminal” and press enter to open a terminal.

The Ubuntu application menu

"Terminal" in the search bar of the Ubuntu Application Menu

Type in lsblk, and try to find what your USB stick is called here. In this picture, the USB stick is named sdc1.

The output of the lsblk command in the Ubuntu Terminal

Next, you have to “mount” the USB stick to the computer so that you can look at it’s contents. To do this, run

udisksctl mount --block-device /dev/<usb_name>

where <usb_name> is the name of your USB stick that you found with lsblk earlier. In the picture below, the command would be udisksctl mount --block-device /dev/sdc1 but it could be different for you.

Running the command to mount an external USB drive via the Ubuntu Terminal

That command will return the place the USB stick is attached to the machine, which should be something like

/media/<username>/<usb>

where <username> is your MCECS username, and <usb> is the chosen name of the USB stick (different from the <usb_name> from before) which is, in that picture,

/media/anyuser/KEEPS

To copy files to that location, you can run the command

cp path/to/file /media/<username>/<usb>

and to copy folders to that USB, you can run the command

cp -r path/to/folder/ /media/<username>/<usb>

where path/to/file is the path to the file you want to copy to the USB, and path/to/folder/ is the path to the folder you want to copy.

Copying a folder to a USB drive via the Ubuntu terminal

Once you are finished copying the items you want to the USB, you should run the command

udisksctl unmount --block-device /dev/<usb_name>

to “unmount” the USB from the computer so that you can safely remove it.

Unmounting an external USB drive via the Ubuntu Terminal

Once that command finishes running, you can safely unplug your USB stick from the machine with all your files and folders you want!