* Loosing grub mbr after mounting jffs2 image with loop0 and mtdblock0
@ 2004-10-11 11:20 cdlinux
2004-10-13 13:40 ` cdlinux
0 siblings, 1 reply; 2+ messages in thread
From: cdlinux @ 2004-10-11 11:20 UTC (permalink / raw)
To: Linux-mtd ML
Hello list!
I'm relatively new to linux-mtd and have the following problem:
I'm using 128MB-Cf-Cards with an ext2 and a jffs2 partition.
The image i write to the cf-card has a grub-loader on it that will boot the
jffs2-image on (eg) /dev/hde2...
Now, when I want to change the image-partition, i mount it with
modprobe loop
losetup /dev/loop0 imagefile.img
modprobe mtdcore
modprobe blkmtd device=/dev/loop0 erasesz=64
mount -t jffs2 /dev/mtdblock0 /mnt/cfdisk
I then work on the filesystem and unmount everything after the changes are
done.
However, when I write the new image to a cfdisk (dd), I loose the grub info
and booting reports "no valid filesystem" / bootimage...
I suppose, it has to do with the way I mount the jffs2 partition (as I'm
actually mounting the entire image as loopdev/jffs2)...?
I'm unsure about what would be the right way to do this.
Any ideas, on how to proceed working on the 2nd partition of hde as jffs2
w/o loosing the grub mbr?
Thanks for any answers or pointers in the right direction,
and sorry if this has been asked before, i couldn't find an appropriate
answer yet..
Greetings
chris
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Loosing grub mbr after mounting jffs2 image with loop0 and mtdblock0
2004-10-11 11:20 Loosing grub mbr after mounting jffs2 image with loop0 and mtdblock0 cdlinux
@ 2004-10-13 13:40 ` cdlinux
0 siblings, 0 replies; 2+ messages in thread
From: cdlinux @ 2004-10-13 13:40 UTC (permalink / raw)
To: linux-mtd
On Mon, Oct 11, 2004 at 01:20:17PM +0200, cdlinux@koala.de wrote:
>
> I suppose, it has to do with the way I mount the jffs2 partition (as I'm
> actually mounting the entire image as loopdev/jffs2)...?
> I'm unsure about what would be the right way to do this.
>
Sorry for posting this on the wrong list.
For completeness sake:
The solution was fairly simple, all i had to do was set the loopdevice up
correctly with the right byte-offset inside the image and forget about the
erasesz-option to the blkmtd module (eg):
losetup -o 5881928 /dev/loop0 file.img
modprobe blkmtd device=/dev/loop0
mount -t jffs2 /dev/mtdblock0 /mnt/cfmnt
...
umount /dev/mtdblock0
rmmod blkmtd; rmmod jffs2;
losetup -d /dev/loop0
After that, one can safely dd the image to the cf-card w/o loosing
partitionings, grub etc.
Sorry again,
chris
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-10-13 13:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-11 11:20 Loosing grub mbr after mounting jffs2 image with loop0 and mtdblock0 cdlinux
2004-10-13 13:40 ` cdlinux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox