How to List and Mount Storage Drives in Ubuntu Live

Running Ubuntu from a live USB or DVD is a fantastic way to test the operating system or troubleshoot issues on a computer. However, you'll often need to access files from other storage devices, whether they are internal hard drives, SSDs, or external USB drives. This guide will walk you through the process of listing and mounting these devices within the live environment.

Assumptions

This guide assumes you are already in a live Ubuntu session and have access to the Terminal. It also assumes that the drives you want to access are physically connected to the computer and are not corrupted or encrypted. I will cover basic Linux commands, but I will assume you have a general understanding of how to use a command-line interface. I will cover topics like navigating the filesystem and using the Terminal in future posts!

Step 1: List the Connected Storage Drives

The first step is to identify which device corresponds to the drive you want to access. This could be an internal hard drive (e.g., your Windows or macOS partition) or an external USB drive. I'll use a couple of commands for this.

Method 1: The `lsblk` Command

This is the quickest and easiest way to see all connected block devices (like hard drives and USB drives) and their partitions.

lsblk

The output will look something like this:


NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0 232.9G  0 disk 
├─sda1   8:1    0   19G  0 part /
├─sda2   8:2    0    1G  0 part [SWAP]
└─sda3   8:3    0 212.9G  0 part 
sdb      8:16   1  7.5G  0 disk 
└─sdb1   8:17   1  7.5G  0 part 
sr0     11:0    1 1024M  0 rom  
    

In this example, sda is likely an internal drive (note the larger size and lack of an 'RM' flag). sdb is likely my external drive, indicated by the 'RM' (removable) flag and its smaller size. The partitions I might want to mount are sda3 (for the internal drive) and sdb1 (for the external drive).

Method 2: The `fdisk -l` Command

This command lists the partition tables for all devices. It's a bit more verbose but provides similar information. You'll need to use sudo to run it.

sudo fdisk -l

Look for a device with a size that matches your drive. For instance, a device named /dev/sda with a size of "232.9 GiB" would be a strong indicator of an internal drive.

Step 2: Mount the Storage Drive

Once you've identified your device and its partition (e.g., /dev/sda3 or /dev/sdb1), you can mount it. Mounting makes the drive's contents accessible within the filesystem.

1. Create a Mount Point

A mount point is simply a directory where the contents of the drive will be displayed. A good practice is to create a new directory in the /mnt folder.

sudo mkdir /mnt/storage

You can name the directory anything you like, such as windows_drive, my_usb, or flashdrive.

2. Mount the Device

Now, use the mount command to attach the drive to your newly created mount point.

sudo mount /dev/sda3 /mnt/storage

Remember to replace /dev/sda3 with your specific device partition and /mnt/storage with your chosen mount point.

3. Verify the Mount

To confirm the drive is mounted, run lsblk again.

lsblk

The output should now show the mount point next to your drive's partition:


NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
...
sda      8:0    0 232.9G  0 disk 
├─sda1   8:1    0   19G  0 part /
├─sda2   8:2    0    1G  0 part [SWAP]
└─sda3   8:3    0 212.9G  0 part /mnt/storage
...
    

You can now access your files by navigating to the mount point:

cd /mnt/storage

Step 3: Unmount the Drive (Crucial!)

Before you physically unplug an external drive or shut down the computer, it is very important to unmount it. This ensures all write operations are completed and prevents data corruption.

sudo umount /mnt/storage

You can also unmount by specifying the device name:

sudo umount /dev/sda3

Once the command completes, you can safely remove an external drive or proceed with shutting down the system.


Support My Work

If this blog post helped you, please consider a small donation. Your support helps keep this content free and accessible for everyone. Thank you!

Donate with PayPal

The easiest way to support me is by buying me a coffee through PayPal. It's quick, secure, and uses a trusted platform.

Buy Me a Coffee! or a new Macbook!

Donate with Crypto

You can also support me with cryptocurrency. Just copy the address of your preferred coin below.

Bitcoin
31kpUFfNo8SSq5jidTY9Eihyb9qJS4FPP2
Ethereum
0x32fB1E082EB566bBbca3137a5a17a92db9C880F7
XRP
rsRy14FvipgqudiGmptJBhr1RtpsgfzKMM
XRP Tag
3802858062

Comments

Popular posts from this blog

Self-Hosted Personal Cloud: From Old Laptop to Fully Private Cloud

How to Download AnyFlip Books as PDFs with Anyflip Downloader

Mastering WordPress Multisite in cPanel: A Complete Guide