Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bcache resizing #11

Open
adamryczkowski opened this issue Feb 25, 2014 · 4 comments
Open

bcache resizing #11

adamryczkowski opened this issue Feb 25, 2014 · 4 comments

Comments

@adamryczkowski
Copy link

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

@adamryczkowski
Copy link
Author

uname -r gives 3.11.0-12-generic. I use Linux Mint 16 64 bit (this distro is based on Ubuntu Saucy).

@g2p
Copy link
Owner

g2p commented Feb 25, 2014

/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.

Seems fixable, but it will require a kernel patch. I'll have to confront the bcache maintainer's past refusal of my patch to resize bcache devices from sysfs (a simple but not necessarily easy matter of getting him to take another look), and expand the patch to allow shrinking as well.

I might also ship a custom kernel for --maintboot, which won't require upstream's consent but will be more complicated to support.

@adamryczkowski
Copy link
Author

Thank you for your comment. I've managed to do backup and use make-bcache -B /dev/sda5 so at the moment, I don't need this patch right now.

@ozmad
Copy link

ozmad commented Jul 5, 2015

Hi,

Might I wake this thread up?
I've been running the following:
blocks to-bcache /dev/sdb3
and got the error below
My tech inf is:
mint 17.1 (up to date), 3.13.0-37-generic, x86_64
sdb3 is ext4
** it worked with a test drive one hour earlyer.
I am not sure how to check if there are any dirty configurations
("ls /sys/fs/bcache" shows only "register register_quiet" no uuid of any disk)
Thanks.

The error:

The filesystem (ext4) leaves enough room, no need to shrink it
Traceback (most recent call last):
File "/usr/bin/blocks", line 9, in
load_entry_point('blocks==0.1.4', 'console_scripts', 'blocks')()
File "/root/build-blocks/src/blocks/blocks/main.py", line 2012, in script_main
sys.exit(main())
File "/root/build-blocks/src/blocks/blocks/main.py", line 1678, in main
return args.action(args)
File "/root/build-blocks/src/blocks/blocks/main.py", line 1761, in cmd_to_bcache
device=device, debug=args.debug, progress=progress, join=args.join)
File "/root/build-blocks/src/blocks/blocks/main.py", line 1560, in part_to_bcache
ptable.reserve_space_before(part_start, bsb_size, progress)
File "/root/build-blocks/src/blocks/blocks/main.py", line 425, in reserve_space_before
return self._reserve_range(part_start - length, part_start, progress)
File "/root/build-blocks/src/blocks/blocks/main.py", line 413, in _reserve_range
block_stack.stack_reserve_end_area(part_newsize, progress)
File "/root/build-blocks/src/blocks/blocks/main.py", line 1096, in stack_reserve_end_area
block_data.reserve_end_area_nonrec(inner_pos)
AttributeError: 'BCacheBacking' object has no attribute 'reserve_end_area_nonrec'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants