PDA

View Full Version : mounting ext2 filesystems? (not supported!)


bradb
2006-06-14, 02:30
Ok, so maybe I missed this, but now that xterm has been ported (and vi is stock), I've been trying to setup an ext2 filesystem without any success.

Actually I'm trying to test my port of mmc-unionfs, but I can't seem to mount any file system on the 770 except vfat.

Has anyone managed to get another filesystem type mounted?

The 8 characer filename limitation of vfat is killing me.

Brad.

BanditRider
2006-06-14, 05:25
Damn, I've been waiting for mmc-unionfs.

It looks like the ext2 support wasn't compiled into the kernel.

cat /proc/filesystems

shows just ms-dos and vfat

That's just stupid. Why would they do that?

I've got a 128MB FAT32 partition working, a 64MB swap partition working and a 800-odd MB ext2 that can't be mounted.

gnuite
2006-06-14, 16:30
Damn, I've been waiting for mmc-unionfs.

It looks like the ext2 support wasn't compiled into the kernel.

cat /proc/filesystems

shows just ms-dos and vfat

That's just stupid. Why would they do that?

I've got a 128MB FAT32 partition working, a 64MB swap partition working and a 800-odd MB ext2 that can't be mounted.
Ouch - no nfs or ext2? I can understand needing to trim the image a bit, thanks to adding all those new and useless media files, but don't take away my network drives and my more-useful memory card file system! It's a network-centric device, for crying out loud, they should be bragging about the ability to mount NFS drives, maybe even working with a slimmed down version of Samba to be able to mount Windows shares.

dattani98
2006-06-14, 17:33
So what do we do now??

Guess we have to wait for nokia to introduce the 1gb virtual memory...

bradb
2006-06-14, 18:45
So what do we do now??

Well, according to info I've seen posted here and on the developers list, it should be possible to build a new kernel with ext2fs support in it (as well as nfs, I suppose).

I've got a kernel image ready (since I needed it to build mmc-unionfs) so I'll try and see if I can't build a new one tonight. It would end up being just another package to install.

I've also been in touch with the author of mmc-unionfs and he's going to be looking at the 2006 beta shortly (and is much more likely to have a real solution than I will).

Brad.

bradb
2006-06-14, 19:45
Ok, so can anyone with root access try this:

insmod /mnt/initfs/lib/modules/2.6.16-omap1/ext2.ko

And then see if you can mount an ext2 filesystem? I can't test this right now, but it might work. Implies that ext2fs support is built in the kernel, but the module itself isn't loaded.

Brad.

EDIT: That's it! So, if you're looking to mount an ext2 filesystem at boot, make sure you insert the kernel module first.

Now, to test mmc-unionfs...

bradb
2006-06-14, 20:33
Damn, I've been waiting for mmc-unionfs.

Well, I've been talking to the author of mmc-unionfs and he stated that a port should be available by this weekend, if not sooner.

