Removing btrfs

After having a problem with btrfs on my root partition, I’ve been attempting to switch it to ext4. I tarred the contents of /, reformatted the file system to ext4 and restored the tar (btw, don’t try to tar the contents of .snapshots). I updated the grub menu list and fstab with the new uuid and changed the type in fstab to be ext4.

All this seems to have gone fine, but for some reason when i try to boot to this partition, it still thinks it is btrfs. The boot attempts to run fsck.btrfs on the partition (which it says is successful), then it tries to mount it as btrfs which fails. What am i missing? What else needs to be updated so it knows this partition is now ext4?

Check the content of /etc/fstab


PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
4.6.0 | GeForce GT 420 | 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.4 |
nVidia ION | 3GB Ram

As long as you think that you are infallable in doing those changes and do not post the contents of those files you changed, we will be unable to point you to posible mistakes you made.

Thus you should not say “I changed* fstab*”, but show your fstab (between CODE tags!!! http://forums.opensuse.org/english/information-new-users/advanced-how-faq-read-only/451526-posting-code-tags-guide.html )
Allso “it still thinks it is btrfs” is your interpretation. And we want to know what the exact symptoms are. Thus we can draw our own conclusions.

@martin_helm: thanks. I did update the fstab.

@hcvv: I don’t think I’m infallible, but didn’t want to clutter up the thread with unnecessary information until i knew what would be useful. Here is the information you requested:

Current blkid:

/dev/sda1: LABEL="System Reserved" UUID="E28EC9AD8EC97A95" TYPE="ntfs" 
/dev/sda2: UUID="DA280CFB280CD881" TYPE="ntfs" 
/dev/sda5: UUID="42def5e2-96fe-46a7-9451-d5809a45bf25" TYPE="ext4" 
/dev/sda6: UUID="03c6dad5-0488-4156-88e8-2348eadc367a" TYPE="swap" 
/dev/sda7: UUID="2cee4505-b575-42e1-b4d6-16d89ec83efc" TYPE="ext4" 
/dev/sda8: UUID="c1c501a3-5ef5-4f44-bf20-0462bd6d1b96" UUID_SUB="0c10fcd4-4f58-453d-a393-abf741d2f88f" TYPE="btrfs" 
/dev/sda9: UUID="ABEC-DA7A" TYPE="vfat" 
/dev/sdb1: UUID="ab0f2943-c559-4ca0-bb58-8a332d00e145" TYPE="swap"                                                                             
/dev/sdb2: UUID="165b19c9-b3f5-47e4-bb3c-8b72d3a23633" TYPE="ext4"                                                                             
/dev/sdb5: UUID="732ea08e-65d8-457b-b87e-38c19476998d" TYPE="ext4"                                                                             
/dev/sdb6: UUID="756a1513-c1fd-48ab-ae3c-be1f8aa35d51" TYPE="ext4" 

Original menu.lst

# Modified by YaST2. Last modification on Wed Dec 28 13:23:05 MST 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader

default 0
timeout 8
gfxmenu (hd0,4)/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title Desktop -- openSUSE 12.1 - 3.1.0-1.2
    root (hd0,4)
    kernel /vmlinuz-3.1.0-1.2-desktop root=/dev/disk/by-uuid/57aef9ff-7023-4197-9319-91659fdc1f58 resume=/dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part6 splash=silent quiet showopts vga=0x31a
    initrd /initrd-3.1.0-1.2-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 12.1 - 3.1.0-1.2
    root (hd0,4)
    kernel /vmlinuz-3.1.0-1.2-desktop root=/dev/disk/by-uuid/57aef9ff-7023-4197-9319-91659fdc1f58 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x31a
    initrd /initrd-3.1.0-1.2-desktop

###Don't change this comment - YaST2 identifier: Original name:  Desktop -- openSUSE 11.3 - 2.6.34.10-0.2 (/dev/sdb5)###
title Desktop -- openSUSE 11.3 - 2.6.34.10-0.2 (/dev/sdb5)
    root (hd1,4)
    configfile /boot/grub/menu.lst

###Don't change this comment - YaST2 identifier: Original name: windows 1###
title Windows 7
    rootnoverify (hd0,0)
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: Linux other 2###
title Linux other 2
    rootnoverify (hd1,2)
    chainloader +1

Modified menu.lst

# Modified by YaST2. Last modification on Wed Dec 28 13:23:05 MST 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader

default 0
timeout 8
gfxmenu (hd0,4)/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title Desktop -- openSUSE 12.1 - 3.1.0-1.2
    root (hd0,4)
    kernel /vmlinuz-3.1.0-1.2-desktop root=/dev/disk/by-uuid/2cee4505-b575-42e1-b4d6-16d89ec83efc resume=/dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part6 splash=silent quiet showopts vga=0x31a
    initrd /initrd-3.1.0-1.2-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 12.1 - 3.1.0-1.2
    root (hd0,4)
    kernel /vmlinuz-3.1.0-1.2-desktop root=/dev/disk/by-uuid/2cee4505-b575-42e1-b4d6-16d89ec83efc showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x31a
    initrd /initrd-3.1.0-1.2-desktop

###Don't change this comment - YaST2 identifier: Original name:  Desktop -- openSUSE 11.3 - 2.6.34.10-0.2 (/dev/sdb5)###
title Desktop -- openSUSE 11.3 - 2.6.34.10-0.2 (/dev/sdb5)
    root (hd1,4)
    configfile /boot/grub/menu.lst

###Don't change this comment - YaST2 identifier: Original name: windows 1###
title Windows 7
    rootnoverify (hd0,0)
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: Linux other 2###
title Linux other 2
    rootnoverify (hd1,2)
    chainloader +1

Original fstab:

/dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part6 swap                 swap       defaults              0 0
UUID=57aef9ff-7023-4197-9319-91659fdc1f58 /                    btrfs      defaults              1 1
/dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part5 /boot                ext4       acl,user_xattr        1 2
/dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part9 /common              vfat       users,gid=users,umask=0002,utf8=true 0 0
UUID=c1c501a3-5ef5-4f44-bf20-0462bd6d1b96 /home                btrfs      defaults              1 2
/dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part2 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

Modified fstab:

/dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part6 swap                 swap       defaults              0 0
UUID=2cee4505-b575-42e1-b4d6-16d89ec83efc /                                          ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part5 /boot                ext4       acl,user_xattr        1 2
/dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part9 /common              vfat       users,gid=users,umask=0002,utf8=true 0 0
UUID=c1c501a3-5ef5-4f44-bf20-0462bd6d1b96 /home                                      btrfs      defaults              1 2
/dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part2 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

Why i think it is still trying to use btrfs (I had to hand type this since the boot failed and I had no way to capture the resulting error output nor was it in any logs. Since I am not infallible, please forgive any typos):

Trying manual resume for /dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part6
Invoking user space resume for /dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part6
resume: libgcrypt version 1.5.0
Trying manual resume for /dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part6
Invoking user space resume for /dev/disk/by-id/ata-WDC_WD1001FALS-00J7B0_WD-WMATV5875013-part6
waiting for device /dev/disk/by-uuid/2cee4505-b575-42e1-b4d6-16d89ec83efc to appear: ok
fsck from util-linux 2.20.1
[/sbin/fsck.btrfs (1) – /] fsck.btrfs -a /dev/sda7
fsck succeeded.  Mounting root device read-write
mounting root /dev/disk/by-uuid/2cee4505-b575-42e1-b4d6-16d89ec83efc
mount -o rw, defaults -t btrfs /dev/disk/by-uuid/2cee4505-b575-42e1-b4d6-16d89ec83efc /root
mount: wrong fs type, bad option, bad super block on /dev/sda7
       missing codepage or helper program, or other errror
       in some cases useful info is found in syslog – try
       dmesg | tail or so

Let me know if you need more info. Thanks.

Thanks for all the real info.

Now I am still strugling with checking all those long ids. but what I would do in your case is (at least for a test, I will leave it to you to change back to all the different notations like /dev/disk/by-id/* , /dev/disk/by-uuid/, /dev/sda, UUID=* and maybe more for the same partition after the test) simply use /dev/sda7 for everything and see if that boots normaly. When yes, I would change back to ‘normal’ one by one to see where it goes wrong. When no, we would at least a better human readable bunch of config files.

On 01/16/2012 08:06 PM, EagleSB wrote:
> <snip>
> Modified fstab:
> <snip>
> UUID=c1c501a3-5ef5-4f44-bf20-0462bd6d1b96 /home btrfs defaults 1 2
> <snip>
> Why i think it is still trying to use btrfs (I had to hand type this
> since the boot failed and I had no way to capture the resulting error
> output nor was it in any logs. . .

yes, your logs reflect that it still tries to use btrfs because the
modified fstab still tells it to…


DD
openSUSE®, the “German Engineered Automobiles” of operating systems!

That line you show is about /home. He is talking about his /

On 01/16/2012 09:16 PM, hcvv wrote:
>
> That line you show is about /home. He is talking about his /

DOH!
hmmmmm…i don’t have enough patience right now to give full attention,
but i do note that usually “bad super block” is the kiss of death
blocking all possible advancement to a smile.


DD http://tinyurl.com/DD-Caveat
openSUSE®, the “German Engineered Automobiles” of operating systems!

On 2012-01-16 02:36, EagleSB wrote:

> All this seems to have gone fine, but for some reason when i try to
> boot to this partition, it still thinks it is btrfs. The boot attempts
> to run fsck.btrfs on the partition (which it says is successful), then
> it tries to mount it as btrfs which fails. What am i missing? What
> else needs to be updated so it knows this partition is now ext4?

You need to redo the boot image. There is a copy of fstab inside (the old one).

Run “mkinitrd” as root.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

As requested, same error.

New fstab

/dev/sda6 swap                 swap       defaults              0 0
/dev/sda7 /                    ext4       acl,user_xattr        1 1
/dev/sda5 /boot                ext4       acl,user_xattr        1 2
/dev/sda9 /common              vfat       users,gid=users,umask=0002,utf8=true 0 0
/dev/sda8 /home                btrfs      defaults              1 2
/dev/sda2 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

New menu.lst

# Modified by YaST2. Last modification on Wed Dec 28 13:23:05 MST 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader

default 0
timeout 8
gfxmenu (hd0,4)/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title Desktop -- openSUSE 12.1 - 3.1.0-1.2
    root (hd0,4)
    kernel /vmlinuz-3.1.0-1.2-desktop root=/dev/sda7 resume=/dev/sda6 splash=silent quiet showopts vga=0x31a
    initrd /initrd-3.1.0-1.2-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 12.1 - 3.1.0-1.2
    root (hd0,4)
    kernel /vmlinuz-3.1.0-1.2-desktop root=/dev/sda7 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x31a
    initrd /initrd-3.1.0-1.2-desktop

###Don't change this comment - YaST2 identifier: Original name:  Desktop -- openSUSE 11.3 - 2.6.34.10-0.2 (/dev/sdb5)###
title Desktop -- openSUSE 11.3 - 2.6.34.10-0.2 (/dev/sdb5)
    root (hd1,4)
    configfile /boot/grub/menu.lst

###Don't change this comment - YaST2 identifier: Original name: windows 1###
title Windows 7
    rootnoverify (hd0,0)
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: Linux other 2###
title Linux other 2
    rootnoverify (hd1,2)
    chainloader +1

New error output (hand entered, so forgive any typos)

Trying manual resume for /dev/sda6
Invoking user space resume for /dev/sda6
resume: libgcrypt version 1.5.0
Trying manual resume for /dev/sda6
Invoking user space resume for /dev/sda6
waiting for device /dev/sda7 to appear: ok
fsck from util-linux 2.20.1
[/sbin/fsck.btrfs (1) – /] fsck.btrfs -a /dev/sda7
fsck succeeded.  Mounting root device read-write
mounting root /dev/sda7
mount -o rw, defaults -t btrfs /dev/sda7 /root

mount: wrong fs type, bad option, bad super block on /dev/sda7
       missing codepage or helper program, or other errror
       in some cases useful info is found in syslog – try
       dmesg | tail or so

@DenverD. When you have a file system type X and then mount it saying to the system it is of type Y, it is very logical that this goes wrong from the very beginning: interpreting the superblock. Thus when, as in this case, one sees that the system tries to mount as btrfs (for a reason we do not understand at the moment) what is in fact an ext4, the “wrong superblock” is what you would expect. Would be strange if it wasn’t.

@EagleSB. While this does not bring us a mounted /, t think it does tell us something: none of the congig file we are looking at at the moment is in fact wrong. We have to think up something fresh.

What about booting with Sysvinit instead of systemd? I admit it is just a jump in the darkness, but as it could have something to do with things that happen to early, systemd is the usual suspect.

And yes, I guess you should try Carlos’ suggeestion first. Looks very promissing to me.

Interesting. I didn’t know initrd did that. Since I’m running on a different install on sdb (can’t get into sda right now), I’d like to confirm the syntax for mkinitrd before I cause more damage. Would it be “mkinitrd -b /dev/sda5 -d /dev/sda7”?

On 2012-01-16 22:46, EagleSB wrote:

> Interesting. I didn’t know initrd did that. Since I’m running on a
> different install on sdb (can’t get into sda right now), I’d like to
> confirm the syntax for mkinitrd before I cause more damage. Would it be
> “mkinitrd -b /dev/sda5 -d /dev/sda7”?

It is not the first time I see those symptoms, I had a bugzilla on that
thing. Lets me see, the way I regenerate that file is by booting from
rescue, chrooting the work partition, and run the command without parameters.

“-b” would need the /boot path, not the device. Assuming you have mounted
your sda on /mnt, it would be “-b /mnt/boot”. And “-d” would be “-d
/dev/sdaSOMETHING”, if I’m not confused. I can’t say 5 or 7, it is wherever
is your /boot partition. Or root.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Thanks Carlos, you were correct about the initrd. I am now back into my 12.1 image. Here are the steps I followed in case it helps others in the future. This is obviously based on my configuration.

First, boot into the rescue DVD, then at the command prompt:

cd /
mount /dev/sda7 /mnt
mount /dev/sda5 /mnt/boot
mount --bind /dev /mnt/dev
chroot /mnt
mount /proc
mount /sys
mkinitrd

I found some of the instructions embedded in the man pages for mkinitrd. Thanks everyone for your help with this and for helping me learn a bit more about linux.

On 2012-01-17 00:36, EagleSB wrote:
> I found some of the instructions embedded in the man pages for
> mkinitrd. Thanks everyone for your help with this and for helping me
> learn a bit more about linux.

Welcome :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 01/17/2012 12:36 AM, EagleSB wrote:
> Thanks Carlos, you were correct about the initrd.

nice going Carlos!! you da man! (and i was clueless)


DD http://tinyurl.com/DD-Caveat
openSUSE®, the “German Engineered Automobiles” of operating systems!

You are welcome.

And yes, we should have thought earlier about the fact that the root file system is mounted read-only in a very early stage of the boot process. Even before it can read /etc/fstab (because that is in the un-mounted root partition, chicken/egg). And then we should have made the jump to: “and where is that early mount configured?”

Thanks Carlos.

On 2012-01-17 08:34, DenverD wrote:
> On 01/17/2012 12:36 AM, EagleSB wrote:
>> Thanks Carlos, you were correct about the initrd.
>
> nice going Carlos!! you da man! (and i was clueless)

Thanks (blush). As I said, I had that same problem years ago, using
reiserfs and ext3, and I wrote a bugzilla (577798). It took the experts
some time to figure out mkinitrd was the culprit. And not a bug, but a
feature! Actually… looking at the report, they did not. So I do not
remember how this was found out.

So I just had to remember that issue.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)