LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 01-11-2008, 02:48 AM   #1
kkpal
Member
 
Registered: Oct 2007
Posts: 101

Rep: Reputation: 15
Thumbs up How to mount ext3 filesystem


hi all

I am creating initrd.gz file for that I was creating ext2 fs and mount that its working fine but when i try mount ext3 fs then it is giving error.
for ext2 fs I am running these commands:
# dd if=/dev/zero of=/boot/initrd bs=1M count=4
# mke2fs -F -m 0 1024 /boot/initrd
# mount -t ext2 -o loop /boot/initrd /mnt/initrd/


for ext3 fs what I will do?

Regards
KKPAL
 
Old 01-11-2008, 02:51 AM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,187

Rep: Reputation: 53
the only difference between ext2 and ext3 is ext3's journal. you don't want a journal in an initrd.
 
Old 01-11-2008, 03:07 AM   #3
kkpal
Member
 
Registered: Oct 2007
Posts: 101

Original Poster
Rep: Reputation: 15
hi

when I was using ext2 fs to make initrd.gz image when I am booting with it the boot process ends up with this error message :

"No filesystem could mount root, tried:cramfs squashfs romfs.
kernel panic- not syncing: VFS:unable to mount root fs on unknown block(1,0)"


thats why i am trying it with ext3 fs.

what is going wrong?

regards
kkpal
 
Old 01-11-2008, 04:47 AM   #4
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,187

Rep: Reputation: 53
i would guess you left ext2 out of the kernel config of the kernel that you are doing this with.
 
Old 01-11-2008, 04:55 AM   #5
ravibhure
Member
 
Registered: May 2007
Posts: 75

Rep: Reputation: 15
Hi,
can you try with this one
#mke2fs -j /boot/initrd
#mount -t ext3 -o remount,ro /boot/initrd
 
Old 01-11-2008, 05:43 AM   #6
kkpal
Member
 
Registered: Oct 2007
Posts: 101

Original Poster
Rep: Reputation: 15
its working fine for ext3 fs but it not solve my problem.
same error come at boot time.
I do not left ext2 out of the kernel config.
some lines of kernel config file:

# CONFIG_EXT2_FS=m
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set

I changed last two lines

# CONFIG_EXT2_FS_XATTR=y
# CONFIG_EXT2_FS_XIP=y
 
Old 01-11-2008, 09:10 AM   #7
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,153

Rep: Reputation: Disabled
Quote:
Originally Posted by kkpal View Post
its working fine for ext3 fs but it not solve my problem.
same error come at boot time.
I do not left ext2 out of the kernel config.
some lines of kernel config file:

# CONFIG_EXT2_FS=m
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set

I changed last two lines

# CONFIG_EXT2_FS_XATTR=y
# CONFIG_EXT2_FS_XIP=y
This is not a proper way to configure kernel nowadays. Besides, you are doing it wrong.
Code:
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set
This will give you ext filesystem support. But it's strongly recommended to use make menuconfig for kernel configuration.
 
Old 01-11-2008, 09:42 AM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,897
Blog Entries: 27

Rep: Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185
Hi,

Quote:
Originally Posted by Emerson View Post
This is not a proper way to configure kernel nowadays. Besides, you are doing it wrong.
Code:
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set
This will give you ext filesystem support. But it's strongly recommended to use make menuconfig for kernel configuration.
Not to argue but if someone wants to use a module for a kernel then there is nothing wrong or improper. As to direct editing a '.config' that is not an advised way of create/edit/update of such. Menuconfig is a curses based configure tool. If you want a 'X' based then use 'make xconfig' for your 'X' environment.

If you don't have the filesystem support compiled in the kernel then you will need to create a 'initrd'. I'm not sure what the OP is trying to do at this point.

Code:
from Slackware 12;
:~# cat /boot/README.initrd |most

  Slackware initrd mini HOWTO
by Patrick Volkerding, volkerdi@slackware.com
Wed Jun 27 15:58:08 CDT 2007

This document describes how to create and install an initrd, which may be
required to use the 2.6 kernel.  Also see "man mkinitrd".

1.  What is an initrd?
2.  Why to I need an initrd?
3.  How do I build the initrd?
4.  Now that I've built an initrd, how do I use it?


1.  What is an initrd?

Initrd stands for "initial ramdisk".  An initial ramdisk is a very small
Linux filesystem that is loaded into RAM and mounted as the kernel boots,
and before the main root filesystem is mounted.

2.  Why do I need an initrd?

The usual reason to use an initrd is because you need to load kernel
modules before mounting the root partition.  Usually these modules are
required to support the filesystem used by the root partition (ext3,
reiserfs, xfs), or perhaps the controller that the hard drive is attached
to (SCSI, RAID, etc).  Essentially, there are so many different options
available in modern Linux kernels that it isn't practical to try to ship
many different kernels to try to cover everyone's needs.  It's a lot more
flexible to ship a generic kernel and a set of kernel modules for it.
3.  How do I build the initrd?

