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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-27-2008, 01:42 PM
|
#1
|
Member
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454
Rep:
|
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.
|
|
|
11-28-2008, 05:21 AM
|
#2
|
ELF Statifier author
Registered: Oct 2007
Posts: 676
Rep:
|
Quote:
Originally Posted by waelaltaqi
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
|
|
|
11-28-2008, 11:32 AM
|
#3
|
Member
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454
Original Poster
Rep:
|
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.
|
|
|
11-28-2008, 04:39 PM
|
#4
|
ELF Statifier author
Registered: Oct 2007
Posts: 676
Rep:
|
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
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)
|
|
|
|
11-28-2008, 05:52 PM
|
#5
|
Member
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454
Original Poster
Rep:
|
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.
|
|
|
12-01-2008, 08:32 PM
|
#6
|
Member
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454
Original Poster
Rep:
|
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
|
|
|
12-02-2008, 01:52 AM
|
#7
|
ELF Statifier author
Registered: Oct 2007
Posts: 676
Rep:
|
Quote:
Originally Posted by waelaltaqi
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 ?
|
|
|
12-02-2008, 02:36 AM
|
#8
|
Member
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454
Original Poster
Rep:
|
|
|
|
12-02-2008, 12:15 PM
|
#9
|
ELF Statifier author
Registered: Oct 2007
Posts: 676
Rep:
|
Quote:
Originally Posted by waelaltaqi
|
Thanks, nice article
|
|
|
All times are GMT -5. The time now is 10:40 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|