re-prefix the hd to root?

My question is, After prefixing another device
to /, how can I change the prefix the t77 partition
back to /.

I have a task that requires me to disassociate the
hard drive and work from a ramdisk as root. When I’m
done I need to prefix root back to the hard drive -
but it doesn’t work.

What I am doing is essentially:

/ramdisk/bin/prefix -R /=/ramdisk/ #prefix the ramdisk
mount /dev/hd0.0t77 /hd #make a mount point to reference
the hd
#Do a bunch of stuff . . .
prefix -R /=/hd/ #re-prefix the hd (!doesn’t really
work!)

After this last command I am left in limbo with a
severely crippled directory structure. I have tried
several other points to prefix to (/ramdisk/hd, /dev/hd0.0t77,
etc.), but none restore the prefix correctly.

I have had some success with prefix -R /=/ramdisk/hd/
but later, when I clean out the ramdisk I loose the prefix
point.

How can I get / back from this condition
/=/ramdisk/
to an original condition
/=4,f
?

Thanks

Joel Hannan <electrickid@rcn.com> wrote:

My question is, After prefixing another device
to /, how can I change the prefix the t77 partition
back to /.

I have a task that requires me to disassociate the
hard drive and work from a ramdisk as root. When I’m
done I need to prefix root back to the hard drive -
but it doesn’t work.

the easiest way around this is to make a ‘on’ like program
that simply does a qnx_prefix_setroot("//0/ramdisk") and then
exec/spawns your app. but this will only effect your app and
its children.

if you need to play with /, you could basically do what you are
doing using the qnx_prefix* calls. i’ve got some code that
demonstrates how if you need it, but the qnx_prefix_setroot()
is the preferred method…

What I am doing is essentially:

/ramdisk/bin/prefix -R /=/ramdisk/ #prefix the ramdisk
mount /dev/hd0.0t77 /hd #make a mount point to reference
the hd
#Do a bunch of stuff . . .
prefix -R /=/hd/ #re-prefix the hd (!doesn’t really
work!)

After this last command I am left in limbo with a
severely crippled directory structure. I have tried
several other points to prefix to (/ramdisk/hd, /dev/hd0.0t77,
etc.), but none restore the prefix correctly.

I have had some success with prefix -R /=/ramdisk/hd/
but later, when I clean out the ramdisk I loose the prefix
point.

How can I get / back from this condition
/=/ramdisk/
to an original condition
/=4,f
?

Joel Hannan <electrickid@rcn.com> wrote:

My question is, After prefixing another device
to /, how can I change the prefix the t77 partition
back to /.

How can I get / back from this condition
/=/ramdisk/
to an original condition
/=4,f

Easiest solution – never mount anything directly as / –
that is, never have a “/=4,f” prefix.

Mount your partitions as /hd. (Probably in your boot image,
then modify your sysinit to run things from /hd/…). At first
oppurtunity run:

/hd/bin/prefix -A /=/hd/

Mount your ramdisk as /ramdisk.

Then you can just: “/hd/bin/prefix -R /=/ramdisk/” or
“/hd/bin/prefix -R /=/hd/”

Whenever you want to.

That way, you are never mounting/unmounting any partitions, all you are
doing is changing the alias for /.

-David