Code Monkey home page Code Monkey logo

blocks's People

Contributors

g2p avatar jlec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blocks's Issues

Blocks is not stable

Upon trying to use blocks, I encountered many compatibility problems when trying to get Python 3.3 to work, even when using virtualenv. And when it did finally work, there were numerous other problems such as missing libraries and syntax problems, too many to list here. Even on a clean install of Ubuntu 14.04, it required dev libraries which actually caused apt conflicts.

Are there any plans to improve the stability of block by releasing it as a single, static binary? Or, at the very least, package it together with the correct libraries included?

Add Ubuntu Xenial support to the PPA

ihor@ihor-Z97P-D3:~$ sudo add-apt-repository ppa:g2p/storage 'This PPA does not support xenial' Cannot add PPA: ''This PPA does not support xenial''.

Xenial is LTS Ubuntu (16.04)

Unix.Unix_error(20, "lstat", "/usr/lib/libept.so.1.0.5.4.12")

I managed to install python3-blocks from your PPA on Ubuntu 14.04.2, but it fails:

$ sudo blocks to-bcache --maintboot /dev/sda3 --join a6af9363-8e5f-46c5-831c-4476731ed7e7
Fatal error: exception Unix.Unix_error(20, "lstat", "/usr/lib/libept.so.1.0.5.4.12")
Traceback (most recent call last):
File "/usr/bin/maintboot", line 86, in
script_main()
File "/usr/bin/maintboot", line 82, in script_main
sys.exit(main())
File "/usr/bin/maintboot", line 53, in main
[sm_cmd] + '--names --use-installed -o'.split() + [smd] + args.pkgs)
File "/usr/lib/python3.3/subprocess.py", line 547, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['supermin', '--names', '--use-installed', '-o', '/tmp/maintboot.873mar/supermin.d', 'python3-blocks', 'util-linux', 'dash', 'mount', 'base-files', 'libc-bin', 'nilfs-tools', 'reiserfsprogs', 'xfsprogs', 'e2fsprogs', 'btrfs-tools', 'lvm2', 'cryptsetup-bin', 'bcache-tools']' returned non-zero exit status 2
Traceback (most recent call last):
File "/usr/bin/blocks", line 9, in
load_entry_point('blocks==0.1.4', 'console_scripts', 'blocks')()
File "/usr/lib/python3/dist-packages/blocks/main.py", line 2002, in script_main
sys.exit(main())
File "/usr/lib/python3/dist-packages/blocks/main.py", line 1668, in main
return args.action(args)
File "/usr/lib/python3/dist-packages/blocks/main.py", line 1748, in cmd_to_bcache
device, 'to-bcache', debug=args.debug, join=args.join)
File "/usr/lib/python3/dist-packages/blocks/main.py", line 1770, in call_maintboot
+ ['--append', 'BLOCKS_ARGS=' + encoded])
File "/usr/lib/python3.4/subprocess.py", line 557, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['maintboot', '--pkgs', 'python3-blocks', 'util-linux', 'dash', 'mount', 'base-files', 'libc-bin', 'nilfs-tools', 'reiserfsprogs', 'xfsprogs', 'e2fsprogs', 'btrfs-tools', 'lvm2', 'cryptsetup-bin', 'bcache-tools', '--initscript', '/usr/lib/python3/dist-packages/blocks/maintboot.init', '--append', 'BLOCKS_ARGS=%7B%22device%22%3A%20%22c2164bbc-81b1-434f-97cb-7025688f6e9e%22%2C%20%22join%22%3A%20%22a6af9363-8e5f-46c5-831c-4476731ed7e7%22%2C%20%22command%22%3A%20%22to-bcache%22%2C%20%22debug%22%3A%20false%7D']' returned non-zero exit status 1

Failing to convert with btrfs

Self-compiled (successfully) on Ubuntu Xenial (16.04.3), and I'm getting the following error:

Will shrink the filesystem (btrfs) by 4526080 bytes
Traceback (most recent call last):
  File "/home/anaerin/.local/bin/blocks", line 9, in <module>
    load_entry_point('blocks', 'console_scripts', 'blocks')()
  File "/home/anaerin/blocks/src/blocks/blocks/__main__.py", line 2012, in script_main
    sys.exit(main())
  File "/home/anaerin/blocks/src/blocks/blocks/__main__.py", line 1678, in main
    return args.action(args)
  File "/home/anaerin/blocks/src/blocks/blocks/__main__.py", line 1861, in cmd_to_lvm
    block_stack.stack_reserve_end_area(pe_newpos, progress)
  File "/home/anaerin/blocks/src/blocks/blocks/__main__.py", line 1096, in stack_reserve_end_area
    block_data.reserve_end_area_nonrec(inner_pos)
  File "/home/anaerin/blocks/src/blocks/blocks/__main__.py", line 501, in reserve_end_area_nonrec
    self._mount_and_resize(pos)
  File "/home/anaerin/blocks/src/blocks/blocks/__main__.py", line 549, in _mount_and_resize
    assert self.fssize == pos
AssertionError

Not sure just what is going on here. Any insight?

to-bcache fails with "device-mapper: reload ioctl on synthetic-12b0a96e-74d5-11e3-b6c9-ac220b50c8fe failed: Invalid argument

This is on Fedora 20. Converting ext4 LV to bcache. The filesystem has already been shrunk with previous run.

