Replace Linux Boot-Drive | ext3 to btrfs
Posted
by
bardiir
on Super User
See other posts from Super User
or by bardiir
Published on 2012-12-11T16:12:47Z
Indexed on
2012/12/11
17:08 UTC
Read the original article
Hit count: 262
I've got a headless server running Debian Linux currently.
Linux vault 3.2.0-3-686-pae #1 SMP Mon Jul 23 03:50:34 UTC 2012 i686 GNU/Linux
The root filesystem is located on an ext3 partition on the main harddrive.
My data is located on multiple harddrives that are bundled to a storage pool running with btrfs.
UUID=072a7fce-bfea-46fa-923f-4fb0827ae428 / ext3 errors=remount-ro 0 1
UUID=b50965f1-a2e1-443f-876f-578b5f93cbf1 none swap sw 0 0
UUID=881e3ad9-31c4-4296-ae60-eae6c98ea45f none swap sw 0 0
UUID=30d8ae34-e2f0-44b4-bbcc-22d761a128f6 /data btrfs defaults,compress,autodefrag 0 0
What I'd like to do is to place / into the btrfs pool too.
The ideal solution would provide the flexibility to boot from any disk in the system alike, so if the main drive fails I'd just need to swap another one into the main slot and it would be bootable like the main one.
My main problem is, everything I do needs to result in a bootable system that is open to ssh logins via network as this server is 100% headless so there is no possibility to boot it from a live cd or anything like that. So I'd like to be extra sure everything works out fine :)
How would I best go about this? Can anybody hint me to guides or whip something up for these tasks? Anything I forgot to think about?
- Copy root-data into btrfs pool, adjust mountpoints,...
- Adjust GRUB to boot from btrfs pool UUID or the local device where GRUB is installed
- Sync GRUB to all harddrives so every drive is equally bootable (is this even possible without destroying the btrfs partitions on the drives or would I need to disconnect the drives, install grub on them and then connect them back with a slightly smaller partition?)
© Super User or respective owner