Listing Devices Using Linux Derivative Kubuntu

Dolphin File Manager screenshot
Dolphin File Manager.

For those of you unaware, Kubuntu is a version of the Ubuntu Linux distribution, and it comes with the KDE Plasma desktop as the default desktop environment, as opposed to Ubuntu Linux, which has the Unity desktop environment. (If you are using Ubuntu you can follow this guide to find out how to mount DVDs.) Here, you'll learn how to mount DVDs and USB drives using Kubuntu and Dolphin. You'll also learn how to list and mount devices using the command line.

Listing Mounted Devices Using Dolphin

Generally when you insert a USB drive or DVD whilst running Kubuntu and window will appear asking what you want to do with it. One of the options is to open the file manager, which in Kubuntu, is Dolphin.

Dolphin is a file manager much like Windows Explorer. The window is split into various panels. On the left is a list of places, recently saved files, search options and most importantly in regards to this guide a list of devices.

Generally, whenever you insert a new device it will appear in the devices list. You can view the contents of the device by clicking on it. The sort of devices you will see are DVD drives, USB drives, external hard drives (which are essentially still USB drives), audio devices such as MP3 players and other partitions such as a Windows partition if you are dual booting.

You can reveal a list of options for each device by right-clicking on its name. The options differ depending on the device you are looking at. For example, if you right-click on a DVD the options are as follows:

  • Eject
  • Release
  • Add an entry in places
  • Open in a new tab
  • Hide
  • Change icon size
  • Unlock panels

The bottom two options are more generic and apply on all context menus. The eject option obviously ejects the DVD and you can then remove and insert a different DVD. If you have opened the DVD and you are viewing the contents then you will be using the device. This may cause issues if you try and delete files from a folder that you are currently viewing. The release option releases the DVD from Dolphin so that it can be accessed fully elsewhere.

If you choose to add the entry to places, then the DVD will appear under the places category within Dolphin. Open in a new tab opens the contents in a new tab within Dolphin and hide does exactly what you would expect and hides the DVD from view. You can reveal hidden devices by right clicking on the main panel and choosing "show all entries." The options for other devices differ slightly. For example, your Windows partition will have the following options:

  • Unmount
  • Open in new tab
  • Hide

The main difference is that unmount is included, which has the effect of unloading it within Linux. Therefore you won't be able to see or access the contents on the partition.

USB drives have safely remove device instead of unmount, and this is the preferred method of removing a USB device. You should choose this option before pulling a USB drive out because it can prevent corruption and data loss if something is writing or reading from the device as you are pulling it out.

If you have unmounted a device you can mount it again by double-clicking on it—and you can access a USB device that has been removed in the same way. (Assuming you haven't physically removed it).

Mounting Devices Using The Linux Command Line

To mount a DVD using the command line you need to create a location for the DVD to be mounted to.

The best place to mount devices such as DVDs and USB drives is the media folder. 

First things first, open a terminal window and create a folder as follows:

sudo mkdir /media/dvd

To mount the DVD run the following command:

sudo mount /dev/sr0 /media/dvd

You can now access the DVD by navigating to /media/DVD using either the command line or Dolphin.

You may be wondering what sr0 is? Well if you navigate to the /dev folder and run the ls command you will see a list of devices.

One of the devices listed will be DVD. Run the following command:

ls -lt dvd

You will see the following result:

dvd -> sr0

The DVD device is a symbolic link to sr0. You can, therefore, use either of the following commands to mount the DVD.

sudo mount /dev/sr0 /media/dvd

sudo mount /dev/dvd /media/dvd

To mount a USB device you need to know which devices are available.

The lsblk command will help you list block devices but they have to already be mounted. The lsusb command will show you a list of USB devices.

If you navigate to /dev/disk/by-label and run the ls command you will see the name of the device you will wish to mount.

cd /dev/disk/by-label
ls -lt

The output will be something like this:

  • new volume -> ../../sdb1
  • dvd -> ../../sr0

Now we know that sr0 was theDVDd from earlier and you can see that new volume is the name of a USB device which is called sdb1.

To mount the USB all I have to do is run the following 2 commands:

sudo mkdir /media/usb
sudo mount /dev/sdb1 /media/usb

How To Unmount Devices Using The Linux Command Line

This is much easier.

Use the lsblk command to list the block devices. The output will be something like this:

  • /media/usb
  • /media/dvd

To unmount the devices run the following commands:

sudo umount /media/dvd
sudo umount /media/usb