# blocks to-bcache /dev/vg0/scratch
The filesystem (ext4) leaves enough room, no need to shrink it
device-mapper: reload ioctl on synthetic-12b0a96e-74d5-11e3-b6c9-ac220b50c8fe failed: Invalid argument
Command failed
Traceback (most recent call last):
  File "/root/.local/bin/blocks", line 9, in <module>
    load_entry_point('blocks==0.1.4', 'console_scripts', 'blocks')()
  File "/root/src/blocks/blocks/__main__.py", line 2002, in script_main
    sys.exit(main())
  File "/root/src/blocks/blocks/__main__.py", line 1668, in main
    return args.action(args)
  File "/root/src/blocks/blocks/__main__.py", line 1751, in cmd_to_bcache
    device=device, debug=args.debug, progress=progress, join=args.join)
  File "/root/src/blocks/blocks/__main__.py", line 1500, in lv_to_bcache
    synth_bdev = make_bcache_sb(pe_size, data_size, join)
  File "/root/src/blocks/blocks/__main__.py", line 1472, in make_bcache_sb
    with synth_device(bsb_size, data_size) as synth_bdev:
  File "/usr/lib64/python3.3/contextlib.py", line 48, in __enter__
    return next(self.gen)
  File "/root/src/blocks/blocks/__main__.py", line 1264, in synth_device
    exit_stack=st)
  File "/root/src/blocks/blocks/__main__.py", line 141, in mk_dm
    assert proc.returncode == 0
AssertionError

Cannot add PPA: ''This PPA does not support focal''.

I get the message in the title after issuing:
sudo add-apt-repository ppa:g2p/storage

Since the PPA doesn't have support for Ubuntu focal, should I follow the git/build procedure? Or, do changes need to be made in the source code to provide support for focal?

Thanks.

bcache conversion /dev/mapper/synthetic read errors

I'm having trouble getting blocks to-bcache to create a device I am able to subsequently boot to.

The target system in OpenSuse 13.1 with bcache-tools installed. I'm then working from an Ubuntu Saucy LiveCD to perform the conversion (this just due to a bug with python3 in the current OpenSuse live CD). The caching device appears to be successfully created with:

root@ubuntu:~# make-bcache -C /dev/sdb --wipe
UUID:            f5932af1-dba9-472c-876e-346f68edc5e2
Set UUID:        1262d28f-6b93-4f09-90fe-ca85e554cf86
version:        0
nbuckets:        228946
block_size:        1
bucket_size:        1024
nr_in_set:        1
nr_this_dev:        0
first_bucket:        1

Proceeding with the conversion then results in:

root@ubuntu:~# blocks to-bcache /dev/mapper/system-root --join 1262d28f-6b93-4f09-90fe-ca85e554cf86
Will shrink the filesystem (btrfs) by 4194304 bytes
Command ['dmsetup', 'remove', '--noudevsync', '--', 'synthetic-5c7be7ba-5b9a-11e3-ad03-842b2b9e724e'] has failed with status 1
Standard output:

Standard error:
device-mapper: remove ioctl on synthetic-5c7be7ba-5b9a-11e3-ad03-842b2b9e724e failed: Device or resource busy
Command failed

Command ['dmsetup', 'remove', '--noudevsync', '--', 'rozeros-5c7b9b8e-5b9a-11e3-ad03-842b2b9e724e'] has failed with status 1
Standard output:

Standard error:
device-mapper: remove ioctl on rozeros-5c7b9b8e-5b9a-11e3-ad03-842b2b9e724e failed: Device or resource busy
Command failed

Copying the bcache superblock... ok
  /dev/mapper/synthetic-5c7be7ba-5b9a-11e3-ad03-842b2b9e724e: read failed after 0 of 4096 at 42949607424: Input/output error
  /dev/mapper/synthetic-5c7be7ba-5b9a-11e3-ad03-842b2b9e724e: read failed after 0 of 4096 at 42949664768: Input/output error
  mpath major 251 is not dm major 252.
Loading LVM metadata... ok
Rotating the last extent to be the first... ok

I'm unclear on the cause of the read errors on /dev/synthetic. The same occurs with:

root@ubuntu:~# vgscan 
  Reading all physical volumes.  This may take a while...
  /dev/mapper/synthetic-5c7be7ba-5b9a-11e3-ad03-842b2b9e724e: read failed after 0 of 4096 at 42949607424: Input/output error
  /dev/mapper/synthetic-5c7be7ba-5b9a-11e3-ad03-842b2b9e724e: read failed after 0 of 4096 at 42949664768: Input/output error
  Found volume group "system" using metadata type lvm2

After rebooting the root device is not found, regardless of if the UUID or root=/dev/bcache0 is used for the grub2 boot arg.

Some additional information which may help:

root@ubuntu:~# lsblk -o NAME,MAJ:MIN,RM,SIZE,TYPE,FSTYPE,MOUNTPOINT,UUID
NAME                                                    MAJ:MIN RM   SIZE TYPE FSTYPE    MOUNTPOINT UUID
sda                                                       8:0    0 465.8G disk                      
├─sda1                                                    8:1    0   399M part ext4                 0da71f87-ba24-462d-93ab-3420a49ca7c5
└─sda2                                                    8:2    0 465.4G part LVM2_memb            8G026Q-gJeY-rTbI-xX1z-0uZD-8ZZD-g8BhKf
  ├─system-root (dm-0)                                  252:0    0    40G lvm                       
  │ └─bcache1                                           251:1    0    40G disk btrfs                e6285c09-b1aa-48a8-b92f-e54825ab7024
  └─system-swap (dm-1)                                  252:1    0     4G lvm  swap                 fde68d05-a80b-449d-94e8-69250bc14034
sdb                                                       8:16   0 111.8G disk                      
├─bcache0                                               251:0    0    40G disk                      
└─bcache1                                               251:1    0    40G disk btrfs                e6285c09-b1aa-48a8-b92f-e54825ab7024
sr0                                                      11:0    1   883M rom  iso9660   /cdrom     
rozeros-5c7b9b8e-5b9a-11e3-ad03-842b2b9e724e (dm-2)     252:2    0    40G dm                        
└─synthetic-5c7be7ba-5b9a-11e3-ad03-842b2b9e724e (dm-3) 252:3    0    40G dm                        
  └─bcache0                                             251:0    0    40G disk                      
loop0                                                     7:0    0 842.7M loop squashfs  /rofs      
loop1                                                     7:1    0     4M loop                      
└─synthetic-5c7be7ba-5b9a-11e3-ad03-842b2b9e724e (dm-3) 252:3    0    40G dm                        
  └─bcache0                                             251:0    0    40G disk


root@ubuntu:~# cat /etc/lvm/backup/system 
# Generated by LVM2 version 2.02.98(2) (2012-10-15): Mon Dec  2 21:40:28 2013

