I unpacked the contents of a Mageia 6 ISO image, including a Linux root file system in it, and I've updated the root file system by chrooting into it and running dnf update. I also installed a few extra packages and I'd like to know how to turn the directory into a virtual disk format I can run in VirtualBox, or Virt Manager. If I can boot this root file system, without converting it to a virtual disk format, describing how I might manage this would also be an acceptable answer.
1 Answer
Try this:
dd if=<path of squashfs root> of=~/filesystem.img bs=1m The should give you a raw mountable partition. If you run into errors, mounting, try without the bs argument. It will be slower, but it’s safer.
- That gives me
dd: error reading 'squashfs-root': Is a directory.Josh Pinto– Josh Pinto2018-11-04 13:18:02 +00:00Commented Nov 4, 2018 at 13:18 - Oh you mean after I've re-squashed it? That works. EDIT: Although it isn't bootable in a QEMU VM.Josh Pinto– Josh Pinto2018-11-04 13:30:20 +00:00Commented Nov 4, 2018 at 13:30
- Make sure you don’t put a forward slash after the root directory when specifying the input file.mreff555– mreff5552018-11-04 13:53:54 +00:00Commented Nov 4, 2018 at 13:53
- Also qemu may want you to convert it. It complains about raw files. Qemu has the command to do it but I rarely use it and I forget how.mreff555– mreff5552018-11-04 13:56:20 +00:00Commented Nov 4, 2018 at 13:56
- No slashes, I've tried using
format=raw,file=mageia-6.imgand still QEMU doesn't recognize it as a valid boot medium.Josh Pinto– Josh Pinto2018-11-04 14:04:14 +00:00Commented Nov 4, 2018 at 14:04
"VirtualBox VMs"/iso/Mageia-6.1-LiveDVD-Plasma-x86_64-DVD/Mageia-distrib/squashfs-root, so it's not at the root of that file system (i.e. not at/), but it's a fully functional Linux root file system (i.e. bin/, boot/, etc/, usr/, var/, etc. directories are in it and contain the very files you'd expect in a Mageia root file system). This is why I can chroot into it and rundnf updatewithout a problem.grub?) can understand your root filesystem, or you won't boot.