Re: [Hampshire] Using NFS root with raspberry pi. (Solution)

2023-10-11 Thread Tom Gamble via Hampshire
Hi,

Since the articles I found describing how to get nfsroot working were rather 
old and I am using Bullseye as the NFS server I wondered if that was the issue. 
so tried with an server running Centos 6 and bingo it worked no problems.

A quick cat /proc/fs/nfsd/versions
showed that on Centos 6 it supported  NFSv2, NFSv3 and NFSv4

$ sudo cat /proc/fs/nfsd/versions
+2 +3 +4

Bullseye on the other hand doesn’t offer NFSv2 by default

$ sudo cat /proc/fs/nfsd/versions
-2 +3 +4 +4.1 +4.2

the solution is

cat /etc/default/nfs-kernel-server 
# Number of servers to start up
RPCNFSDCOUNT=8
# enable NFSv2 required for Raspberry Pi that want to use an NFSroot
RPCNFSDCOUNT="8 -V 2"

# Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0

# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information, 
# see rpc.mountd(8) or http://wiki.debian.org/SecuringNFS
# To disable NFSv4 on the server, specify '--no-nfs-version 4' here
RPCMOUNTDOPTS="--manage-gids"

# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=""

# Options for rpc.svcgssd.
RPCSVCGSSDOPTS=""


So then 

$ sudo cat /proc/fs/nfsd/versions
+2 +3 +4 +4.1 +4.2

and all is well with the world.

Tom.



> On 11 Oct 2023, at 09:22, Adam John Trickett via Hampshire 
>  wrote:
> 
> Tom,
> 
> Can't say I've done it recently, but on my Red Hat course we did do remote 
> booting. I can't remember of the top of my head what we did, but I'm sure NFS 
> was involved.
> 
> However I think it's an interesting idea and I'll have to look it up and see 
> what I can find as well!
> 
> 
>> 
>> Thank you for your response I do like the idea of booting over the network
>> using PXE however I don’t currently have tufts server set up so was using
>> NFS a what I thought would be a quick solution.
>> 
>> Tell me if you set up the PI to PXE boot can you revery back to the Standard
>> SD boot t it won’t PXE boot?
>> 
>> Tom.
>> 
>>> On 10 Oct 2023, at 21:14, James Dutton  wrote:
>>> 
>>> On Tue, 10 Oct 2023 at 13:04, Tom Gamble via Hampshire
>>> 
>>>  wrote:
>>>> Hi,
>>>> 
>>>> On my Raspberry Pis I’ve had a few issues with SD Cards failing so
>>>> thought there would be some mileage in using an NFS root.  So if an SD
>>>> card fails I can just pop a new card in and my root fs will still be
>>>> good.> 
>>> Hi,
>>> 
>>> I have not tried your approach before. I have only done something
>>> called netboot.
>>> This is where you boot without an SD card at all.
>>> There are some hints on how to do it here:
>>> https://raspberrytips.com/network-boot-with-raspberry-pi/
>>> Now, I have not actually done it with a Raspberry PI, only with Linux
>>> servers and embedded systems, but the principles are the same.
>>> You set up a DHCP server, with parameters that tell it where to find
>>> the linux kernel and initrd files etc. it then tftp gets them or http
>>> gets them.
>>> An interesting aspect of this, is that booting over a 1Gbps network is
>>> actually quicker than booting from an SD card.
>>> Also if the device crashes, as the files are not stored on the crashed
>>> device, the files do not become corrupted at all, so it's really
>>> helpful when doing kernel development on an embedded system. It not
>>> only reboots quicker, but no files are corrupted, and you get to see
>>> the last logs before it crashed.
> 
> 
> -- 
> Adam Trickett
> Saint-Malo, Bretagne, France
> 
> Wind is a finite resouce and harnessing it would slow the wind
> down which would cause temperatures to go up.
>-- Joe Barton
>   US House Energy & Commerce Subcommittee member
> 
> 
> 
> 
> -- 
> Please post to: Hampshire@mailman.lug.org.uk
> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
> LUG URL: http://www.hantslug.org.uk
> --


-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] Using NFS root with raspberry pi.

2023-10-10 Thread Tom Gamble via Hampshire
Hi James,

Thank you for your response I do like the idea of booting over the network 
using PXE however I don’t currently have tufts server set up so was using NFS a 
what I thought would be a quick solution. 

Tell me if you set up the PI to PXE boot can you revery back to the Standard SD 
boot t it won’t PXE boot?

Tom.


> On 10 Oct 2023, at 21:14, James Dutton  wrote:
> 
> On Tue, 10 Oct 2023 at 13:04, Tom Gamble via Hampshire
>  wrote:
>> 
>> Hi,
>> 
>> On my Raspberry Pis I’ve had a few issues with SD Cards failing so thought 
>> there would be some mileage in using an NFS root.  So if an SD card fails I 
>> can just pop a new card in and my root fs will still be good.
>> 
> 
> Hi,
> 
> I have not tried your approach before. I have only done something
> called netboot.
> This is where you boot without an SD card at all.
> There are some hints on how to do it here:
> https://raspberrytips.com/network-boot-with-raspberry-pi/
> Now, I have not actually done it with a Raspberry PI, only with Linux
> servers and embedded systems, but the principles are the same.
> You set up a DHCP server, with parameters that tell it where to find
> the linux kernel and initrd files etc. it then tftp gets them or http
> gets them.
> An interesting aspect of this, is that booting over a 1Gbps network is
> actually quicker than booting from an SD card.
> Also if the device crashes, as the files are not stored on the crashed
> device, the files do not become corrupted at all, so it's really
> helpful when doing kernel development on an embedded system. It not
> only reboots quicker, but no files are corrupted, and you get to see
> the last logs before it crashed.


-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


