Discovering current MTD partition

Bjørn Forsman bjorn.forsman at gmail.com
Thu Apr 28 14:08:19 EDT 2011


On 27 April 2011 01:43, Umar Qureshey <umar at janteq.com> wrote:
> [...]
> Aside from scanning /proc/cmdline, is there a way to
> programmatically ascertain which mtd partition is active *now*.
> I need to find this information within a Python script but really if it can
> be done in C (perhaps a syscall?), it's all I need.

Busybox has a command called 'rdev' that looks up the block device
that is mounted on /.

$ busybox rdev
/dev/sda1 /

Look in busybox/util-linux/rdev.c and busybox/libbb/find_root_device.c
for the implementation details.

Best regards,
Bjørn Forsman



More information about the linux-mtd mailing list