You are not logged in.

#1 2015-01-21 16:30:24

klenamenis
Member
Registered: 2014-07-03
Posts: 101

[SOLVED] migration to btrfs

Hey,

I'm planning to use btrfs and want to make sure everything will work when switching from ext4, as I have little to no possibilities of making a full system backup. I have an UEFI setup with a single SSD dual booting Arch and Win7:

klemens@arch-pc ~]$ fdisk -l

Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 379B67EE-7FAD-48F0-9853-425458FCD45E

Device         Start       End   Sectors   Size Type
/dev/sda1       2048   1050623   1048576   512M EFI System
/dev/sda2    1050624  22022143  20971520    10G Apple TV recovery
/dev/sda3   22022144 273680383 251658240   120G Apple TV recovery
/dev/sda4  273680384 488386559 214706176 102.4G Microsoft basic data
[klemens@arch-pc ~]$ blkid
/dev/sda1: UUID="7461-7974" TYPE="vfat" PARTLABEL="boot" PARTUUID="f3533389-d45b-4243-ab50-0de23c9478b7"
/dev/sda2: LABEL="arch" UUID="94c88bfe-9785-4548-82aa-ef995651a82e" TYPE="ext4" PARTLABEL="arch" PARTUUID="7bccf73d-35a3-492e-bfcf-fb7106f9b3a6"
/dev/sda3: LABEL="home" UUID="bb2f6848-49bd-466d-b5e5-d3842ff8fadd" TYPE="ext4" PARTLABEL="home" PARTUUID="e2337cdb-8110-4220-a9d7-1c7a5d1a1c67"
/dev/sda4: LABEL="windows" UUID="0075B0CA37460130" TYPE="ntfs" PARTUUID="011caad7-932a-423e-8ff0-9d7a4390e55e"
/dev/sdd1: UUID="f9f59e87-1d66-442c-80d1-cc8abf2c1cd7" TYPE="ext4" PARTUUID="77582134-01"

There is only a 2GB sd card available for me to use as external boot medium, so I'd like to unmount and convert /home first according to the wiki and see if it goes well. In case of success, I'd boot from sd card and convert my root partition the same way, which leads me to the following questions:

  1. Is it safe to convert an unmounted /home partition on the same system or am I advised to do this while booting from sd card as well?
  2. gummiboot is currently installed, which doesn't seem to provide boot-from-ISO functionality as GRUB. Is booting from an sd card the only way to change my root file system?
  3. Am I right, that due to my UEFI and multi filesystem setup, using subvolumes isn't an option at all? Simply changing ext4 to btrfs is all I need in order to accomplish snapshot capability and transparent compression, isn't it?

After changing both partitions, I would edit /etc/fstab, build a new ramdisk, change kernel boot flags and recompress already existing data all according to the wiki.

Did I miss anything? Do you have any tips or recommendations?

Last edited by klenamenis (2015-01-29 19:26:24)

Offline

#2 2015-01-21 19:39:22

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [SOLVED] migration to btrfs

You really should backup everything beforehand, and keep your backups up to date when using btrfs, unless you're prepared to lose everything.
I had better luck reformatting the partitions completely, instead of converting from ext4, but YMMV.

1. I'm pretty sure you can convert your /home without boot media, but I'd say the conversion is never 100% safe, you could always end up corrupting your data.
2. You can't convert the root fs on system you're currently running. you need to do that from another system, like sd card or other bootable media.
3. You can use subvolumes inside your btrfs partitions. btrfs partitions always have those capabilities. I'm not sure if I quite understand the question..

Offline

#3 2015-01-21 19:53:26

klenamenis
Member
Registered: 2014-07-03
Posts: 101

Re: [SOLVED] migration to btrfs

Thanks for the answer.

regarding question 2: It might be misleading. Of course, I need another boot media, so the question could also state: Can I load an ISO from my /boot partition, or even load any ISO completely to RAM and boot from that using gummiboot? Similar to syslinux' Memdisk.

Yes, I could create subvolumes on any btrfs partition, but since there's no special disk setup for me, I rather asked for confirmation: Would it be fine using simple partitions without any further subvolumes?

Sorry for the misunderstanding, I'm rather curious and hesitant due to my lack of backup possibilities.

Offline

#4 2015-01-21 20:17:40

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [SOLVED] migration to btrfs

klenamenis wrote:

regarding question 2: It might be misleading. Of course, I need another boot media, so the question could also state: Can I load an ISO from my /boot partition, or even load any ISO completely to RAM and boot from that using gummiboot? Similar to syslinux' Memdisk.

sorry for misunderstanding the question. Unfortunately I can't tell that about gummiboot, but couldn't you simply dd the ISO to the sd-card or usb-stick and boot from there?

Yes, I could create subvolumes on any btrfs partition, but since there's no special disk setup for me, I rather asked for confirmation: Would it be fine using simple partitions without any further subvolumes?

Yes, there's no need to use subvolumes unless you want to. You can just have separate root and home partitions both formatted as btrfs.

again, I'd suggest you to figure out some kind of backup solution before migrating.
I've been using btrfs for ~1 year, and had my partitions corrupted a couple of times. It seems to be getting more stable and robust these days, but I still wouldn't suggest storing irreplaceable data on btrfs without any backups.

Offline

#5 2015-01-22 01:23:53

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: [SOLVED] migration to btrfs

Another thing - when I converted a system from ext4 to btrfs, I thought all was well. But after a short time, the filesystem became full. What I had to do was delete the btrfs subvolume where the backup of the old ext4 filesystem was stored (which was created automatically by the btrfs conversion routine), then do full defragmentation of the actual btrfs filesystem to reclaim space and organize everything. In the end, everything worked well.

Tim

Offline

#6 2015-01-27 13:05:06

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: [SOLVED] migration to btrfs

The first and only time I used btrfs-convert, it somehow managed to corrupt my LVM metadata, leaving my LVs in an invalid state, and ultimately leading to a reformat of the PV. I still can't explain how it happened, since btrfs-conver was run on the LV as its block device and thus should not have had access to LVM metadata. I see that you're not using LVM, but this is just an example of what can happen unexpectedly. Although btrfs is becoming more stable now, the external utilities (like btrfs-convert) are still fairly fragile. See my thread.

As everyone else says, I definitely would not attempt this without a backup.

Offline

#7 2015-01-27 14:05:52

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: [SOLVED] migration to btrfs

I'm with @ooo, but in a more general sense, in that converting filesystems from one to another is a risky business in general. So, if you do this, I'd recommend a back-up, wipe, (re-)format, re-install. Yes, it's a pain in the XXX, especially without a back-up media, but I think that's best.

Also, from this thread (which is definitely worth a read):

chaonaut wrote:
graysky wrote:

Best advice I can offer is not to use btrfs without a robust backup scheme.

i can offer even better advice to use anything with a robust backup scheme smile

Last edited by clfarron4 (2015-01-27 14:09:57)


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#8 2015-01-29 19:26:07

klenamenis
Member
Registered: 2014-07-03
Posts: 101

Re: [SOLVED] migration to btrfs

Yeah, I think I will consider a migration in the hopefully not to far future, where btrfs gets more stable and a reliable back up solutions exists for me.

Thanks for your tips and help!

Offline

Board footer

Powered by FluxBB