contents = "Text Format Volume Group"
version = 1

description = "Created *after* executing 'vgscan'"

creation_host = "ubuntu"    # Linux ubuntu 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64
creation_time = 1386020428    # Mon Dec  2 21:40:28 2013

system {
    id = "wP6Ta4-bdJb-YjAX-HkZC-g0sH-wWnC-beDh8U"
    seqno = 6
    format = "lvm2" # informational
    status = ["RESIZEABLE", "READ", "WRITE"]
    flags = []
    extent_size = 8192        # 4 Megabytes
    max_lv = 0
    max_pv = 0
    metadata_copies = 0

    physical_volumes {

        pv0 {
            id = "8G026Q-gJeY-rTbI-xX1z-0uZD-8ZZD-g8BhKf"
            device = "/dev/sda2"    # Hint only

            status = ["ALLOCATABLE"]
            flags = []
            dev_size = 975953920    # 465.371 Gigabytes
            pe_start = 2048
            pe_count = 119134    # 465.367 Gigabytes
        }
    }

    logical_volumes {

        root {
            id = "AZMmic-xfZP-g5iv-iBaJ-Nuin-x3rp-6JOUyP"
            status = ["READ", "WRITE", "VISIBLE"]
            flags = []
            creation_host = "linux"
            creation_time = 1385037444    # 2013-11-21 12:37:24 +0000
            segment_count = 2

            segment1 {
                start_extent = 0
                extent_count = 3    # 12 Megabytes

                type = "striped"
                stripe_count = 1    # linear

                stripes = [
                    "pv0", 10237
                ]
            }
            segment2 {
                start_extent = 3
                extent_count = 10237    # 39.9883 Gigabytes

                type = "striped"
                stripe_count = 1    # linear

                stripes = [
                    "pv0", 0
                ]
            }
        }

        swap {
            id = "8JogqY-fkfl-N19f-xtlT-6RrC-dLbE-5Ed1i8"
            status = ["READ", "WRITE", "VISIBLE"]
            flags = []
            creation_host = "linux"
            creation_time = 1385037444    # 2013-11-21 12:37:24 +0000
            segment_count = 1

            segment1 {
                start_extent = 0
                extent_count = 1024    # 4 Gigabytes

                type = "striped"
                stripe_count = 1    # linear

                stripes = [
                    "pv0", 10240
                ]
            }
        }
    }
}

I could just dd wipe partition tables on both devices and try yet again, but it seems something else is involved here, or there is something I'm missing.

I would appreciate any suggestions you might have - I'd love to get bcache working on my new Suse 13.1 install.

Cheers,

blocks.maintboot is not working :(

~mindcat » ls /sys/fs/bcache
45208259-3a8e-4325-9f55-b1f1879af9b4  register  register_quiet
~mindcat » sudo blocks to-bcache --maintboot /dev/sdb2 --join 45208259-3a8e-4325-9f55-b1f1879af9b4
supermin: *** error: This is supermin version 5.
supermin: *** It looks like you are looking for supermin version 4.

This version of supermin will not work.  You need to find the old version
or upgrade to libguestfs >= 1.26.

Traceback (most recent call last):
  File "/usr/bin/maintboot", line 86, in <module>
    script_main()
  File "/usr/bin/maintboot", line 82, in script_main
    sys.exit(main())
  File "/usr/bin/maintboot", line 53, in main
    [sm_cmd] + '--names --use-installed -o'.split() + [smd] + args.pkgs)
  File "/usr/lib/python3.4/subprocess.py", line 559, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['supermin', '--names', '--use-installed', '-o', '/tmp/maintboot.5d5ksuwn/supermin.d', 'python3-blocks', 'util-linux', 'dash', 'mount', 'base-files', 'libc-bin', 'nilfs-tools', 'reiserfsprogs', 'xfsprogs', 'e2fsprogs', 'btrfs-tools', 'lvm2', 'cryptsetup-bin', 'bcache-tools']' returned non-zero exit status 1
Traceback (most recent call last):
  File "/usr/bin/blocks", line 9, in <module>
    load_entry_point('blocks==0.1.4', 'console_scripts', 'blocks')()
  File "/home/mindcat/src/blocks/blocks/__main__.py", line 2012, in script_main
    sys.exit(main())
  File "/home/mindcat/src/blocks/blocks/__main__.py", line 1678, in main
    return args.action(args)
  File "/home/mindcat/src/blocks/blocks/__main__.py", line 1758, in cmd_to_bcache
    device, 'to-bcache', debug=args.debug, join=args.join)
  File "/home/mindcat/src/blocks/blocks/__main__.py", line 1780, in call_maintboot
    + ['--append', 'BLOCKS_ARGS=' + encoded])
  File "/usr/lib/python3.4/subprocess.py", line 559, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['maintboot', '--pkgs', 'python3-blocks', 'util-linux', 'dash', 'mount', 'base-files', 'libc-bin', 'nilfs-tools', 'reiserfsprogs', 'xfsprogs', 'e2fsprogs', 'btrfs-tools', 'lvm2', 'cryptsetup-bin', 'bcache-tools', '--initscript', '/home/mindcat/src/blocks/blocks/maintboot.init', '--append', 'BLOCKS_ARGS=%7B%22device%22%3A%20%22e90af4aa-942c-4eef-b319-a1ec527c3068%22%2C%20%22join%22%3A%20%2245208259-3a8e-4325-9f55-b1f1879af9b4%22%2C%20%22command%22%3A%20%22to-bcache%22%2C%20%22debug%22%3A%20false%7D']' returned non-zero exit status 1
~mindcat » supermin --version
supermin 5.1.6
~mindcat » 

make-bcache fails with Device or resource busy

Hello. I'm trying to execute: sudo make-bcache -C /dev/sdb
And what I get is: Can't open dev /dev/sdb1: Device or resource busy

Here is more info:

