Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to set a label to my Partitions, I used the e2label and tune2fs command with sudo but it cause the following error

e2label: Bad magic number in super-block while trying to open /dev/sda5 Couldn't find valid filesystem superblock

What is the problem?

share|improve this question
    
I would use a live cd/usb, and use gparted to relabel my partitions. –  medigeek Jun 30 '12 at 13:34
    
There's a good chance that partition does not contain an EXTn filesystem... –  izx Jun 30 '12 at 13:37
add comment

2 Answers

I had this problem while trying to label a newly-created, freshly-formatted partition on a USB stick.

I formatted the file system and then tried to label it using tune2fs -L.

It gave the following error:

tune2fs: Bad magic number in super-block while trying to open /dev/sdb1 Couldn't find valid filesystem superblock.

I transpired that I had used tune2fs while the USB partition was mounted. This corrupted the file system. I couldn't even run fsck on it.

The solution for me was to unmount the drive, delete the partition and start all over again. This time I created the label when I created the file system, using the -L option with mke2fs:

mke2fs -t ext3 -L labelname /dev/sdb1

The drive now appears to be working and it has a label. But I've not tried tune2fs on it again. I was fortunate not to have any data on it. Running fsck, however, provided a suggestion that may have got round the problem.

share|improve this answer
add comment

It seems that the partition has to be formatted in order to use e2label

In my case, I got the same error.

And after formatting, I was able to do it.

share|improve this answer
add comment

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.