Command for reporting free/used space on *unmounted* partitions?

5,057

This should work on unmounted discs:

tune2fs -l /dev/sda1

or

parted /dev/sda print al

The latter requires you to install parted ;)

The reason I ask, is that I have several (many!) external hard-drives, and would like to quickly find out which have space left, without jumping through too many hoops (like actually mounting and unmounting them).

As soon as you plug them in they will get mounted(?)

Next to that: how are you suppose to know what device the external disc is on without mounting them?

Share:
5,057

Related videos on Youtube

Baard Kopperud
Author by

Baard Kopperud

Updated on September 18, 2022

Comments

  • Baard Kopperud
    Baard Kopperud over 1 year

    Are there any commands that reports free (or used) space left on unmounted partitions? The partitions will have either NTFS, FAT or Ext2|3|4 filesystems... A bonus would be a program that also reported partitions without filesystems and unpartitioned free-space.

    I'm not after anything complex like gparted, just something giving a quick list of space used/left (like df). Preferably text-based (no GUI or complex CLI, just a list).

    The reason I ask, is that I have several (many!) external hard-drives, and would like to quickly find out which have space left, without jumping through too many hoops (like actually mounting and unmounting them).

    I remember encountering such a program as an utility on the installations disk for some OS (not sure if it was a Linux-distro or not), but can't remember which or what the utility was called.

  • Baard Kopperud
    Baard Kopperud about 11 years
    I think I know how to prevent them from being auto-mounted.
  • emi
    emi about 8 years
    Is there any utility like tune2fs or dumpe2fs which shows usage information, but based on GBs or TBs, not blocks and inodes like these two?
  • jiggunjer
    jiggunjer over 7 years
    tune2fs only works for ext2/3/4, and parted doesn't show the available free space within partitions/volumes.