You are not logged in.

#1 2012-12-31 13:42:26

Denzo
Member
Registered: 2009-07-03
Posts: 18

Problems converting root ext4 partition to btrfs

Hello there,

I just installed Arch a few days ago and without thinking I chose ext4, because I forgot about btrfs.
After I was done configuring my system, I suddenly remembered this. So I tried converting my laptop to btrfs with the following steps:

1) Boot my system with the Arch livecd.
2) modprobe btrfs
3) fsck.ext4 on /dev/sda4
4) btrfs-convert /dev/sda4
4) mount /dev/sda4 and edit fstab and change ext4 to btrfs
5) chroot into /dev/sda4 and run grub-mkconfig -o /boot/grub/grub.cfg
6) exit chroot, umount and reboot.

This all worked fine without problems, but when I rebooted, grub gives me an unknown filesystem error. That was a bummer. Luckily btrfs-convert contains a rollback function, so I had no problems reverting to the original state without restoring a backup.

I tried it again just to make sure I didn't do anything wrong, but the same error came up.

My system specs:

Thinkpad Edge E520 laptop.

linux-ck kernel compiled from AUR.
grub-bios bootloader

Hope some of you can help me figure this out, I've searched the forums, the wiki and Google already to no avail.

Thanks in advance smile

Offline

#2 2012-12-31 17:32:26

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: Problems converting root ext4 partition to btrfs

Not sure... maybe you need to reinstall grub to disk and/or regenerate the initramfs?


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#3 2012-12-31 17:34:42

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: Problems converting root ext4 partition to btrfs

You definitely need to regernate the intramfs.  I think there is the chance that you might have been able to simply boot from the fallback image, but I am not certain that it automatically contains the btrfs module.

Edit: It does indeed.

 lsinitcpio /boot/initramfs-linux-ck-fallback.img | grep btrfs
./usr/lib/udev/rules.d/64-btrfs.rules
./usr/lib/modules/3.7.1-3-ck/kernel/btrfs.ko

Last edited by WonderWoofy (2012-12-31 17:35:58)

Offline

#4 2012-12-31 17:48:01

Denzo
Member
Registered: 2009-07-03
Posts: 18

Re: Problems converting root ext4 partition to btrfs

I know how to reinstall grub, but how would I go about regenerating the initramfs?

Offline

#5 2012-12-31 17:54:59

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,343
Website

Re: Problems converting root ext4 partition to btrfs

Denzo wrote:

I know how to reinstall grub, but how would I go about regenerating the initramfs?

Seriously?  Have you discovered the wonderful Arch wiki?

Last edited by graysky (2012-12-31 17:55:40)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2012-12-31 17:55:09

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,700

Re: Problems converting root ext4 partition to btrfs

mkinitcpio -p linux

Offline

#7 2012-12-31 18:37:43

Denzo
Member
Registered: 2009-07-03
Posts: 18

Re: Problems converting root ext4 partition to btrfs

graysky wrote:
Denzo wrote:

I know how to reinstall grub, but how would I go about regenerating the initramfs?

Seriously?  Have you discovered the wonderful Arch wiki?

Sorry, I shouldn't have asked, I was in a hurry though. I'll check it out.

Thanks for all the generous answers, I hope you all have a wonderful new year's eve smile

Offline

#8 2013-01-02 00:47:30

Denzo
Member
Registered: 2009-07-03
Posts: 18

Re: Problems converting root ext4 partition to btrfs

Found some time to mess around with it again, and I got a bit further but I'm still stuck.

This time I ran btrfs-convert again, mounted the partition, changed the fstab to btrfs from ext4, chrooted inside, ran mkinitcpio -p linux-ck and reinstalled grub (grub-install /dev/sda) and generated a new config file. Now I can actually get into grub and I can try to boot, but both the normal image and the fallback get stuck on booting. It seems to me that it just doesn't get mounted, but I've no clue on what to do here.

EDIT:

My mistake, it boots, and my system works, it's just that X is broken now.

EDIT 2:

Everything is read only, even though rw flag is on.

Last edited by Denzo (2013-01-02 04:04:07)

Offline

#9 2013-01-03 21:36:04

Denzo
Member
Registered: 2009-07-03
Posts: 18

Re: Problems converting root ext4 partition to btrfs

Bump smile

Offline

#10 2013-01-03 21:43:16

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,700

Re: Problems converting root ext4 partition to btrfs

did you edit your fstab?

Edit: nevermind, missed that on the first read.

Last edited by Scimmia (2013-01-03 21:43:42)

Offline

#11 2013-01-04 03:29:29

Jristz
Member
From: America/Santiago
Registered: 2011-06-11
Posts: 903

Re: Problems converting root ext4 partition to btrfs

you run btrfsck and or btrfs-zero-log??


Well, I suppose that this is somekind of signature, no?

Offline

#12 2013-01-04 13:13:33

Denzo
Member
Registered: 2009-07-03
Posts: 18

Re: Problems converting root ext4 partition to btrfs

I did run btrfsck and nothing was wrong smile

Offline

#13 2013-01-04 17:17:36

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Problems converting root ext4 partition to btrfs

1) Please post /etc/fstab to give us an idea of how you mount your filesystems.
2) How do you start X? Even if the conversion process somehow borked your X configuration, it should be simple enough to just repair it (or restore it from that back-up you no doubt made before converting wink )

Offline

#14 2013-01-05 04:31:55

Denzo
Member
Registered: 2009-07-03
Posts: 18

Re: Problems converting root ext4 partition to btrfs

ANOKNUSA wrote:

1) Please post /etc/fstab to give us an idea of how you mount your filesystems.
2) How do you start X? Even if the conversion process somehow borked your X configuration, it should be simple enough to just repair it (or restore it from that back-up you no doubt made before converting wink )

The reason X didn't start was because it couldn't move/write some files in /var, because the filesystem was read-only. I'll post my fstab once I have time to have a go at it again (rolled back to ext4 once more).

Thanks for the help so far!

Offline

#15 2013-01-17 17:08:23

testdude281
Member
From: Vizag, India
Registered: 2011-03-04
Posts: 75

Re: Problems converting root ext4 partition to btrfs

Hi Denzo, could you tell me if you were successful in your effort? like you, i am planning to convert my root partition to btrfs and your example has scared me by a teensy amount. Also, have you had any problems after converting?

Offline

#16 2013-02-12 20:31:53

jnials
Member
Registered: 2013-02-12
Posts: 1

Re: Problems converting root ext4 partition to btrfs

I'm seeing the exact same thing.  As soon as I manually remount / as rw, everything is fine.

#
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
/dev/sda4 / btrfs defaults,user_xattr,relatime 0 0

As you can see, pass is turned off in my fstab, but it's still coming up RO.  It looks like something is still forcing an fsck, but I don't know what.  At one point fsck was in my mkinitcpio.conf HOOKS variabole, but I took that out.

Offline

Board footer

Powered by FluxBB