alex@alex-ThinkPad-S5-S531:~$ lsblk -o NAME,MAJ:MIN,RM,SIZE,TYPE,FSTYPE,MOUNTPOINT,UUID
NAME                    MAJ:MIN RM   SIZE TYPE FSTYPE MOUNTPOINT UUID
sda                       8:0    0 931,5G disk                   
├─sda1                    8:1    0     1G part        /boot      
└─sda2                    8:2    0 930,5G part                   
  ├─sysvg-lvswap (dm-0) 252:0    0     4G lvm         [SWAP]     
  ├─sysvg-lvroot (dm-1) 252:1    0    20G lvm         /          
  └─sysvg-lvhome (dm-2) 252:2    0 928,9G lvm         /home      
sdb                       8:16   0  22,4G disk                   
└─sdb1                    8:17   0  22,4G part                   
  └─sysvg-lvhome (dm-2) 252:2    0 928,9G lvm         /home

I want to have a cache on sdb(22.4G)

permission issues

I have troubles with permissions.
Running blocks using sudo or under root:

$ sudo blocks 
Traceback (most recent call last):
  File "/bin/blocks", line 9, in <module>
    load_entry_point('blocks==0.1.4', 'console_scripts', 'blocks')()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 519, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2630, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2310, in load
    return self.resolve()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2316, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/nedr/src/blocks/blocks/__main__.py", line 63
    def __init__(self, *, device, **kwargs):
                        ^
SyntaxError: invalid syntax

running from user, blocks installed to system:

$ blocks
Traceback (most recent call last):
  File "/bin/blocks", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3018, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 612, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 918, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 805, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: maintboot

running from user, blocks installed to user directory (the one way to make blocks run, but I have permission issue here):

$ /home/nedr/.local/bin/blocks to-lvm --vg-name home /dev/sdb3
Will shrink the filesystem (ext4) by 4194304 bytes
Checking the filesystem before resizing it
e2fsck 1.42.12 (29-Aug-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb3: 11/192000 files (0.0% non-contiguous), 29572/768000 blocks
Copying 4194304 bytes from pos 0 to pos 3141533696... ok
Preparing LVM metadata... /dev/mapper/control: open failed: Permission denied
Failure to communicate with kernel device-mapper driver.
Incompatible libdevmapper (unknown version) and kernel driver (unknown version).
Command failed
/dev/mapper/control: open failed: Permission denied
Failure to communicate with kernel device-mapper driver.
Incompatible libdevmapper (unknown version) and kernel driver (unknown version).
Command failed
Traceback (most recent call last):
  File "/home/nedr/.local/bin/blocks", line 9, in <module>
    load_entry_point('blocks==0.1.4', 'console_scripts', 'blocks')()
  File "/home/nedr/src/blocks/blocks/__main__.py", line 2012, in script_main
    sys.exit(main())
  File "/home/nedr/src/blocks/blocks/__main__.py", line 1678, in main
    return args.action(args)
  File "/home/nedr/src/blocks/blocks/__main__.py", line 1886, in cmd_to_lvm
    synth_device(pe_size, device.size - pe_size))
  File "/usr/lib64/python3.4/contextlib.py", line 283, in enter_context
    result = _cm_type.__enter__(cm)
  File "/usr/lib64/python3.4/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/nedr/src/blocks/blocks/__main__.py", line 1258, in synth_device
    exit_stack=st)
  File "/home/nedr/src/blocks/blocks/__main__.py", line 150, in mk_dm
    assert proc.returncode == 0, 'Report to https://github.com/g2p/blocks/issues/8 if you see this'
AssertionError: Report to https://github.com/g2p/blocks/issues/8 if you see this

So how should I run it?
I'm on Fedora 22.
Thanks

problem during installation on ubuntu live 13.04 & 13.10

when i run
sudo apt-get install python3-blocks bcache-tools

i get the error :
The following packages have unmet dependancies:
python3-blocks : Depends: python3-maintboot but it is not going to be installed

E: Unable to correct problems, you have held broken packages.

this come from both the daily build of ubuntu 13.10 and current release of 13.04

edit:
i've tryed now also with 32 bit versions, same error occurr..
i don't know why but i has been able to install into this virtual image : http://virtualboximages.com/Ubuntu+Gnome+13.10+i386+VirtualBox+VDI+Virtual+Appliance

but i need the software works on a live bootable iso so i can boot from usb and use it .

thanks

Shrinking strategy fails with 1M free

I'm trying to convert a partition to bcache. I created the partition some time ago using parted -s -a opt /dev/sdx mklabel gpt mkpart primary 1m 100%, so there should be 1M in front. Why does bcache fail in this case? I am aware of issue #1, but wouldn't have thought this was the problem here. Error message is The range we want to reserve overlaps with the start of a reserved area at [0, 33] (metadata), the shrinking strategy will not work. I'm on Ubuntu 14.04 (3.19), Python 3.4. Thanks!

no python?-blocks in ppa repo

hi.
I am running a Live CD of Ubuntu 14.10
I have added the ppa:g2p/storage and when I want to run

sudo apt-get install python3-blocks bcache-tools

It gives :

apt-get install python3-blocks bcache-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3-blocks

Yes, I have run sudo apt-get update
One can see with

