LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-27-2008, 01:42 PM   #1
waelaltaqi
Member
 
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454

Rep: Reputation: 31
mount loop device ?


I'm following instructions in this link http://boink.pbwiki.com/LinuxP2V and i'm hitting a major road bump. All i'm trying to do is to add BusLogic support to initrd image so kernel won't panic when i boot VM.

Here is the error message that i'm getting:
Code:
cd /boot
gzip -dc initrd-2.4.20-8.img > /tmp/initrd.ext2
mkdir /mnt/initrd
mount -o loop /tmp/initrd.ext2 /mnt/initrd
mount: you must specify the filesystem type
I tried to add -t ext3 and -t ext2 and that didn't work. /dev/loop0 > 7 exist and lsmod lists loop as a module.
Any ideas?

Thanks in advance

Last edited by waelaltaqi; 11-27-2008 at 01:46 PM.
 
Old 11-28-2008, 05:21 AM   #2
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by waelaltaqi View Post
I'm following instructions in this link http://boink.pbwiki.com/LinuxP2V and i'm hitting a major road bump. All i'm trying to do is to add BusLogic support to initrd image so kernel won't panic when i boot VM.

Here is the error message that i'm getting:
Code:
cd /boot
gzip -dc initrd-2.4.20-8.img > /tmp/initrd.ext2
mkdir /mnt/initrd
mount -o loop /tmp/initrd.ext2 /mnt/initrd
mount: you must specify the filesystem type
I tried to add -t ext3 and -t ext2 and that didn't work. /dev/loop0 > 7 exist and lsmod lists loop as a module.
Any ideas?

Thanks in advance
As long as I remember initrd is compressed cpio file.
What's output of
Code:
file /tmp/initrd.ext2
You'll need unpack cpio archive, add your changes here and then repack it.

Note, that there are different variant of cpio format and kernel support only one of them. SO be sure specify correct flag to cpio when you create archive
 
Old 11-28-2008, 11:32 AM   #3
waelaltaqi
Member
 
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454

Original Poster
Rep: Reputation: 31
Read only filesystem .... linuxrc doesn't exist in unpacked cpio

Thank you Valery Reznic for your response. Originally i was trying the mount -o loop command on the VMware machine using a live CD. I decided to give the mount command a shot on the physical machine and for no apparent reason It worked but it's mounting loop as read only:
Code:
# mkdir /mnt/initrd
# mount -0 loop /boot/initrd.img.2.6.24
loop: module loaded
# ls /mnt/initrd
bin   dev2   keyscripts  linuxrc.conf  proc    scripts  usr
bin2  devfs  lib         loadmodules   sbin    sys      var
dev   etc    linuxrc     mnt           script  tmp
#touch /mnt/initrd/test
touch: cannot touch `/mnt/initrd/test': Read-only file system
#mount 
/dev/hda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/boot/initrd.img-2.6.24-default1 on /mnt/initrd type cramfs (rw,loop=/dev/loop/0)
#
The reason i'm doing all this is to edit linuxrc file to insert modules at boot time. I'm not sure why i'm getting "read only filesystem" while the filesystem appears to be read-write. Do i need an additoinal package so debian can write on cramfs partitions? doesn't make sense but it's possible. I checked on file permissions (i'm logged in as root):
Code:
#ls -al /dev/loop*
brw-rw---- 1 root disk 7, 0 2008-11-27 17:17 /dev/loop0
brw-rw---- 1 root disk 7, 1 2008-11-27 17:17 /dev/loop1
brw-rw---- 1 root disk 7, 2 2008-11-27 17:17 /dev/loop2
brw-rw---- 1 root disk 7, 3 2008-11-27 17:17 /dev/loop3
brw-rw---- 1 root disk 7, 4 2008-11-27 17:17 /dev/loop4
brw-rw---- 1 root disk 7, 5 2008-11-27 17:17 /dev/loop5
brw-rw---- 1 root disk 7, 6 2008-11-27 17:17 /dev/loop6
brw-rw---- 1 root disk 7, 7 2008-11-27 17:17 /dev/loop7
All i need to do as add two insmod lines to include BusLogic modules. I tried to use mkinitrd but in debian it seems that the command is very limited and doesn't allow inserting modules on the fly. the man page said that mkinitrd can insert modules into new image and i think lines needs to be added /etc/mkinitrd/modules and i'm not sure how since the file i have is almost empty except some commented lines.

So two questions for you here:
- Is there a way i can mount the loop file system on "true" read-write?
- How do i use mkinitrd properly under debain? The documentation that i found was regarding redhat in which mkinitrd gives a lot more options it seems ... there are -f and -v options that don't exist with debian ( I updated mkinitrd-tool with apt-get to newest version)

Last edited by waelaltaqi; 11-28-2008 at 02:55 PM.
 
Old 11-28-2008, 04:39 PM   #4
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
On Fedora it's different. Anyway you was finally able to mount it, thas good thing. Cramfs is read-only filesystem. (see for example here - http://en.wikipedia.org/wiki/Cramfs).I.e once created it can't be written. I have no particular experience with mkinitrd on debian, but even if it miss options that you need, I guess it's a script and you can easely adapt it for your task. Or at worse if it executable get source code, change it and recompile



Quote:
Originally Posted by waelaltaqi View Post
Thank you Valery Reznic for your response. Originally i was trying the mount -o loop command on the VMware machine using a live CD. I decided to give the mount command a shot on the physical machine and for no apparent reason It worked but it's mounting loop as read only:
Code:
# mkdir /mnt/initrd
# mount -0 loop /boot/initrd.img.2.6.24
loop: module loaded
# ls /mnt/initrd
bin   dev2   keyscripts  linuxrc.conf  proc    scripts  usr
bin2  devfs  lib         loadmodules   sbin    sys      var
dev   etc    linuxrc     mnt           script  tmp
#touch /mnt/initrd/test
touch: cannot touch `/mnt/initrd/test': Read-only file system
#mount 
/dev/hda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/boot/initrd.img-2.6.24-default1 on /mnt/initrd type cramfs (rw,loop=/dev/loop/0)
#
The reason i'm doing all this is to edit linuxrc file to insert modules at boot time. I'm not sure why i'm getting "read only filesystem" while the filesystem appears to be read-write. Do i need an additoinal package so debian can write on cramfs partitions? doesn't make sense but it's possible. I checked on file permissions (i'm logged in as root):
Code:
#ls -al /dev/loop*
brw-rw---- 1 root disk 7, 0 2008-11-27 17:17 /dev/loop0
brw-rw---- 1 root disk 7, 1 2008-11-27 17:17 /dev/loop1
brw-rw---- 1 root disk 7, 2 2008-11-27 17:17 /dev/loop2
brw-rw---- 1 root disk 7, 3 2008-11-27 17:17 /dev/loop3
brw-rw---- 1 root disk 7, 4 2008-11-27 17:17 /dev/loop4
brw-rw---- 1 root disk 7, 5 2008-11-27 17:17 /dev/loop5
brw-rw---- 1 root disk 7, 6 2008-11-27 17:17 /dev/loop6
brw-rw---- 1 root disk 7, 7 2008-11-27 17:17 /dev/loop7
All i need to do as add two insmod lines to include BusLogic modules. I tried to use mkinitrd but in debian it seems that the command is very limited and doesn't allow inserting modules on the fly. the man page said that mkinitrd can insert modules into new image and i think lines needs to be added /etc/mkinitrd/modules and i'm not sure how since the file i have is almost empty except some commented lines.

