> Is there any way to find out what /dev/root is?
> (My motivation is to check if a partition is mounted)
> 
> I don't think checking /etc/fstab for "/" would be a
> good solution.  If a user chroot's, to run Parted off
> the hard disk (after booting off a floppy), /etc/fstab
> wouldn't match.

even if you chroot somewhere, rdev will still show the correct root:

# chroot /data/out/root
# rdev
0x0821 /
# exit
# df
Filesystem    Type   1k-blocks      Used Available Use% Mounted on
/dev/sda3     ext2     3984704   2250460   1531828  59% /
none          proc           0         0         0   -  /proc
none        devpts           0         0         0   -  /dev/pts
none         devfs           0         0         0   -  /devfs
none           shm     4194304         0   4194304   0% /var/shm
/dev/sdb1     ext2     4391488    288304   4013956   7% /sco
/dev/sdc1     ext2     4391488   3406828    984660  78% /data
/dev/hda   iso9660      596796    596796         0 100% /cd2
# rdev
/dev/sda3 /
# chroot /data/out/root
# rdev
0x0821 /
# ls -l /dev/sdc1
brw-rw----   1 root     disk       8,  33 May  5  1998 /dev/sdc1

and hex 21 is decimal 33.

Regards,
Tigran.

Reply via email to