Discussion:
How to install Debian on a diskless NFS client?
(too old to reply)
Urs Thuermann
2007-01-07 16:10:12 UTC
Permalink
I want to install Debian testing on a diskless machine (i.e. no
floppy, no CDROM, no hard disk) using DHCP/TFTP and NFS. Besides
being diskless, the machine is a standard Pentium PC with a NIC which
has an etherboot EPROM to boot via DHCP/TFTP.

As described in the Debian Installation Guide, section 4.6 "Preparing
Files for TFTP Net Booting", I have downloaded and installed
netboot.tar.gz (from etch) on the server machine, configured DHCP and
TFTP (and GRUB, since instead of PXE, I boot nbgrub via TFTP, then
load the debian kernel and initd.gz from GRUB).

I can boot the debian kernel, initrd and debian installer on the
diskless client, choose language, country, keyboard layout, timezone,
configure the clock and network, configure the debian mirror to use.
But then the installer wants to detect and partition disk drives to do
the installation on. It doesn't allow to select an NFS-mounted
directory to install. When skipping the partitioning the installer
can't proceed, since it has no disk to use as a target.

I then tried to switch to a shell and to manually do a

mkdir /target; mount server:/tftpboot/client-dir /target

since I know /target is used in other installations. However, the
mount command in the initrd's busybox seems to be unable to do NFS
mounts. This is where I am stuck. How can I do the installation to
the server disk when the client isn't able to mount it?



A second way would be not to run the installation on the client, but
prepare the directory to be exported to the client directly on the
server. I think this is what debootsrap is for, but I haven't found
any good documentation how to use it. The Debian Installation Guide
doesn't describe it. According to the man page I have run

ARCH=i386 debootstrap etch /tftpboot/client-dir

which populates the target directory with a minimal system but don't
know how to proceed from here. I could probably tweak the result by
some editing in /etc, installing/building a kernel and initrd, but I
hope there is an easier way.


Can anyone give me a hint on this?

urs
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
d***@gmail.com
2007-01-07 18:40:08 UTC
Permalink
Post by Urs Thuermann
A second way would be not to run the installation on the client, but
prepare the directory to be exported to the client directly on the
server. I think this is what debootsrap is for, but I haven't found
any good documentation how to use it. The Debian Installation Guide
doesn't describe it. According to the man page I have run
ARCH=i386 debootstrap etch /tftpboot/client-dir
which populates the target directory with a minimal system but don't
know how to proceed from here. I could probably tweak the result by
some editing in /etc, installing/building a kernel and initrd, but I
hope there is an easier way.
Can anyone give me a hint on this?
I recently did something similar (biggest difference being that I used
pxe) for my "home entertainment system" (media-box). I think what you
want to do now is something like this:
mount -t proc none /tftpboot/client-dir
chroot /tftpboot/client-dir bin/bash

Then do basic tasks like;
passwd - set a root password (and perhaps adduser a new user)
/etc/hostname - set up the hosts name

Install initramfs-tools (apt-get install initramfs-tools), install a
kernel (which one depends on what you need) using apt-get, edit
/etc/mkinitramfs/initramfs.conf - set BOOT=nfs.
Then you use mkinitramfs to generate a initrd-image

Add a new entry to the chroots /etc/fstab, something like this:
/dev/nfs / nfs defaults
1 1
(this makes it "understand" that / is mounted using nfs), and perhaps
install other nfs-related packages for more options regarding nfs.
(apt-get install nfs-common portmap nfs-client)
You should make sure /etc/network/interfaces does *NOT* have an entry
for your interface - at least using the dhcp/pxe-boot process, it was
configured before this file was read, so one would lose
network-connectivity while setting up the "new" interface settings.

I hope this was understandable and helpful. I didn't write anything of
it down, so this is mostly taken from memory and inspecting the already
set-up system. :-)

Good luck. :)
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Urs Thuermann
2007-03-03 19:40:13 UTC
Permalink
Sorry for my late reply. I have been busy with other things so
continued my diskless install a couple of weeks after your answer.
Post by d***@gmail.com
mount -t proc none /tftpboot/client-dir
chroot /tftpboot/client-dir bin/bash
Then do basic tasks like;
passwd - set a root password (and perhaps adduser a new user)
/etc/hostname - set up the hosts name
[...]
OK, this is the second way to do the install that I have asked in my
first posting. I did do this now and succeeded. So thanks for your
answer.

However, I think the installer should be modified to not only support
booting via DHCP/TFTP, but also installing on NFS mounted directories
instead of local disks only.

I see several reason why I think this would be better than doing the
install on the server using debootsrap:
* Installation from the usual install would be easier
* The installation as you suggested requires that the server must also
be running Linux and be of the same architecture. Otherwise, you
couldn't mount /proc and chroot into the directory created by
debootsrap.

Also, I think the required modifications in the installer would
probably not that large.

urs
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Roberto C. Sanchez
2007-01-07 19:20:10 UTC
Permalink
Post by Urs Thuermann
I want to install Debian testing on a diskless machine (i.e. no
floppy, no CDROM, no hard disk) using DHCP/TFTP and NFS. Besides
being diskless, the machine is a standard Pentium PC with a NIC which
has an etherboot EPROM to boot via DHCP/TFTP.
Have you considered LTSP? I know it is not exactly the same thing, but
I have deployed it at my church and it works great.

Regards,

-Roberto
--
Roberto C. Sanchez
http://people.connexer.com/~roberto
http://www.connexer.com
Loading...