Discovering current MTD partition

Artem Bityutskiy dedekind1 at gmail.com
Thu Apr 28 04:52:18 EDT 2011


On Thu, 2011-04-28 at 10:00 +0200, Ricard Wanderlof wrote:
> On Thu, 28 Apr 2011, Artem Bityutskiy wrote:
> 
> > On Thu, 2011-04-28 at 09:31 +0200, Ricard Wanderlof wrote:
> >> On Wed, 27 Apr 2011, umar at janteq.com wrote:
> >>
> >>> Hi,
> >>>
> >>> /proc/mounts as well doesn't relay any info about /dev/mtdXX.
> >>
> >> Sorry, you are right of course. It just seems to say /dev/root on my
> >> system.
> >>
> >> The df command however seems to figure out which mtd device is mounted on
> >> / . I don't know exactly how it finds this out though. I'm pretty sure it
> >> uses /proc/mounts, because if /proc/mounts is missing it doesn't output
> >> anything, but it must be getting extra information from somewhere.
> >>
> >> /Ricard
> >
> > Well, the best it to look at df sources. But here is my guess:
> >
> > /dev/root must have come from the kernel command line, if I'm not
> > mistaken. You can find out what is your /dev/root from /proc/cmdline -
> > find rootfs=<xxx> there, and xxx is your device.
> 
> Well, in this case /dev/cmdline says
> 
> console=ttyS0 root=/dev/mtdblock3 rw rootfstype=jffs2 init=/linuxrc
> 
> so no mention of /dev/root there.

/dev/root is the alias for whatever is in root=, so in your
case /dev/root = /dev/mtdblock3

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list