So two questions for you here:
- Is there a way i can mount the loop file system on "true" read-write?
- How do i use mkinitrd properly under debain? The documentation that i found was regarding redhat in which mkinitrd gives a lot more options it seems ... there are -f and -v options that don't exist with debian ( I updated mkinitrd-tool with apt-get to newest version)
 
Old 11-28-2008, 05:52 PM   #5
waelaltaqi
Member
 
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454

Original Poster
Rep: Reputation: 31
Way to make things easier ... :-) well i figured that out and i unpacked the cpio package but for some reason i couldn't find linxurc file i need to edit ... Anyways, and after some reading, i have to mess with mkinitrd.yaird and yarid to create an initramfs instead of initrd ... and insert those modules somehow..... According to many sources, the scsi BusLogic modules have to be either precompiled in the kernel or loaded into initrd. I already recompiled the kernel and that didn't work ... although i added all scsi moduels... took forever to build ..

... This whole thing has been a big pain in my bag .. :-) could have been resolved in an hour or two if it was a redhat ... here I am, three days so far and no results ... i used to be a debian fan i guess !!!!

i will work on it and post any results ...

Last edited by waelaltaqi; 11-28-2008 at 05:59 PM.
 
Old 12-01-2008, 08:32 PM   #6
waelaltaqi
Member
 
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454

Original Poster
Rep: Reputation: 31
issue was resolved by replacing initrd with initramfs ... that fired up the modules necessary to boot in addition to modifying /etc/fstab ...

Thanks a lot for the help
 
Old 12-02-2008, 01:52 AM   #7
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by waelaltaqi View Post
issue was resolved by replacing initrd with initramfs ... that fired up the modules necessary to boot in addition to modifying /etc/fstab ...

Thanks a lot for the help
How you choose which one to use ?
 
Old 12-02-2008, 02:36 AM   #8
waelaltaqi
Member
 
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454

Original Poster
Rep: Reputation: 31
i'm not an expert on the issue by any means but through my little experinse,

This explains the difference and the reason for using initfsram
 
Old 12-02-2008, 12:15 PM   #9
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by waelaltaqi View Post
i'm not an expert on the issue by any means but through my little experinse,

This explains the difference and the reason for using initfsram
Thanks, nice article
 
  


Reply


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
Trying to mount loop device during boot: permission denied openSauce Linux - Newbie 5 10-06-2008 01:07 PM
How to increase tmp partition - mount loop device grim2 Linux - Server 2 03-10-2008 09:27 AM
can't mount iso 'could not find any loop device' dethree Slackware 1 06-23-2005 02:14 AM
Cannot mount more than 8 iso image files as loop device marsim Debian 4 11-09-2004 05:05 AM
loop: can't open device /dev/loop0: No such device or address miaviator278 Linux - Security 3 06-09-2004 10:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:40 AM.

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