g2p / blocks

Enable bcache or LVM on existing block devices
GNU General Public License v3.0
375 stars 43 forks source link

Can't convert my / file system #1

Closed greatquux closed 11 years ago

greatquux commented 11 years ago

After booting with the raring USB and taking the recommended steps to get blocks working, I attempt to convert my /dev/sda1 filesystem. However I get the error: blocks to-bcache /dev/sda1 The range we want to reserve overlaps with the start of partition /dev/sda-1 (metadata), the shrinking strategy will not work.

Any ideas why I get it and how I can get my / filesystem to convert to bcache?

g2p commented 11 years ago

The conversion strategy for partitions doesn't work if there isn't either free space or a shrinkable filesystem before the partition you want to convert. You still have the option of converting to bcache over lvm

blocks to-lvm /dev/sda1; blocks to-bcache /dev/<newVG>/<newVol>

I'll try to make the messages clearer; the "-1" in the path name for unnamed partitions is bogus.

greatquux commented 11 years ago

Ah, that explains it. I guess I could also use gparted to shrink my root and move it 'forward' but that will probably take a while. But if I can convert to LVM then bcache that sounds better. Thanks!

greatquux commented 11 years ago

Getting this error when trying to LVMify my root partition:

root@ubuntu:~# blocks to-lvm /dev/sda1 Traceback (most recent call last): File "/usr/local/bin/blocks", line 9, in load_entry_point('blocks==0.1.1', 'console_scripts', 'blocks')() File "/root/src/blocks/blocks/main.py", line 1771, in script_main sys.exit(main()) File "/root/src/blocks/blocks/main.py", line 1491, in main return args.action(args) File "/root/src/blocks/blocks/main.py", line 1610, in cmd_to_lvm assert all(ch in ASCII_ALNUM_WHITELIST for ch in lvname) AssertionError

I may try to create some free space in front of my /dev/sda1. How much is required?

g2p commented 11 years ago

If you shift it by 1MiB it should be fine. I've just fixed the assert that you hit.

greatquux commented 11 years ago

Thanks. I actually wound up shifting it by like 500MB because I saw this update later. But hopefully I can wind up moving that back later (I imagine parted needs to be updated to handle bcache volumes though). After booting from a daily Saucy image, turning off swap, and installing blocks and bcache-tools, I can convert my /dev/sda1 to bcache:

root@ubuntu:~/bcache-tools# blocks to-bcache /dev/sda1 Command ['dmsetup', 'remove', '--noudevsync', '--', 'rozeros-4b55d6e4-f21d-11e2-a461-5404a6efae19'] has failed with status 1 Standard output:

Standard error: device-mapper: remove ioctl on rozeros-4b55d6e4-f21d-11e2-a461-5404a6efae19 failed: Device or resource busy Command failed

Copying the bcache superblock... ok Shifting partition to start on the bcache superblock... ok

Not sure what those other errors are though. I can mount /dev/bcache0 and I can attach my cache device. I've already installed bcache-tools into my root FS so I think I'll be good to go when I reboot. I might have forgotten to rebuild the initramfs though... :)

greatquux commented 11 years ago

Yep, rebooted and now I'm working great! I suppose I might have some issues later on when upgrading but hopefully by the time saucy is released any issues will be ironed out. Thanks for all your help on this!