[Hampshire] Using NFS root with raspberry pi.

2023-10-10 Thread Tom Gamble via Hampshire
Hi,

On my Raspberry Pis I’ve had a few issues with SD Cards failing so thought 
there would be some mileage in using an NFS root.  So if an SD card fails I can 
just pop a new card in and my root fs will still be good. 

The research I’ve done more or less says 

On the NFS Server set up the directory that will be your nfs root fs copy the 
contents of the rootfs on the SD Card to the directory.
edit the the /etc/fstab to reflect the nfsmount.

Change the /boot/cmdline.txt from the default to 

console=serial0,115200 console=tty1 root=/dev/nfs 
nfsroot=NFSHOSTIP:/path/to/nfsroot,tcp rw vers=3 ip=dhcp rootfstype=nfs
elevator=deadline rootwait

Now when you boot from that SDCard it should have too on the NFS filesystem.

When I tried it the pi hung for a while and then spat out the error 
 
VFS: Unable to mount root fs via NFS

followed by a kernel panic. 

So to try and understand what i had done wrongly I put the codlin.txt back to 
default and booted using the the rootfs on the SD card. 
I was able to mount the NFSroot on /media/nfsroot using the command 

# mount -t nfs NFSHOSTIP://path/to/nfsroot /media/nfsroot

I also added the following line to /etc/fstab 

NFSHOSTIP:/path/to/nfsroot /media/nfsroot  nfs defaults 0 0 

that allowed the NFSroot to mount using mount -a

rebooting the Pi also resulted in the NFSroot getting mounted on /media/nfsroot

So I’m pretty sure that my nfs configuration is good. 

When booting from the the default cmdline.txt and mounting the NFS filesystem  

# grep rpc.mountd /var/log/syslog 

does not give any messages.

However,  attempting to boot NFSroot the message

Oct 10 12:37:06 NFSHOST rpc.mountd[628]: authenticated mount request from 
CLIENTIP for /path/to/nfsroot (/path/to/nfsroot)

(Obviously I have anonymised the hostnames and ipaddresses.)

Further research suggested that the solution that message was to add 
“no_root_squash” as one of the options to the /etc/exports line but that is 
there anyway. 

I’ve mostly worked with the Red Hat, Fedora and Centos distros so my Debian 
knowledge a bit limited by comparison also even though I’ve used NFS a fair bit 
I’ve never really had any problems with it till now.

Can anyone give me some pointers as to where I can look for more information on 
what is going wrong.

Oh I nearly forgot. I’m running Bullseye on both the NFS server and the Pi and 
they both have the same nfs versions. 



Cheers.
Tom.


-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] Server Cabinets

2020-08-17 Thread Tom Gamble via Hampshire
Rob

I may have a 42” rack you can have for free. I’ll have to check as it is in 
store.  It’s assembled but the sides come off and so can be fairly easily 
transported.  

Tom 
There are 10 types of people.
Those that understand binary and those that don't.


>> On 17 Aug 2020, at 15:33, Rob via Hampshire  
>> wrote:
> 
> Hi all
>  
> I need to consolidate what is currently spread across 3*10U cabinets into 
> 1*42U (to have room for expansion).   As most of you know, I have no 
> transport so I need to get something
> Cheap
> Delivered or Local
> Preferably flatpack (to fit through my study door!)
>  
> Does anyone know a good supplier?   Whenever I look on ebay, I see plenty of 
> new flatpack for £500+, plenty of assembled for £20 but I can’t exactly pick 
> one up in a taxi.   I’m happy to hire a van but if, as most van hire seem to 
> be one operative – I can’t exactly expect one person to shift a 42U assembled 
> unit and of course I can’t guarantee the seller will help and it becomes a 
> tripartite conversation: me (who won’t be present during pickup / transport / 
> delivery), seller and delivery person: a recipe for disaster.
>  
> Do any members still do anything with Society of St James?   IIRC SoSJ used 
> to sell off old reconditioned tech.?
>  
> Cheers
> Rob
> -- 
> Please post to: Hampshire@mailman.lug.org.uk
> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
> LUG URL: http://www.hantslug.org.uk
> --
-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--

Re: [Hampshire] apache redirection problem

2009-08-15 Thread Tom Gamble

On Fri, 2009-08-14 at 04:31 -0700, Peter Alefounder wrote:
> If I use a web browser to look at a local html or pdf file, is it
> possible to set things up so that a link to an external web site is
> redirected to the local file system?
> 
> I have tried a .htaccess file along these lines:
> 
> RewriteEngine on
> Redirect http://external.site.com/filename.html 
> file:///home/pra/abc/filename.html
> 
> and also
> 
> RewriteEngine on
> RedirectMatch http://external\.site\.com file:///home/pra/abc
> 
> but in all cases I just get the error message
> "external.site.com" could not be found.
> 
> I have tried putting the .htaccess file in /home/pra/abc and in
> /home/pra/public_html which is the usual place apache would look
> for local files. I am not sure where it should go in this case.
> 
> I am using apache 1.3.34-4.1 on Debian 4.0. This is an isolated
> system with no Internet connection.


I think you are confusing apache and your browser.

When you give your browser a URL (or is it a URI)  the file: http:
https: ftp:  part tells the browser which protocol to use.  When you
have file:///home/pra/abc/filename.html then that will work even if
apache is not installed on the system.  Your browser is just reading
local files.

If the URL is http://some.site.com/whatever.html  the browser will
resolve the the IP address of some.site.com then attempt to connect to
port 80 at that address.  You have no DNS since your not connected to
the Internet therefore you will get the error message
"external.site.com" could not be found.  Your browser is not going to
attempt  to talk to your local apache web server unless you can fool it
in to thinking external.site.com is really localhost.

Regards,
Tom.



-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--