Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

4 Answers 4

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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