pikvm shrink-backup failing with Error: Can't have a partition outside the disk! / !! PARTED FAILED!!! #86
Replies: 9 comments 1 reply
-
|
What shrink-backup supports:
Your partition setup: With that partition setup, shrink-backup will not work and I don't see any way of making it work either. I think the best option for you is to use Edit But all that kinda beats the purpose of how the kvm works, and the initial Another idea that might work is to modify shrink-backup to only look for the last partition rather than looking where root is mounted and use that partition to shrink. You will also have to either scan for all partitions and mount them in the loop correctly or hard-code them for this specific setup. If you want me to convert this issue to a discussion, please let me know by commenting here on this issue. |
Beta Was this translation helpful? Give feedback.
-
|
It doesn't sound like it's worth your time or my time to mess with this any more. I'm quite familiar with making dd images of the full disk and then shrinking it. I was doing that for a few years before I found shrink-backup. In addition to just straight dd / ddrescue, etc., this is what I used before shrink-backup - https://github.com/Drewsif/PiShrink The image will probably not change much so it won't need to be backed up much. Your tool is fantastic, it works for most of what I might need it for. I know the chances of it working for everything are slim to none and I accept that. |
Beta Was this translation helpful? Give feedback.
-
|
I was thinking about mentioning pishrink in combination with a As for shrink-backup modifications, you could absolutely do a check specifically for pikvm and if detected, hardcode the partitions and paths and shrink Edit Lines 835 to 844 in e4a52af Ie: - LOCAL_DEV_ROOT_PATH=$(mount --fake | grep ' / ' | awk '{print $1}')
+ LOCAL_DEV_ROOT_PATH=$(mount --fake | grep '/var/lib/kvmd/msd' | awk '{print $1}')And then create a backup with |
Beta Was this translation helpful? Give feedback.
-
|
Yes, I'm interested in trying to make this work. I really appreciate the offer for the assistance. Yes, please convert this to a discussion so that I can play with it and try to get it to work. Thanks much! |
Beta Was this translation helpful? Give feedback.
-
|
RE: PiShrink, I created the image using dd and then used PiShrink and it did work. It dies only work on the last partition. I tested the restore of the shrunken image and it dd work. Auto expansion doesn't work (I think PiShrink even told me that it wasn't going to work) so I just used KDE Partition manager to expand the image and then booted off the restored image. That said, making a dd image of a 64GB MicroSD card takes a good bit longer than using shrink-backup. |
Beta Was this translation helpful? Give feedback.
-
|
I edited line 601 of the script as per your documentation above Then I used shrink-backup to perform the backup and it worked. One observation is that there was no output to the console of all the files being copied. I forgot to use the Log file attached Next step(s)? |
Beta Was this translation helpful? Give feedback.
-
Sure, always glad to help people learn. I just want to be clear, I will not do the work for you, you will have to modify and make sure a restore of the img works with FULL FUNCTIONALITY of the kvm, but I will be as helpful as I can without writing the code for you. To start, if you want this to be merged into this repo, make all changes to testing branch, I will not accept pr:s directly into main branch. I will use testing branch if referencing line numbers.
Are you sure any data was actually copied with rsync? Because: Shrink-backup does not check for the availablility of rsync, it assumes rsync is available on the system. It also does not error out, ie, there is no other check than the exit pipe status for rsync, but since it did not exist, I assume there is no exit status so it returned as 0 and shrink backup thinks it completed successfully. Did you actually restore and boot the img or just assume it worked since shrink-backup did not exit with an error? The idea with hardcoding the path on the line I gave above, was to see if shrink-backup identified the last partition as the partition to be resized, but that was all. And it does and the initial setup seems to work but also means shrink-backup thinks p4 is the partition where As of now it detects the device as "archlinux-arm". Because: Since this seems to be an arch derivative, do you use apt or pacman to install applications? Or is this a completely immutable distro that does not allow installations whatsoever? Detection starts @ line 2660: Lines 2660 to 2701 in e4a52af Needs to be done:
If you feel overwhelmed by above, start with figuring out the detection of the operating system and we go from there. Edit
Make sure to follow their instructions or join their forum and ask questions because some of the pacman commands in there are not how you normally would do things on arch. |
Beta Was this translation helpful? Give feedback.
-
|
Excellent information! I am just starting my day ... gotta do some work so I can pay the bills ;-) I've read through once. Will read another time or two and start looking into the things that you have pointed out. But as a start:
yes I did and it booted fine. all partitions appear to be there. It has network connectivity. I can SSH to it. I installed rsync. I looked at the original MicroSD card partitions in KDE Partition Manager and compared to the restored shrink-backup image and they appeared to be the same except for the last partition, which I manually expanded.
There's a lot to digest here. I will dedicate some more time to testing later. Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Did you give up? This communication prompted me to look closer at the eval > rsync operation in the script and I found a bug. It is fixed on testing branch if someone is curious. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
pikvm shrink-backup failing with:
Error: Can't have a partition outside the disk! / !! PARTED FAILED!!!
To Reproduce
result shown below. Log file will be included
Harware (please complete the following information):
Additional context
Add any other context about the problem here.
For example output of
lsblkordf -hlsblk
df -h
Log
Run in debug mode by using
-loption and please provide the output ofshrink-backup.logCopy/paste the complete log of the backup that fails (not the entire log file, there could be multiple backups), not just the parts you think could be useful.
Beta Was this translation helpful? Give feedback.
All reactions