Of course if you can't wait and are the kind of guy who likes to live on the edge, drop me a PM. I've got a working port of mmc-unionfs (but it's not properly packaged).

Brad.

gnuite
2006-06-14, 21:03
Ok, so can anyone with root access try this:

insmod /mnt/initfs/lib/modules/2.6.16-omap1/ext2.ko

And then see if you can mount an ext2 filesystem? I can't test this right now, but it might work. Implies that ext2fs support is built in the kernel, but the module itself isn't loaded.

Brad.

EDIT: That's it! So, if you're looking to mount an ext2 filesystem at boot, make sure you insert the kernel module first.

Now, to test mmc-unionfs...
Awesome, ext2 works. But there is no module for nfs. So our network filesystems are still inaccessible....

richie
2006-06-14, 21:27
Well, I've been talking to the author of mmc-unionfs and he stated that a port should be available by this weekend, if not sooner.

cat /proc/filesystems
shows just ms-dos and vfat

Great news. Just curious, do you know what filesystem is used on the device anyway, surprised if the root filesystem uses vfat.

bradb
2006-06-14, 21:31
Great news. Just curious, do you know what filesystem is used on the device anyway, surprised if the root filesystem uses vfat.

Looks like jffs2 to me, but there are more filesystems listed than vfat and msdos (those, I'm assuming, are modules as well since they have no "nodev" before the name).

Brad.

BanditRider
2006-06-14, 21:43
Brad,
Where should I load the kernel module. I mean from which file?

bradb
2006-06-14, 22:12
Brad,
Where should I load the kernel module. I mean from which file?

Bandit-

Well, I assume that you're going to use a script in /etc/init.d to mount the filesystem at boot. I'd suggest adding the "insmod" command there. There should be examples of the script to use here or in the wolfram stuff.

(a more elegant approach is to use 'modprobe -l' to see if it's been installed already, but I'll leave that for others to do)

Since I'm using mmc-unionfs, I simply modified it's init script to install the module first.

Hope this helps,

Brad.

BanditRider
2006-06-14, 22:25
I intended to mount it in /etc/fstab

I'm not sure when those entries are mounted. but I need the module loaded before that.

I added a line to /etc/init.d/minircS to do the swapon -a for the swap partition.

dattani98
2006-06-14, 22:50
Great stuff!!

Will wait till the w/end fr a packaged version of mmc-unionfs........

Nice work guys.

bradb
2006-06-15, 05:28
BanditRider-

Ugh, sorry about that. I was thinking about an init file for activating swap. I'm not sure if that's soon enough in the boot process or not. I hope somebody else can comment...

And danttani98 - probably a good idea. I'm not sure if it's my port or not, but I found some JFFS2 checksum errors in my 'dmesg' output and my ext2fs partition was corrupt.

I've just reflashed back to the beta build to make sure I didn't mess something up, and since everything looks ok, I'm afraid it's my port of mmc-unionfs (but I'm going to test it again just to be sure) :-(

Brad.

richie
2006-06-15, 12:14
That's it! So, if you're looking to mount an ext2 filesystem at boot, make sure you insert the kernel module first.

Does the ext2 module use more memory than having it compiled in to the kernel?

Rich

BanditRider
2006-06-15, 14:54
I got it working.

I modified the /etc/init.d/minircS file as follows:

I added this line near the top after the PATH= line:
insmod /mnt/initfs/lib/modules/2.6.16-omap1/ext2.ko

Then at the bottom of the file just before the exit 0 line I added:
swapon -a
mount /media/mmc2

this activates my swap partition and mounts my ext2 partition.

I added these lines to my /etc/fstab:
/dev/mmcblk0p2 /media/mmc2 ext2 rw,noauto 0 0
/dev/mmcblk0p3 swap swap defaults 0 0

My ext2 filesystem is now mounted at boot time and all is good.

free shows:
$ free
total used free shared buffers
Mem: 62232 60176 2056 0 296
Swap: 64252 0 64252
Total: 126484 60176 66308

and df shows:
~ $ df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/mtdblock4 2048 2048 0 100% /mnt/initfs
none 512 28 484 5% /mnt/initfs/tmp
/dev/mtdblock4 126464 73708 52756 58% /
none 512 28 484 5% /tmp
none 1024 44 980 4% /dev
/dev/mmcblk0p2 790588 310068 440360 41% /media/mmc2
/dev/mmcblk0p1 126495 37161 89335 29% /media/mmc1


The formatting in this post is wierd but you get the idea.

I have 300MB of maps (street and satellite) for maemo-mapper loaded on that ext2 partition. Works great.

gnuite
2006-06-15, 15:02
Does the ext2 module use more memory than having it compiled in to the kernel?

Rich
Not noticeably, although the good thing about making it a module is that it no longer has to use up memory - I only have the module loaded when I am actually using the ext2 partition.

richie
2006-06-15, 18:05
Not noticeably, although the good thing about making it a module is that it no longer has to use up memory - I only have the module loaded when I am actually using the ext2 partition.

Yeah, though if you use union-fs, you will more than likely need it loaded all the time, thus I wondered if worth the effort - to save memory - to compile in ext2 to the kernel as opposed to a module. But if the memory is not noticeable, then presumably not worth the effort of compiling your own kernel?

Rich

gnuite
2006-06-15, 18:30
Yeah, though if you use union-fs, you will more than likely need it loaded all the time, thus I wondered if worth the effort - to save memory - to compile in ext2 to the kernel as opposed to a module. But if the memory is not noticeable, then presumably not worth the effort of compiling your own kernel?

Rich
Certainly not. Also, modules are generally preferred because, if something goes wrong with them, they can be unloaded/reloaded to sort of "reset" things without having to reboot the machine. Less of a concern with something that is rebooted as often as the Nokia 770, but in the server linux world, that's very important.

bradb
2006-06-15, 20:33
I have 300MB of maps (street and satellite) for maemo-mapper loaded on that ext2 partition. Works great.

Probably a stupid question - I've been having problems with my ext2 partition. I've noticed that everytime I reboot, if I look at the 'dmesg' output, it appears the ext2 partition is corrupt.

You haven't seen any problem like this, have you? I can reproduce it at will. It seems that a "shutdown -r now" from xterm doesn't cause the problem, but hitting the power button does.

Odd. I assume it's me.

Brad.

BanditRider
2006-06-16, 00:30
Maybe you need to unmount it.
I haven't seen that issue but I just added /media/mmc2 to the umount command in /etc/init.d/minireboot and minishutdown.
just in case.

bradb
2006-06-16, 22:12
Maybe you need to unmount it.

Well, if I let the system mount the it via /etc/fstab, I'd assume that the system would take care of umounting it at shutdown (otherwise it's a bug, right?)

Time for more testing, I guess.

Brad.