Skip to content

Q&A · Answered

How to mount and unmount drives on Linux

asked 9 months, 1 week ago 2318 views 1 answer
15

I connected a new drive. How do I mount it and access the files?

1 Answer

One accepted
22

Accepted answer

Not confirmed since it was written, 9 months, 1 week ago
# List available drives
lsblk
fdisk -l

# Create mount point
sudo mkdir /mnt/mydrive

# Mount drive
sudo mount /dev/sdb1 /mnt/mydrive

# Unmount
sudo umount /mnt/mydrive

# Auto-mount on boot (add to /etc/fstab)
/dev/sdb1 /mnt/mydrive ext4 defaults 0 2

Your answer

Say what you tried, not only what worked — the next person needs the reasoning. Code goes in a fenced block.

Shown beside your answer and never checked, so it cannot be a name someone already has here.

No account needed to answer. Sign in instead and it carries your name and earns reputation.