The easiest way to make the initrd is to use the mkinitrd script included
in Slackware's mkinitrd package.  We'll walk through the process of
upgrading to the generic 2.6.21.5-smp Linux kernel using the packages
found in Slackware's slackware/a/ directory.

First, make sure the kernel, kernel modules, and mkinitrd package are
installed (the current version numbers might be a little different, so
this is just an example):

  installpkg kernel-generic-2.6.21.5_smp-i486-1.tgz
  installpkg kernel-modules-2.6.21.5_smp-i486-1.tgz
  installpkg mkinitrd-1.1.2-i486-3.tgz

Change into the /boot directory:

  cd /boot

Now you'll want to run "mkinitrd".  I'm using reiserfs for my root
filesystem, and since it's an IDE system the reiserfs module will be
the only one I need to load:

  mkinitrd -c -k 2.6.21.5-smp -m reiserfs

This should do two things.  First, it will create a directory
/boot/initrd-tree containing the initrd's filesystem.  Then it will
create an initrd (/boot/initrd.gz) from this tree.  If you wanted to,
you could make some additional changes in /boot/initrd-tree/ and
then run mkinitrd again without options to rebuild the image.  That's
optional, though, and only advanced users will need to think about that.

Here's another example:  Build an initrd image using Linux 2.6.21.5-smp
kernel modules for a system with an ext3 root partition on /dev/hdb3.

  mkinitrd -c -k 2.6.21.5-smp -m ext3 -f ext3 -r /dev/hdb3

The resulting initrd will automatically load the mbcache and jbd modules
used by the ext3 module.

To automatically use the current root filesystem and kernel, you can
simply use:

  mkinitrd -m ext3

4.  Now that I've built an initrd, how do I use it?

Now that you've got an initrd (/boot/initrd.gz), you'll want to load
it along with the kernel at boot time.  If you use LILO for your boot
loader you'll need to edit /etc/lilo.conf and add a line to load the
initrd.  Here's an example section of lilo.conf showing how this is
done:

# Linux bootable partition config begins
image = /boot/vmlinuz-generic-2.6.21.5-smp
  initrd = /boot/initrd.gz
  root = /dev/hda6
  label = Lnx26215smp
  read-only
# Linux bootable partition config ends

The initrd is loaded by the "initrd = /boot/initrd.gz" line.
Just add the line right below the line for the kernel image you use.
Save the file, and then run LILO again ('lilo' at the command line).
You'll need to run lilo every time you edit lilo.conf or rebuild the
initrd.

Other bootloaders such as syslinux also support the use of an initrd.
See the documentation for those programs for details on using an
initrd with them.


---------

Have fun!
This readme is for Slackware 12 but the information should give the general use information.

Quote:
excerpt from 'man mkinitrd';

