How do I find the remaining space on an External Drive?
Linux doesn't differentiate between external and internal drives in any obvious way* – so you'll need to get a bit sneaky to get what you want.
Let's start with the most common scenario – you're running a desktop Linux install, and the drive was mounted for you by some helper program – in which case your drive might have a mount point that looks like /media/username/disklabel/
.
If you mounted it manually, you'd know the location – and generally this would be under /media/
or, if you're doing it old-school, /mnt/
.
So, if you start with:
df -h
… which would give you Disk Free, Human readable, and filtered the output to any entry whose Mounted on
column pointed at an obvious location for external drives, like /media/
, you have a good chance of finding the amount of disk free for just your external drives.
* On some older kernels, with the older ATA driver, PATA hard drives were denoted by /dev/hdX
and most other drives were treated as SCSI drives with a /dev/sdX
designation. On a system with no SCSI or SATA drives, there was a good chance external USB drives would be under /dev/sdX
. Modern kernels however treat everything as a SCSI drive.
Related videos on Youtube
ion
Updated on September 18, 2022Comments
-
ion almost 2 years
Through terminal on Linux, what exactly would I type to find External HDDs and their remaining storage space?
-
Java Girl over 10 yearsyou can use df -h
-
ion over 10 yearsThanks you Scandalist, your help is appreciated greatly.
-
nerdwaller over 10 years@Scandalist - Why not make that an answer?
-
nerdwaller over 10 yearsSorry for the downvote, however the site's defined reason for the button is: "This question does not show any research effort; it is unclear or not useful (click again to undo)" (emphasis added).
-
9A4Sc6GW4LkvRD almost 5 yearsWindows OS > WinSCP > select everything > Properties. Sorry, but I have tried all variations of df after being told that my drive was full and found that every answer returned was completely and totally inaccurate, and that I actually have plenty of free space on both by main drive and the USB drive.
-