Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-06-2008, 01:58 AM   #1
Registered: Apr 2008
Posts: 267

Rep: Reputation: 30
Question 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:
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.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-06-2008, 02:06 AM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,867

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
This might help.
Old 05-07-2008, 03:54 AM   #3
Registered: Apr 2008
Posts: 267

Original Poster
Rep: Reputation: 30

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

I also found this helpful:

Old 02-24-2011, 05:37 PM   #4
LQ Newbie
Registered: Jan 2010
Location: Massachusetts
Distribution: LMDE
Posts: 4

Rep: Reputation: 3
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
3 members found this post helpful.
Old 05-02-2012, 10:18 PM   #5
LQ Newbie
Registered: Apr 2012
Posts: 3

Rep: Reputation: 0

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.
Old 07-01-2013, 04:23 PM   #6
LQ Newbie
Registered: Jul 2013
Posts: 1

Rep: Reputation: Disabled
Smile 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.


initrd, mount

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create initrd.img when compiling for i386 on AMD 64 or whatever penguin123 Linux - Kernel 4 10-21-2008 07:00 PM
How to create new initrd.gz (or initrd.img) file? kkpal Programming 2 12-10-2007 08:38 AM
how do I create an initrd.img file? aquaboot Debian 2 11-07-2007 05:40 PM
Add new cciss driver module to initrd.img ,stage2.img kunalroy2002 Linux - Software 4 09-25-2007 12:09 AM
Failed to symbolic-link boot/initrd.img-2.6.18-4-486 to initrd.img Scotteh Linux - Software 8 06-01-2007 11:24 PM

All times are GMT -5. The time now is 02:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration