LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-04-2013, 04:55 PM   #1
markotitel
Member
 
Registered: Feb 2009
Location: Titel - Serbia
Posts: 181

Rep: Reputation: 18
NFS as root partition (from scratch)


Hi, I am fighting with this idea and cant really make it work.

What I have done till now is booting ISO and using that system as if it was booted of CD-ROM.

Have anyone succeded at installing linux to NFS partition and boot it via PXE?

I couldnt find amy clear tutorial for that.
 
Old 07-04-2013, 05:44 PM   #2
gdizzle
Member
 
Registered: Jul 2012
Posts: 234

Rep: Reputation: Disabled
Hi there,
I have booted a Live ISO of Ubuntu from NFS using PXE using Cobbler:

Code:
vim /var/lib/tftpboot/pxelinux.cfg/default

LABEL ubuntu-desktop-64
   kernel /images/ubuntu-desktop-64/vmlinuz.efi
   MENU LABEL ubuntu-desktop-64
   append initrd=/images/ubuntu-desktop-64/initrd.lz ksdevice=bootif lang=  kssendmac text  boot=casper netboot=nfs nfsroot=10.10.10.100:/opt/ubuntu_desktop/
   ipappend 2
Perhaps you can take the above and alter it to your needs on a disk partition and give it a go?
 
Old 07-04-2013, 06:10 PM   #3
markotitel
Member
 
Registered: Feb 2009
Location: Titel - Serbia
Posts: 181

Original Poster
Rep: Reputation: 18
Thank you for answer but I already wrote that I have booted live ISO .
 
Old 07-04-2013, 07:05 PM   #4
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2, 15.0
Posts: 635

Rep: Reputation: 154Reputation: 154
Booting an ISO from NFS uses some bootloader access to NFS to read some blocks. The root filesystem is the ISO, it is not NFS.

Trying to boot directly from NFS requires that NFS be the root filesystem, with full NFS read and write support in the kernel image. The root filesystem must be completely in the kernel image, and it cannot rely upon any modules.

I do not know if full NFS support can be put into the kernel.

I recommend making a small partition with some filesystem that Linux can boot from.
Any one of the filesystems that are supported directly in Linux kernel, EXT2,EXT3,EXT4, etc..
It only needs to be big enough to hold:
/root
/boot
/lib/modules
/sbin
/etc
/var (with log files)
/bin (maybe)

In /etc/rc.d/local.d you can mount the NFS partition with root links to /usr and /home.
Then if the NFS is down, unavailable, or has problems, then Linux can at least boot and tell you what is happening, and create log files.

There is a linux doc (under /usr/doc ) on how to create a diskless Linux.http://en.wikipedia.org/wiki/Diskles..._Boot_in_Linux
This solution boots an initRam disk image, and again does not boot the kernel from NFS.

Once Linux is up and support for NFS is in memory, then a root switch can move the root to an NFS directory.
Swap partition might have to stay local, but an additional larger swap space can be added to augment a small local swap partition. What swap space can be added by NFS files, I do not know.

Last edited by selfprogrammed; 07-04-2013 at 07:17 PM.
 
Old 07-04-2013, 07:09 PM   #5
markotitel
Member
 
Registered: Feb 2009
Location: Titel - Serbia
Posts: 181

Original Poster
Rep: Reputation: 18
I see, is there any other way to use diskless pc over network just as if it had a hard drive?
 
Old 07-04-2013, 07:28 PM   #6
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2, 15.0
Posts: 635

Rep: Reputation: 154Reputation: 154
This is an area where the Linux I run do not have direct support for that. There are workarounds. They need a local filesystem of some kind (even if only in an initRAM) for many kernel operations like modules and logging and config files in /etc, and /proc/ and /sys/. Some newer support would be experimental in the newer Linux kernels.
A google of "Linux diskless boot" will give you more recent information than what I know.

This requires creating a custom kernel, selecting exactly those kernel features that will work to boot using network access.
Should read the kernel docs (/usr/src/kernel/doc), and kernel config help (make config menu).

Last edited by selfprogrammed; 07-04-2013 at 07:31 PM.
 
Old 07-05-2013, 06:50 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by selfprogrammed View Post
This is an area where the Linux I run do not have direct support for that. There are workarounds. They need a local filesystem of some kind (even if only in an initRAM) for many kernel operations like modules and logging and config files in /etc, and /proc/ and /sys/. Some newer support would be experimental in the newer Linux kernels.
A google of "Linux diskless boot" will give you more recent information than what I know.

This requires creating a custom kernel, selecting exactly those kernel features that will work to boot using network access.
Should read the kernel docs (/usr/src/kernel/doc), and kernel config help (make config menu).
It has been a very long time...

The initrd provides the "local filesystem", but the NFS modules must be in the initrd provided via the PXE boot for it to work. That way the initrd can load the modules needed to mount the root filesystem over NFS.

What it LOOKS like is that the NFS modules are not in the initrd (which as you indicate, comes from a CD, so it would seem reasonable).

Now if you use a "netboot" iso, I think the NFS modules would be included. This also gives you the files you need to do a full pxeboot without needing the CD at all, though you still have to have the root filesystem on your NFS server.
 
Old 07-06-2013, 08:08 AM   #8
markotitel
Member
 
Registered: Feb 2009
Location: Titel - Serbia
Posts: 181

Original Poster
Rep: Reputation: 18
Hello, eventualy I have setup iscsi and installed linux on a remote hard drive .

Basically I was searching for easiest solution. To run diskless full distro with gnome. Next part is remote desktop for one old laptop.

Thank you
 
  


Reply

Tags
nfs, pxe boot



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rebuild Debian 6 server from scratch using existing root partition Nackers Linux - Server 0 12-18-2012 03:45 AM
Linux From Scratch: VirtualBox or Direct to HD partition? Ubunoob001 Linux - Virtualization and Cloud 2 05-18-2010 04:51 PM
nfs root path variable (pxe/nfs boot) freeindy Linux - Networking 3 03-11-2008 09:19 AM
On NFS, non-root users can move/rename files belonging to root. Stuart Morrow Linux - Server 2 11-05-2007 11:12 AM
ali aladdin v agp stinks :scratch: :scratch: :scratch: Mr Marmmalade Linux - Hardware 1 07-08-2003 05:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration