Command help to mount INITRD.img and add files to it to create bootloader
What is the correct way to mount an initrd.img file with the "mount" command and the "-o loop" option? I am newbie to Linux and to commands. I tried this:
mount -o loop initrd.img /tmp
This is error:
This might help.
Thank you for the comment. That was useful to provide a link to a web about initrd.
I also found this helpful:
if you wanna do it the simple way, like your original idea; you use mount -t sysfs
#make a directory to mount on
#mount the file on temp...
mount -t sysfs /initrd.img /temp -o loop
Been a while since that last post, but mcurran's method gave me a different file structure than newtovanilla's helpful link.
How does that work?
block class devices fs kernel power
bus dev firmware hypervisor module
run lib64 sbin bin lib proc root
sys tmp usr var dev init sysroot etc
I used find and the directories obtained with cpio are not found inside the sysfs mount. A quick search on Google returned a rather confusing explanation of sysfs -confusing as to how it relates to this situation.
This is now a question on theory, in practice the gunzip-cpio combo is just what I needed so thanks for that link.
The sysfs solution is incorrect
Note that the following gives the same result:
mount -t sysfs /inventAnonExistentFilename.whatever targetDirectory/
adding -o loop also has no effect on the behavior.
|All times are GMT -5. The time now is 11:45 PM.|