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?

link|improve this question

29% accept rate
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 :) – Minh Hieu 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? – Minh Hieu Nov 5 '11 at 15:53
feedback

3 Answers

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.

link|improve this answer
feedback
fdisk -lu

in terms of sectors instead of cylinders.

See the man page for fdisk with the command:

man fdisk
link|improve this answer
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.