mkinitrd is used to build an initial ramdisk. An initial ramdisk is a
very small set of files that are loaded into RAM and "mounted" (as
initramfs doesn't actually use a filesystem) as the kernel boots
(before the main root filesystem is mounted). The usual reason to use
an initrd is because you need to load kernel modules before mounting
the root partition. Usually these modules are required to support the
filesystem used by the root partition (ext3, reiserfs, xfs), or perhaps
the controller that the hard drive is attached to (SCSI, RAID, etc).
Essentially, there are so many different options available in modern
Linux kernels that it isn't practical to try to ship many different
kernels to try to cover everyone's needs. It's a lot more flexible to
ship a generic kernel and a set of kernel modules for it.
To the 'OP'; What are you trying to do?
 
Old 01-11-2008, 11:13 AM   #9
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,153

Rep: Reputation: Disabled
Quote:
Originally Posted by kkpal View Post
its working fine for ext3 fs but it not solve my problem.
same error come at boot time.
I do not left ext2 out of the kernel config.
some lines of kernel config file:

# CONFIG_EXT2_FS=m
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set

I changed last two lines

# CONFIG_EXT2_FS_XATTR=y
# CONFIG_EXT2_FS_XIP=y
Well, the EXT2_FS line is commented out. That's why I said it's wrong. And direct editing is certainly improper way for inexperienced users.
 
Old 01-11-2008, 11:29 AM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,897
Blog Entries: 27

Rep: Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185Reputation: 2185
Hi,
Quote:
Originally Posted by Emerson View Post
Well, the EXT2_FS line is commented out. That's why I said it's wrong. And direct editing is certainly improper way for inexperienced users.
I agree that direct editing is not the way. I was pointing out that you could use modules and don't need compiled/static within your kernel for a filesystem. I was not commenting about the '.config'.

The '# CONFIG_EXT2_FS=m' was commented out as you indicated. I was responding about the initrd and support.

There are advantages to using a initrd for the filesystem and support modules.
 
Old 01-14-2008, 11:59 PM   #11
kkpal
Member
 
Registered: Oct 2007
Posts: 101

Original Poster
Rep: Reputation: 15
I am giving you details of my building process for embedded target (I am using T2 SDE):
1. I downloaded t2-7.0-rc2.tar.bz2 and extract it in my root directory.
2. # cd t2-7.0-rc2
3 # ./script/Config -cfg new
4 then I choose:
- Target Distribution
(embedded) Generic Embedded
-Target Style
(dietlibc) diet libc (less is more)

-Architecture, CPU and Optimisation
(x86) x86 (AMD, Intel, VIA and compatible)
(i486) Optimised for intel 486
(isolinux) Use Syslinux/isolinux as CD loader

5 # ./script/Build-Target -cfg new
6. Some packages are failed to build, I removed those from config/new/package file. (i.e. libtool, cpio, coreutils, findutils, ppp, zile, popt, util-linux, psmisc. tftp-hpa, clockspeed) and add cramfs.
and continue rerun ./script/Build-Target -cfg new
7. Build process completed.
8. # dd if=/dev/zero of=/boot/initrd bs=1M count=20
9. # mke2fs -F -m 0 -b 1024 /boot/initrd
10. # mkdir /mnt/test
11. # mount -t ext2 -o loop /boot/initrd /mnt/test
12 and copy the contents of /root/t2-7.0-rc2/build/new-7.0-rc2-embedded-x86-i486/TOOLCHAIN/rootfs into /mnt/test directory.
13. # umount /mnt/test
14. # gzip -9 /boot/initrd
15. initrd.gz file is created
16. I copied initrd.gz, vmlinuz (/root/t2-7.0-rc2/build/new-7.0-rc2-embedded-x86-i486/boot/vmlinuz_2.6.21.7-dist) and syslinux.cfg in Compact Flash.
17. # syslinux /dev/sdb1 (to make CF bootable).
18. syslinux.cfg contain:
default vmlinuz root=/dev/ram0 initrd=initrd.gz ide=nodma PMEDIA=ideflash PKEYS=us
19. when I boot my system with CF support. It ended with these errors:
No filesystem could mount root, tried: cramfs squashfs romfs
kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

I am sorry. By mistake I commented lines in my previous post.
actually these are the lines.

CONFIG_EXT2_FS=m
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set

I changed last two lines

CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_XIP=y
 
Old 01-15-2008, 03:26 AM   #12
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,187

Rep: Reputation: 53
CONFIG_EXT2_FS=m

doesn't that need to be "y" to be able to mount the initrd at boot time? That's all i can think of.

Last edited by whansard; 01-15-2008 at 03:29 AM.
 
Old 01-15-2008, 08:57 AM   #13
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,153

Rep: Reputation: Disabled
Quote:
Originally Posted by whansard View Post
CONFIG_EXT2_FS=m

doesn't that need to be "y" to be able to mount the initrd at boot time? That's all i can think of.
If you set it to y then you do not need initrd.
 
Old 10-23-2008, 02:36 PM   #14
viklahan
LQ Newbie
 
Registered: Aug 2008
Distribution: Ubuntu/Fedora/Mandriva
Posts: 7

Rep: Reputation: 0
How to mount ext3 in RAM?


Hey Guyz! I was just wondering if its possible to mount an ext3 file system in RAM which I can later scan it.
For example... JFFS2 can be mounted and I have tried that and have been successful -

http://wiki.buici.com/wiki/Mounting_...esystem_in_RAM

It gives some information as how to mount a JFFS2 in RAM, I tried using similar commands for ext3 but then I get the following error:

ERROR: Module ext3 is in use

when I check /proc/modules I get the following abt ext3

ext3 110281 1 - Live 0xf887c000

So ext3 is already in use but then how can mount another ext3 file system in RAM?

Thanks
Vik


 
  


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
Confusing USB Filesystem Problem (Can't Wipe Ext3 Filesystem) dkaplowitz Linux - Hardware 3 04-14-2007 07:30 PM
error mounting ext3 filesystem... mount: /dev/hdd1: can't read superblock versaulis Linux - Software 5 11-26-2006 09:34 PM
using autofs to mount ext3 filesystem markcowley Linux - Software 5 07-17-2006 02:18 PM
Cannot mount ext3 filesystem on damaged hard drive Mathieu_G Linux - Hardware 3 04-01-2005 11:51 PM
create ext3 filesystem glock19 Linux From Scratch 2 02-06-2002 10:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration