[ENBD] diskless enbd-client/enbd on initrd
Rudolph Bott
rb at megabit.net
Fri Feb 24 01:56:42 MST 2006
Peter T. Breuer wrote:
> "Also sprach Rudolph Bott:"
>
>>>Yes, but my question about how you chroot or umount the original root
>>>while the clients are running on it stands.
>
>
> You're not answering to this point (which I have put about three
> or four times now :().
What do you mean exactly? Neither the old root gets unmounted nor any
chroot'ing is done
>
>
>>>with the question I put a couple of times now! How can you chroot while
>>>the client daemons are running on the original root? At the very least
>>>they have the /dev/nda* entries open, no? That's what the error seemed
>>>to indicate.
>
>
>>the initrd. There is no chroot or whatsoever; its a simple call to
>>pivot_root(), which swaps the "roots" (initrd and rootfs on nbd). The
>
>
>>The error messages you see are
>>generated by the function perror(),
>
>
> Use set -x in the script if you want to see where the error occurs. As
> I said, I suppose it occurs at a mount or chroot or whatever, since the
> client is running on the old root and has the old device open, and thus
> several things will have a reference count above zero! I am looking for
> confirmation of that.
>
I really don't get that "set -x" thing? What script are you talking
about? The kernel calls the C-program I've alreay posted and that again
calls the regular /sbin/init from the real root fs (after mounting it
successfully).
>
>>And since the mount fails (because there is nothing "behind" /dev/nda),
>
>
> So the mount does fail, as I guessed? I suppose for the reason
> I guessed.
>
>
>>pivot_root fails, too.
>
>
> Indeed.
>
>
>>I Hope that clarified some things ;)
>
>
> I didn't need anything clarified - I am trying (and failing miserably)
> to direct your attention to the question of how you expect the mount or
> chroot or pivot root or whatever it is to succeed when the client is
> running on the old root and has several things open there!
Since everything works fine (at least the initial boot process) with
nbd-client, I thought I should give enbd-client a try and test it. I'm
not very happy with the overall performance of nbd-client (fs errors
which make the system crash sometimes etc.)
>
> When you have answered that question (and it is a question about your
> expectations), we will make some progress, I think!
>
> (in the expectation that the answer is "I didn't think about that", and
> "I don't know what effect that would have on the various operations I
> am trying to do", I urge you to check, using set -x, as I suggested,
> exactly what the command is that is failing, and to go on from there
> to strace that command, getting the precise error value - which is
> EBUSY, I suppose; I would suggest, guessing again as to what is going on, that you don't attempt to dismount the old root at all, if you are
> trying to do that - just leave it; if it was a ramdisk, live with it
> for the moment :-).
I'm not trying to unmount anything (that would be like biting the hands
that feed you), it's just a call to pivot_root(); explanation below
(taken from man page):
-- snip --
DESCRIPTION
pivot_root moves the root file system of the current process to the
directory put_old and makes new_root the new root file system of the
current process.
The typical use of pivot_root is during system startup, when the system
mounts a temporary root file system (e.g. an initrd), then mounts the
real root file system, and eventually turns the latter into the current
root of all relevant processes or threads.
-- snip --
--
Mit freundlichen Gruessen / with kind regards
Rudolph Bott
-------------------------------------------------------------------
Megabit Informationstechnik GmbH Karstr.25 41068 Moenchengladbach
Tel: 02161/308980 mailto:info at megabit.net ftp://megabit.net
Fax: 02161/3089818 mailto:support at megabit.net http://megabit.net
-------------------------------------------------------------------
More information about the ENBD
mailing list