$ awk '$1 == "Package:" { if (a[$2]++ == 0) print $2; }' /var/lib/apt/lists/*g2p*storage*Packages
python-parted
python-augeas
python-parted-dbg
bcache-tools
python3-parted
python3-parted-dbg
python3-augeas

that there is no python?-blocks package at all in the repo!

bcache resizing

I tried to do
sudo blocks to-bcache /dev/sda6 --join b0209c0c-64b1-4ed1-81d5-bed570641246

when I've got the following error:

The filesystem (btrfs) leaves enough room, no need to shrink it
Traceback (most recent call last):
  File "/usr/bin/blocks", line 9, in <module>
    load_entry_point('blocks==0.1.4', 'console_scripts', 'blocks')()
  File "/usr/lib/python3/dist-packages/blocks/__main__.py", line 2002, in script_main
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/blocks/__main__.py", line 1668, in main
    return args.action(args)
  File "/usr/lib/python3/dist-packages/blocks/__main__.py", line 1751, in cmd_to_bcache
    device=device, debug=args.debug, progress=progress, join=args.join)
  File "/usr/lib/python3/dist-packages/blocks/__main__.py", line 1550, in part_to_bcache
    ptable.reserve_space_before(part_start, bsb_size, progress)
  File "/usr/lib/python3/dist-packages/blocks/__main__.py", line 415, in reserve_space_before
    return self._reserve_range(part_start - length, part_start, progress)
  File "/usr/lib/python3/dist-packages/blocks/__main__.py", line 403, in _reserve_range
    block_stack.stack_reserve_end_area(part_newsize, progress)
  File "/usr/lib/python3/dist-packages/blocks/__main__.py", line 1086, in stack_reserve_end_area
    block_data.reserve_end_area_nonrec(inner_pos)
AttributeError: 'BCacheBacking' object has no attribute 'reserve_end_area_nonrec'

/dev/sda6 is formatted as ext4. /dev/sda5 is already a part of this bcache1, and is formatted as btrfrs. /dev/sda7 is a LUKS device, and also a part of the same bcache1.

This is my /dev/sda, as reported by gdisk:
Disk /dev/sda: 1465149168 sectors, 698.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 9225A7F4-41FF-4FC5-99D7-0E4FDFB2DFC3
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1465149134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number Start (sector) End (sector) Size Code Name
1 2048 104447 50.0 MiB EF00 EFI System
2 104448 616447 250.0 MiB 8300 Linux filesystem
3 616448 1128447 250.0 MiB 8300 Linux filesystem
4 1128448 34918399 16.1 GiB 8200 Linux swap
5 34918400 244635647 100.0 GiB 8300 Linux filesystem
6 244635648 559206399 150.0 GiB 8300 Linux filesystem
7 559206400 1465149134 432.0 GiB 0700 Microsoft basic data

Here is info about my bcache1
Device /dev/bcache1 (251:1)
UUID b0209c0c-64b1-4ed1-81d5-bed570641246
Block Size 0.50KiB
Bucket Size 512.00KiB
Congested? False
Read Congestion 2.0ms
Write Congestion 20.0ms
Total Cache Size 62.88GiB
Total Cache Used 5.03GiB (8%)
Total Cache Unused 57.85GiB (92%)
Dirty Data 0B (0%)
Evictable Cache 62.88GiB (100%)
Replacement Policy [lru] fifo random
Cache Mode writethrough [writeback] writearound none
Total Hits 83442 (98%)
Total Misses 1324
Total Bypass Hits 7583 (100%)
Total Bypass Misses 0
Total Bypassed 272.00MiB

blocks problem during installation on ubuntu 14.2

"The following packages have unmet dependencies.
python3-blocks : Depends: python3-parted but it is not going to be installed"

Python 3.4.0 is currently installed (As Python 3)

Installation expects < version 3.4

Same problem when trying to install from Ubuntu Software Center.

Error converting to PV

Hello,

I was looking at a way to merge my current ext4 partition into an existing VG and found your great tool.

Alas, I ran into an issue while running it:

Copying 4194304 bytes from pos 0 to pos 1935063121920... ok
Preparing LVM metadata... device-mapper: reload ioctl on synthetic-c2a39272-0703-11e3-b675-d85d4ca3aa01 failed: Invalid argument
Command failed
Command ['losetup', '-d', '--', '/dev/loop0'] has failed with status 1
Standard output:

Standard error:
losetup: /dev/--: detach failed: No such file or directory

I am not sure what to do here, am I missing a dependency or is anything else wrong?

Thanks!

cmd_to_bcache: overdetecting a partition

My setup:
/dev/sdx1 is EFI boot partition (hence vfat)
/dev/sdx2 is luks holding my filesystems

If i read correct, it will be considered a partition in cmd_to_bcache (around line 1743) instead of luks. Moving code around to detect luks first, then partition, i could get rid of the (rather strange) following symptom.

blocks to-bcache /dev/sdx2

Unsupported superblock type: vfat

(remember, sdx2 is luks, the vfat holder is sdx1)

blocks hit an assert when linear target fails

When the mapping fails (in my case it was because I didn't have linear module installed) the blocks hits an assert. It means that the return codes are probably not checked correctly.

Updated fork out there anywhere?

In issue #41 on Aug 17th 2021 @MurzNN commented
that @viccie30 had forked the project with preparations to package it for Debian. I looked at @viccie30's profile and I didn't find anything relating to blocks.

Does anyone know if there's a fork out there that will allow installation on a current distro?

blocks to-bcache uses wrong device

invoking sudo blocks to-bcache /dev/sda5 causes output

Will shrink the filesystem (btrfs) by 1048576 bytes
Command ['mount', '-t', 'btrfs', '-o', 'noatime,noexec,nodev', '--', '/dev/sda4', '/tmp/tmp8uo886hz.privmnt'] has failed with status 32
Standard output:

Standard error:
mount: /dev/sda4 is already mounted or /tmp/tmp8uo886hz.privmnt busy

Traceback (most recent call last):
  File "/usr/local/bin/blocks", line 9, in <module>
    load_entry_point('blocks==0.1.4', 'console_scripts', 'blocks')()
  File "/usr/local/lib/python3.4/dist-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 2012, in script_main
  File "/usr/local/lib/python3.4/dist-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 1678, in main
  File "/usr/local/lib/python3.4/dist-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 1761, in cmd_to_bcache
  File "/usr/local/lib/python3.4/dist-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 1560, in part_to_bcache
  File "/usr/local/lib/python3.4/dist-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 425, in reserve_space_before
  File "/usr/local/lib/python3.4/dist-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 413, in _reserve_range
  File "/usr/local/lib/python3.4/dist-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 1096, in stack_reserve_end_area
  File "/usr/local/lib/python3.4/dist-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 501, in reserve_end_area_nonrec
  File "/usr/local/lib/python3.4/dist-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 545, in _mount_and_resize
  File "/usr/local/lib/python3.4/dist-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 883, in _resize
  File "/usr/lib/python3.4/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.4/dist-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 513, in temp_mount
  File "/usr/local/lib/python3.4/dist-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 110, in quiet_call
subprocess.CalledProcessError: Command '['mount', '-t', 'btrfs', '-o', 'noatime,noexec,nodev', '--', '/dev/sda4', '/tmp/tmp8uo886hz.privmnt']' returned non-zero exit status 32

which clearly indicates that /dev/sda4 is used instead of /dev/sda5.

Can't convert logical partitions to bcache

Encountered issue similar to
#1
but can't fix it mentioned way.
I've installed ubuntu 13.10 x64.
primary /dev/sdc1 (512MB) mounted to /boot
/dev/sdc2 is extended partition containing:
/dev/sdc5 (swap)
/dev/sdc6 (/)
/dev/sdc7 (bcache0 mounted to /home)
I'm trying to convert root filesystem to bcache using blocks.
blocks told me "The range we want to reserve overlaps with the start of partition /dev/sdc-1 (metadata), the shrinking strategy will not work."
Moved /dev/sdc1 1 mb from beginning - got same message. Moved 15 MB - same effect. Created new "cleared" partition at the beginning of disk and than removed it (I believe, this should overwrite any data at that place - got same message.
Any ideas how to fix this?

ValueError: Unable to store text at node! when converting to bcache

After installing LVM on the HDD using blocks, I used make-bcache on a live CD to create a cache set,and ran the following:

ubuntu@ubuntu:~$ sudo blocks to-bcache /dev/mapper/vg.sda6-sda6 --join=d2989864-2169-4031-8030-9ba4b37925fd
Will shrink the filesystem (ext4) by 4194304 bytes
Checking the filesystem before resizing it
e2fsck 1.42.5 (29-Jul-2012)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/mapper/vg.sda6-sda6: 185308/29515776 files (0.3% non-contiguous), 3050165/118045696 blocks
Copying the bcache superblock... ok
Loading LVM metadata... Traceback (most recent call last):
File "/usr/bin/blocks", line 9, in
load_entry_point('blocks==0.1.3', 'console_scripts', 'blocks')()
File "/usr/lib/python3/dist-packages/blocks/main.py", line 1856, in script_main
sys.exit(main())
File "/usr/lib/python3/dist-packages/blocks/main.py", line 1532, in main
return args.action(args)
File "/usr/lib/python3/dist-packages/blocks/main.py", line 1615, in cmd_to_bcache
device=device, debug=args.debug, progress=progress, join=args.join)
File "/usr/lib/python3/dist-packages/blocks/main.py", line 1378, in lv_to_bcache
device=device, size=device.size, debug=debug, forward=False)
File "/usr/lib/python3/dist-packages/blocks/main.py", line 1288, in rotate_lv
aug.text_store('LVM.lns', '/raw/vgcfg', '/vg')
File "/usr/lib/python3/dist-packages/augeas.py", line 232, in text_store
raise ValueError("Unable to store text at node!")
ValueError: Unable to store text at node!

Running from a Ubuntu 13.04 64 bit live CD. System is a Lenovo T430s w/ 500GB HDD (sda) and 16GB SSD (sdb). Upgraded to 3.10.x kernel on the HDD install. Let me know if you need more info. Thanks in advance for the help.

UPDATE: output of vgcfgbackup and sudo cat /etc/lvm/backup/vg.sda6 |xsel -b:

ubuntu@ubuntu:$ sudo vgcfgbackup
Volume group "vg.sda6" successfully backed up.
ubuntu@ubuntu:
$ sudo cat /etc/lvm/backup/vg.sda6 |xsel -b

# Generated by LVM2 version 2.02.95(2) (2012-03-06): Fri Sep 20 21:17:12 2013

contents = "Text Format Volume Group"
version = 1

description = "Created *after* executing 'vgcfgbackup'"

creation_host = "ubuntu"    # Linux ubuntu 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64
creation_time = 1379711832  # Fri Sep 20 21:17:12 2013

vg.sda6 {
    id = "024296-2c20-3511-e3bc-7da4-4e31-419d04"
    seqno = 1
    format = "lvm2" # informational
    status = ["RESIZEABLE", "READ", "WRITE"]
    flags = []
    extent_size = 8192      # 4 Megabytes
    max_lv = 0
    max_pv = 0
    metadata_copies = 0

    physical_volumes {

        pv0 {
            id = "024248-ca20-3511-e3bc-7da4-4e31-419d04"
            device = "/dev/sda6"    # Hint only

            status = ["ALLOCATABLE"]
            flags = []
            dev_size = 944377856    # 450.314 Gigabytes
            pe_start = 8192
            pe_count = 115279   # 450.309 Gigabytes
        }
    }

    logical_volumes {

        sda6 {
            id = "02433f-b420-3511-e3bc-7da4-4e31-419d04"
            status = ["READ", "WRITE", "VISIBLE"]
            flags = []
            segment_count = 2

            segment1 {
                start_extent = 0
                extent_count = 1    # 4 Megabytes

                type = "striped"
                stripe_count = 1    # linear

                stripes = [
                    "pv0", 115278
                ]
            }
            segment2 {
                start_extent = 1
                extent_count = 115278   # 450.305 Gigabytes

                type = "striped"
                stripe_count = 1    # linear

                stripes = [
                    "pv0", 0
                ]
            }
        }
    }
}

to-lvm fails on Debian Jessie

Attempting to run to-lvm on a Jessie box, target is a regular partition (not logical) on a physical device.

# blocks to-lvm --vg-name array /dev/sdc1
Will shrink the filesystem (ext4) by 7319552 bytes
Checking the filesystem before resizing it
e2fsck 1.42.12 (29-Aug-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
sleeperservice: 710213/976625664 files (1.8% non-contiguous), 3686020179/3906494203 blocks
Copying 4194304 bytes from pos 0 to pos 16000992935936... ok
Preparing LVM metadata... device-mapper: reload ioctl on synthetic-530aed8d-b63a-11e5-93f7-4439c4558050 failed: Invalid argument
Command failed
device-mapper: reload ioctl on synthetic-530aed8d-b63a-11e5-93f7-4439c4558050 failed: Invalid argument
Command failed
Traceback (most recent call last):
  File "/usr/local/bin/blocks", line 9, in <module>
    load_entry_point('blocks==0.1.4', 'console_scripts', 'blocks')()
  File "/home/james/src/blocks/blocks/__main__.py", line 2012, in script_main
    sys.exit(main())
  File "/home/james/src/blocks/blocks/__main__.py", line 1678, in main
    return args.action(args)
  File "/home/james/src/blocks/blocks/__main__.py", line 1886, in cmd_to_lvm
    synth_device(pe_size, device.size - pe_size))
  File "/usr/lib/python3.4/contextlib.py", line 283, in enter_context
    result = _cm_type.__enter__(cm)
  File "/usr/lib/python3.4/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/james/src/blocks/blocks/__main__.py", line 1274, in synth_device
    exit_stack=st)
  File "/home/james/src/blocks/blocks/__main__.py", line 150, in mk_dm
    assert proc.returncode == 0, 'Report to https://github.com/g2p/blocks/issues/8 if you see this'
AssertionError: Report to https://github.com/g2p/blocks/issues/8 if you see this

As an aside, running this on the block device as suggested in the instructions causes this error:

# blocks to-lvm --vg-name array /dev/sdc
Unsupported superblock type:

to-bcache fails

So I ran an offline conversion of a lvm volume to bcache before, but actually ran it on the console and couldn't copy and paste the failure. It did resize the ext4 fs, but then started to fail pretty quickly after that. If I try to re-run the process now, this is what I get:

(blocks)root@alucardo:/opt/blocks# bin/blocks to-bcache --join $(cat /root/cset.uuid) /dev/vg0/home
The filesystem (ext4) leaves enough room, no need to shrink it
Command ['dmsetup', 'remove', '--noudevsync', '--', 'synthetic-33181afa-87dd-11e3-9c3d-3085a99c4b04'] has failed with status 1
Standard output:

Standard error:
device-mapper: remove ioctl on synthetic-33181afa-87dd-11e3-9c3d-3085a99c4b04 failed: Device or resource busy
Command failed

Command ['dmsetup', 'remove', '--noudevsync', '--', 'rozeros-3317ad36-87dd-11e3-9c3d-3085a99c4b04'] has failed with status 1
Standard output:

Standard error:
device-mapper: remove ioctl on rozeros-3317ad36-87dd-11e3-9c3d-3085a99c4b04 failed: Device or resource busy
Command failed

Traceback (most recent call last):
  File "/usr/lib/python3.3/contextlib.py", line 248, in __exit__
    if cb(*exc_details):
  File "/usr/lib/python3.3/contextlib.py", line 200, in _exit_wrapper
    callback(*args, **kwds)
  File "/opt/blocks/src/blocks/blocks/__main__.py", line 154, in <lambda>
    exit_stack.callback(lambda: quiet_call(cmd))
  File "/opt/blocks/src/blocks/blocks/__main__.py", line 110, in quiet_call
    raise subprocess.CalledProcessError(proc.returncode, cmd, odat)
subprocess.CalledProcessError: Command '['dmsetup', 'remove', '--noudevsync', '--', 'synthetic-33181afa-87dd-11e3-9c3d-3085a99c4b04']' returned non-zero exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "bin/blocks", line 9, in <module>
    load_entry_point('blocks==0.1.4', 'console_scripts', 'blocks')()
  File "/opt/blocks/src/blocks/blocks/__main__.py", line 2012, in script_main
    sys.exit(main())
  File "/opt/blocks/src/blocks/blocks/__main__.py", line 1678, in main
    return args.action(args)
  File "/opt/blocks/src/blocks/blocks/__main__.py", line 1761, in cmd_to_bcache
    device=device, debug=args.debug, progress=progress, join=args.join)
  File "/opt/blocks/src/blocks/blocks/__main__.py", line 1510, in lv_to_bcache
    synth_bdev = make_bcache_sb(pe_size, data_size, join)
  File "/opt/blocks/src/blocks/blocks/__main__.py", line 1490, in make_bcache_sb
    assert bcache_backing.offset == bsb_size
  File "/usr/lib/python3.3/contextlib.py", line 55, in __exit__
    next(self.gen)
  File "/opt/blocks/src/blocks/blocks/__main__.py", line 1286, in synth_device
    synth.writable_end_size = writable_end_size
  File "/usr/lib/python3.3/contextlib.py", line 263, in __exit__
    raise exc_details[1]
  File "/usr/lib/python3.3/contextlib.py", line 248, in __exit__
    if cb(*exc_details):
  File "/usr/lib/python3.3/contextlib.py", line 200, in _exit_wrapper
    callback(*args, **kwds)
  File "/opt/blocks/src/blocks/blocks/__main__.py", line 154, in <lambda>
    exit_stack.callback(lambda: quiet_call(cmd))
  File "/opt/blocks/src/blocks/blocks/__main__.py", line 110, in quiet_call
    raise subprocess.CalledProcessError(proc.returncode, cmd, odat)
subprocess.CalledProcessError: Command '['dmsetup', 'remove', '--noudevsync', '--', 'rozeros-3317ad36-87dd-11e3-9c3d-3085a99c4b04']' returned non-zero exit status 1

Ubuntu PPA Down + Compile Instructions Old

I know this isn't a coding issue but I need some assistance with your project here and its looks to be exactly what we need. I am having a hell of a time installing this on Ubuntu 12.04.

I have a raid5 here which has gained an extra 30% space but it was partitioned without using LVM. We need that now. We do have a offsite mirror of the data so we could destroy and convert but an in-place conversion would be much better.

Tried to install via PPA instructions on github. apt-get update says the URL for the new PPA is dead.

Tried to install the requires libs manually and compile from source but things like python3-pip and others are missing in Ubuntu 12.04.

Any advice?

use "btrfs inspect-internal dump-super" instead of btrfs-show-super

btrfs-show-super is obsolete

https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs#STANDALONE_TOOLS

blocks to-lvm --join VG1 /dev/sdb1
Traceback (most recent call last):
File "/root/.local/bin/blocks", line 9, in
load_entry_point('blocks', 'console_scripts', 'blocks')()
File "/root/src/blocks/blocks/main.py", line 2012, in script_main
sys.exit(main())
File "/root/src/blocks/blocks/main.py", line 1678, in main
return args.action(args)
File "/root/src/blocks/blocks/main.py", line 1860, in cmd_to_lvm
block_stack.read_superblocks()
File "/root/src/blocks/blocks/main.py", line 1101, in read_superblocks
self.topmost.read_superblock()
File "/root/src/blocks/blocks/main.py", line 861, in read_superblock
stdout=subprocess.PIPE)
File "/usr/lib64/python3.4/subprocess.py", line 856, in init
restore_signals, start_new_session)
File "/usr/lib64/python3.4/subprocess.py", line 1460, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'btrfs-show-super'`

lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708
Codename: Core

[GUIDE] Converting root -> LVM on Ubuntu 20.04 Setup

This project hasn't been updated in years but I was able to get it working on Ubuntu 20.04. Here is what I did to get it working on a Ubuntu 20.04 host using an Ubuntu 20.04 Live CD to actually run blocks. I ran it successfully both in a VM environment (I did this to test before actually running it on my real environment) and on my desktop machine

Steps

On Your Host

perform the following steps:

make s

  • ure that filesystems are accessed via UUIDs in /etc/fstab (this is the default)
  • then run:
    $ sudo apt install lvm2
  • make sure that lvm.mod exists under your /boot partition
  • reboot into your LiveCD

In Your LiveCD

I was able to get this up and running on an Ubuntu 20.04 LiveCD by doing the following:

# sudo -i
## copy over an /etc/apt/sources.list and overwrite your current /etc/apt/sources.list using it. For example, you can use this: https://gist.github.com/ishad0w/788555191c7037e249a439542c53e170
# apt update
# apt install python3.8 python3-pip git libparted-dev libaugeas0 pkg-config libpython3.8-dev gcc cryptsetup lvm2 liblzo2-dev nilfs-tools reiserfsprogs xfsprogs e2fsprogs vim
# git clone https://github.com/g2p/blocks
# cd blocks
# pip3 install -r requirements.txt

You now have to make a small modification to main.py so you don't run into this issue: #8

vim /home/ubuntu/blocks/src/blocks/blocks/__main__.py

search for:

exit_stack.callback(lambda: quiet_call(cmd))

add this line BEFORE IT:

time.sleep(5)

now you can simply point it to your partition and reboot once it is done:

# blocks to-lvm /dev/vda3
The filesystem (ext4) leaves enough room, no need to shrink it
Copying 4194304 bytes from pos 0 to pos 134872039424... ok
Preparing LVM metadata... ok
If the next stage is interrupted, it can be reverted with:
    dd if=/dev/vda3 of=/dev/vda3 bs=4194304 count=1 skip=32156 conv=notrunc
Installing LVM metadata... ok
LVM conversion successful!
Volume group name: vg.vda3
Logical volume name: vda3
Filesystem uuid: 96c8179b-a4af-478d-ba6a-99908128f18e

now reboot your system and you should be good to go. I successfully ran this in both a VM (to test it out first) + my desktop installation

Can blocks be used to convert a DRBD device?

Hello,

Can blocks be used to convert an existing DRBD block device for use as the backing device with bcache? Is this safe/supported, given the extra metadata that DRBD stores on the device?

Thanks,

Andrew

Cannot convert to LVM

Trying to convert an ext4 volume on /dev/sdb to lvm and get the following error (after successful resize it seems):

The filesystem (ext4) leaves enough room, no need to shrink it
Copying 4194304 bytes from pos 0 to pos 4000778813440... ok
Preparing LVM metadata... Traceback (most recent call last):
  File "/usr/bin/blocks", line 9, in <module>
    load_entry_point('blocks==0.1.4', 'console_scripts', 'blocks')()
  File "/usr/lib64/python3.4/site-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 2012, in script_main
  File "/usr/lib64/python3.4/site-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 1678, in main
  File "/usr/lib64/python3.4/site-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 1886, in cmd_to_lvm
  File "/usr/lib64/python3.4/contextlib.py", line 283, in enter_context
    result = _cm_type.__enter__(cm)
  File "/usr/lib64/python3.4/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/usr/lib64/python3.4/site-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 1276, in synth_device
  File "/usr/lib64/python3.4/site-packages/blocks-0.1.4-py3.4.egg/blocks/__main__.py", line 170, in __init__
AssertionError: /dev/mapper/synthetic-7fc406e4-2a55-11e6-8ef2-00012e37f3d5

Can't convert my / file system

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?

'to-bcache' fails with assertion error

Hey, I'm running into a problem I can't quite figure out on my own.
I have a LVM2 volumegroup 'mass_storage' with the logical volume 'storage' which I try to convert into a bcache thingy.

Here is the output:

:~$ sudo blocks to-bcache /dev/mass_storage/storage

The filesystem (xfs) leaves enough room, no need to shrink it
Copying the bcache superblock... ok
Loading LVM metadata... ok
Traceback (most recent call last):
File "/usr/bin/blocks", line 9, in
load_entry_point('blocks==0.1.4', 'console_scripts', 'blocks')()
File "/usr/lib/python3/dist-packages/blocks/main.py", line 2002, in script_main
sys.exit(main())
File "/usr/lib/python3/dist-packages/blocks/main.py", line 1668, in main
return args.action(args)
File "/usr/lib/python3/dist-packages/blocks/main.py", line 1751, in cmd_to_bcache
device=device, debug=args.debug, progress=progress, join=args.join)
File "/usr/lib/python3/dist-packages/blocks/main.py", line 1507, in lv_to_bcache
device=device, size=device.size, debug=debug, forward=False)
File "/usr/lib/python3/dist-packages/blocks/main.py", line 1424, in rotate_lv
assert all(ch in ASCII_ALNUM_WHITELIST for ch in vgname), vgname
AssertionError: mass_storage

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.