-
Notifications
You must be signed in to change notification settings - Fork 246
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
Partitioning errors in RAWDISK creation on Debian 7 and CentOS 6 #1846
Comments
Just tried on Ubuntu 14 LTS and it works fine. Then I tried to update (using backports) the Debian kernel to 3.16 and it does not change. On other news, using debian 8 there is no issue. Might be related to losetup/util-linux version. |
I know nothing at all about RAWDISK output disk_device="$(losetup --show --find "$disk_image")" ... local boot_partition="${disk_device}p1" ... mkfs.vfat $v "$boot_partition" ... it seems one cannot assume that the boot_partition device name I assume how partitions are named in this case also depends on @GreenBlood You could add a line read -p "Press ENTER to continue ... " 0<&6 1>&7 2>&8 anywhere in output/RAWDISK/Linux-i386/280_create_bootable_disk_image.sh |
@GreenBlood Thanks for reporting and your research done so far. @jsmeix What you have argued so far sounds reasonable. I'll try to figure out what could be done to improve portability. |
@jsmeix Yeah, i've actually already tried to run the commands by hand (dd, gdisk, losetup and such) and the loopXp1 does not appears anyhow. But running losetup -a or fdisk -l /dev/loop0 show that the loop device is activated. I noticed that util-linux was on a different version between CentOS 6 and 7, so I went and grabbed the last version source rpm and compiled it. Using the newly compiled binaries (I have not installed them as its a pretty important package), I got this result :
While the compiled recent partx reloads the partitions, the system one does not work I don't know what to do with these informations, I feel like I went too far but meh. Seems like a dead end to me. My VM is now a CentOS Frankeinstein monster. |
AFAIK creating device names for partitions is a kernel excercise. Unfortunately, there doesn't seem to be a tool which reports assigned partition device names. For example,
As it looks like there are different opinions on how to create partition devices names and no one to ask, my best guess would be to just rely on the fact that partition names will consist of the device name followed by some appendix. In this case, there is only one partition, so its name shouldn't be too hard to guess... @GreenBlood Could you change the line
to
in |
@GreenBlood There was an overlap in our comments: If it's not a naming issue but a kernel failing to update its partitions table, there is probably not much we can do here. Modern kernels should update their partition tables automatically. Otherwise
Would this make it work? |
@OliverO2 Well, It seems that CentOS 6 being nearly ten years old, losetup does not includes Using my compiled losetup, it accepts this argument but does not work any better.
I guess CentOS 6 is off the list for RAWDISK, unless there is a way that I'm unaware of. |
@OliverO2 local boot_partition="${disk_device}p1" test -b "$boot_partition" || Error "Cannot ceate raw disk image (no $boot_partition partition on $disk_device)" This does not make things work in environments where it currently cannot work |
@GreenBlood Maybe there is a solution after all if you're able to install the @jsmeix This should also improve the error message. I'll create a PR if this has been tested successfully (currently I don't have one of these older kernels available so I could not test it fully). |
@OliverO2 Ok so I tried your patch but no luck. But I think what @jsmeix was suggesting earlier might be the issue we're facing. It seems that running
So even though
I don't currently know how to "detect" where the loop device is going tho. EDIT : It would seem that using
CentOS 6 :
Ubuntu 16 LTS :
I'd have to test on more Linux distros but as |
@GreenBlood Thanks for trying. I think we're at least on the right path here. Note that my patch uses the Note that the mapping device DiagnosisCould you post the relevant section of the rear log when running the code with my patch? Maybe you could run it again even examine the state after the kpartx call by inserting
before the comment
and look for loop devices. What does Alternative solution without losetup:In addition, could you try this?
with
|
Correction - should be
(not |
Update: I have pushed a new commit 26e6eec onto my branch https://github.com/OliverO2/rear/commits/feature/rawdisk-portability-improvements. With that commit I could successfully build a RAWDISK output file on CentOS 6. Rear configuration:
Platform configuration:
Terminal log:
|
@GreenBlood |
Relax-and-Recover (ReaR) Issue
Relax-and-Recover 2.4-git.3020.aa7b197.master / 2018-06-21
At least CentOS 6 and Debian 7 (fully updated)
amd64
classic BIOS
I've found an issue while trying to use the RAWDISK output on old linux distroes (Centos 6 and Debian 7)
When the mkrescue commands reaches the 280_create_bootable_disk_image.sh file, it creates the raw file with dd, and adds correctly the rescue partition. However, on line 86 (mkfs.vfat) the program does not find the loop device's partition (/dev/loop0p1).
I tried running the losetup command myself and in fact no /dev/loop0p1 appears, even though if I run gdisk on the loop0 device it finds correctly the partition created beforehand.
I guess it has to do as how those distros handle "refreshing" the partitions available but I don't really know how to work around that.
None yet.
Regards,
Green
The text was updated successfully, but these errors were encountered: