2

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?

2
  • I would use a live cd/usb, and use gparted to relabel my partitions. Jun 30, 2012 at 13:34
  • There's a good chance that partition does not contain an EXTn filesystem...
    – ish
    Jun 30, 2012 at 13:37

2 Answers 2

3

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.

1
  • I didn't have these tune2fs issues, and I just had to umount the device
    – nealmcb
    Mar 19, 2017 at 18:23
0

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.

You must log in to answer this question.

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