LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Command help to mount INITRD.img and add files to it to create bootloader (https://www.linuxquestions.org/questions/linux-newbie-8/command-help-to-mount-initrd-img-and-add-files-to-it-to-create-bootloader-640206/)

newtovanilla 05-06-2008 01:58 AM

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:
Quote:

mount: you must specify the filesystem type
Could you tell me the correct way to use this "mount -o loop" command with this "initrd.img" file? I want to be able to add some files to it.

bigrigdriver 05-06-2008 02:06 AM

This might help.

newtovanilla 05-07-2008 03:54 AM

Thank you for the comment. That was useful to provide a link to a web about initrd.

I also found this helpful:


mcurran 02-24-2011 05:37 PM

if you wanna do it the simple way, like your original idea; you use mount -t sysfs

for example:

#make a directory to mount on
mkdir temp

#mount the file on temp...
mount -t sysfs /initrd.img /temp -o loop

bokusama 05-02-2012 10:18 PM

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?

sysfs:
block class devices fs kernel power
bus dev firmware hypervisor module

gunzip-cpio:
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.

ahavapeng 07-01-2013 04:23 PM

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 03:15 PM.