2

My disk failed and required replacement. I backed up my data on anther disk and the hosting company removed it prior to replacing corrupted disk. Now I have a fresh install (Centos 6.10) and would like to mount the backup disk "sdb". I'm not able to do so as the disk is entirely a single partition. The command doesnt work:

[root@PGE005 ~]# mount -t ext4 /dev/sdb /mnt/disk2
mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Model: ATA MB0500EBNCR (scsi) Disk /dev/sdb: 500GB Sector size (logical/physical): 512B/512B Partition Table: loop

Number Start End Size File system Flags 1 0.00B 500GB 500GB ext4

[root@PGE005 ~]# lsblk -f
NAME   FSTYPE LABEL UUID                                 MOUNTPOINT
sdb    ext4   disk2 2fd32a7c-00f9-4db9-b5bd-139cde166a14
sdc
sdd
sda
├─sda1
├─sda2 ext2         af8372df-bb07-40ec-8f59-65e61576afc0 /boot
├─sda3 swap         ddf30d80-0723-4e66-aa33-52c273e42464 [SWAP]
├─sda4 ext4         076sdr99-13d2-44cf-a230-49c8b3d22c7c /tmp
└─sda5 ext4         3a56e728-b1e7-47a7-bc44-391ea38b8fb6 /

My backup disk is sdb. The hosting provider support said it seems that there is a compatibility issue between the partition formatter and the mounter. I appreciate any support or ideas that will help me mount the backup disk.

Edit:

[root@pge005 ~]# dmesg | tail
EXT4-fs (sdb): couldn't mount RDWR because of unsupported optional features (400)
3
  • It would be helpful to know more about your system prior to the reinstall. OS version, how you created the filesystem on the backup disk and how you mounted it. Nov 11, 2019 at 9:38
  • The suggestion of the error message to look at dmesg could also be helpful. Nov 11, 2019 at 9:38
  • I did the backup by copying entire public_html and mysql folders. Here is the result of dmesg. Edit - will edit the post with dmesg result
    – Tony AS
    Nov 11, 2019 at 9:42

4 Answers 4

3

The message from dmsg is most helpful. I found several posts about this error, the most promising being on unix.se.

Quotes from there:

The error "EXT4-fs : couldn't mount RDWR because of unsupported optional features (400)" is due to different versions between the partition formatter (mkfs.ext4) and the mounter.

You have two options:

a) Either you have to upgrade the mounter program using a newer distro inside the SD-card.

b) or you have to backup the files, reformat the SD-card with the same distro (the same ext4 versions) you are doing the mounting, and after the reformat copy the files again to the SD-card.

The answer with the most upvotes has this additional tip:

The ext4 feature (400) is the new metadata_csum feature. If this feature is enabled and old tools are used to mount the filesystem they will only be able to mount read-only.

(highlight by me).

Since you basically want to restore your backup, I'd give this a try and mount the disk read only.

mount -t ext4 -o ro /dev/sdb /mnt/disk2
3
  • Mounting as read only didn't work. I even tried editing fstab file and rebooting with no success. I previously had Centos 6.9 when I formatted the disk, and now I have 6.10 - Maybe that caused the issue. I will ask the hosting provider to install Centos 6.9. I guess that is the only solution to not lose my backup. Thanks for your help.
    – Tony AS
    Nov 11, 2019 at 10:44
  • If it is failing due to "unsupported optional features", I would like to not use these "optional" features and still load the disk even as read only. I think these are not optional features after all. :(
    – Tony AS
    Nov 11, 2019 at 10:57
  • Try booting a newer version of centos from a USB drive or DVD (live-image). With it you should be able to mount both disks and copy your data. Nov 12, 2019 at 7:14
1

I don't know if this is the source of your problem, but I was able to reproduce this error by creating an ext4 filesystem using mkfs.ext4 v1.43.4 with the 'metadata_csum' feature, and trying to mount that filesystem with the mount found centos-6.10 (mount v2.17.2).

An ext4 fs created with mkfs.ext4 v1.43.4 without the 'metadata_csum' feature, mounted without complaint on centos-6.10.

If the 'metadata_csum' feature is enabled, and you're using a compatible version of dumpe2fs, the feature is listed in dumpe2fs output:

root@debian:~# dumpe2fs /dev/sdb  | grep -i feature
dumpe2fs 1.43.4 (31-Jan-2017)
Filesystem features:      [... snip ...] metadata_csum

With the dumpe2fs found on centos-6.10, this feature shows up as "FEATURE_R10"

[root@centos ~]# dumpe2fs /dev/sdb  | grep -i feature
dumpe2fs 1.41.12 (17-May-2010)
Filesystem features:      [... snip ...] FEATURE_R10

So the first thing I would do is try to mount the backup drive using the current version of Centos. If that works, then copy the data off the drive for safe keeping. (Backup your backup, and do a test restore).

If the 'metadata_csum' feature is enabled, the feature can be removed using a compatible version of tune2fs

# tune2fs -O ^metadata_csum /dev/sdX

In my test environment, removing this feature made the filesystem backwards compatible with Centos-6.10.

And for reference, you can create an ext4 filesystem without this feature:

root@debian:~# mkfs.ext4 -O ^metadata_csum /dev/sdX

In summary I'd like to emphasize that caution is warranted. And that just because you can use tune2fs to remove this feature, doesn't mean you should.

This Reference concerning the ext4 checksum feature says the drive should pass fsck before you use tune2fs... please do not experiment with your only backup.

-1

If you try to mount NFS CIFS you need to install nfs-common / cifs-utils

Otherwise, if it's blank, you need to create a file system:

mkfs.ext4 /dev/sdb1

From user manual:

2.4.5 mkpart

Command: mkpart [part-type fs-type name] start end

Creates a new partition, without creating a new file system on that partition.

4
  • The disk contains a filesystem and contains all backups. Running this would wreck all backups. Nov 11, 2019 at 9:36
  • @Overmind Yes I need to use the data on the disk. Can't afford losing them.
    – Tony AS
    Nov 11, 2019 at 9:47
  • If it already has a FS you need to install the things necessary to read that FS type, as I said in the answer.
    – Overmind
    Nov 11, 2019 at 11:14
  • FSTYPE is ext4. nfs-common can help read that?
    – Tony AS
    Nov 11, 2019 at 12:01
-1

Please try to live boot a host with the backup drive using different linux flavors. Live boot usually map the existing drives without any Hassel if any one the flavor works for you,copy the data to external drive. Then clean install the host with your backup disk and format it. By this it may take some time but it exposes you to less risk.

1
  • My backup drive only contains public_html and mysql folders. No booting can be done from it. I only have it to restore those 2 folders.
    – Tony AS
    Nov 11, 2019 at 10:45

You must log in to answer this question.

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