Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On Ubuntu, I have the link to the partition (e.g. /dev/sda1). I want to know the labels, size,... of that partition.

How can I do that with a command in which the partition's link is a parameter? It is important to use this link in that command.

What about other devices?

share|improve this question
What operating system are you on? – Kusalananda Nov 3 '11 at 11:50
Obviously Linux or a BSD variant... – sinni800 Nov 3 '11 at 12:47
I'm using Ubuntu :) – Hieu M. Nguyen Nov 5 '11 at 14:06
You can obviously grep results from the below commands for your specific label. E.g. df -h | grep "/dev/sda1". – slhck Nov 5 '11 at 14:21
@slhck what about other info? for example label? – Hieu M. Nguyen Nov 5 '11 at 15:53
df -h
fdisk -l

Will both give you different amounts of information on your mounted partitions.

Fdisk will give you more "physical" information like the heads and cylinder count. df will give you size information only.

share|improve this answer
fdisk -lu

in terms of sectors instead of cylinders.

See the man page for fdisk with the command:

man fdisk
share|improve this answer

dumpe2fs will give you that information if it's an E2FS partition (probably works with ext3 too)

share|improve this answer
e2label /dev/sda1; df /dev/sda1

The first part will tell you the label (if any, and assuming its an EXT2/3/4 filesystem), the second the size of the disk and related parameters.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .