Discussion:
Mounting files instead of directories?
(too old to reply)
h***@gmail.com
2016-09-15 16:59:02 UTC
Permalink
I might try this in another group, as this looks like almost 100% spam.

Can an NFS client mount a file, instead of a directory?

I am trying to get diskless SunOS to work, with either a FreeBSD or Linux server.

It looks like when the client mounts its swap space, it does a mount request on the file name.
As far as I can tell, FreeBSD doesn't like that. I don't have a Sun server running to test.
J.O. Aho
2016-09-15 21:19:45 UTC
Permalink
Post by h***@gmail.com
I might try this in another group, as this looks like almost 100% spam.
Can an NFS client mount a file, instead of a directory?
As far as I ever seen, regardless of SunOS, BSD or Linux, the share is
always a directory and you can either mount the whole directory or a
sybdirectory.
Post by h***@gmail.com
I am trying to get diskless SunOS to work, with either a FreeBSD or Linux server.
It's a long time since I had a Sparc, but back then when I had one (the
model had a flawed IDE chip which made the local disk to be extremely
slow), I used tftp for initial startup and mount the NFS, but back then
there was no support for swap on NFS, so I didn't have a swap, thought I
had enough RAM with 2GB.
--
//Aho
h***@gmail.com
2016-09-15 21:32:08 UTC
Permalink
Post by J.O. Aho
Post by h***@gmail.com
I might try this in another group, as this looks like almost 100% spam.
Can an NFS client mount a file, instead of a directory?
As far as I ever seen, regardless of SunOS, BSD or Linux, the share is
always a directory and you can either mount the whole directory or a
sybdirectory.
Post by h***@gmail.com
I am trying to get diskless SunOS to work, with either a FreeBSD or Linux server.
It's a long time since I had a Sparc, but back then when I had one (the
model had a flawed IDE chip which made the local disk to be extremely
slow), I used tftp for initial startup and mount the NFS, but back then
there was no support for swap on NFS, so I didn't have a swap, thought I
had enough RAM with 2GB.
NFS swap goes back at least to SunOS 3.5, as that is when I first remember it.
It is nice to have a local swap disk, even if you don't have anything else local,
but I think that is rare.

Thanks for the fast response, I didn't know if anyone read this.
J.O. Aho
2016-09-16 05:56:07 UTC
Permalink
Post by h***@gmail.com
Post by J.O. Aho
Post by h***@gmail.com
I might try this in another group, as this looks like almost 100% spam.
Can an NFS client mount a file, instead of a directory?
As far as I ever seen, regardless of SunOS, BSD or Linux, the share is
always a directory and you can either mount the whole directory or a
sybdirectory.
Post by h***@gmail.com
I am trying to get diskless SunOS to work, with either a FreeBSD or Linux server.
It's a long time since I had a Sparc, but back then when I had one (the
model had a flawed IDE chip which made the local disk to be extremely
slow), I used tftp for initial startup and mount the NFS, but back then
there was no support for swap on NFS, so I didn't have a swap, thought I
had enough RAM with 2GB.
NFS swap goes back at least to SunOS 3.5, as that is when I first remember it.
It is nice to have a local swap disk, even if you don't have anything else local,
but I think that is rare.
It's a long time since I used SunOS and back then didn't do much
administration of systems, so not sure about that.
Post by h***@gmail.com
Thanks for the fast response, I didn't know if anyone read this.
I guess it's just me who still subscribes this news group, it's been
dead for years, this was the first time I seen anything here at for the
last couple of years.
--
//Aho
Bruce Esquibel
2016-09-16 10:47:09 UTC
Permalink
Post by h***@gmail.com
I might try this in another group, as this looks like almost 100% spam.
Can an NFS client mount a file, instead of a directory?
I am trying to get diskless SunOS to work, with either a FreeBSD or Linux server.
It looks like when the client mounts its swap space, it does a mount request on the file name.
As far as I can tell, FreeBSD doesn't like that. I don't have a Sun server running to test.
heh, it's been a while since I did anything with SunOS but this was from
something I saved from a man page all these years, not sure if there is any
portability to it...

--------------------------------------------------------------------------

To use an NFS or local file system swapname, you should
first create a file using mkfile(1M). A local file sys-
tem swap file can now be added to the running system by
just running the swap -a command. For NFS mounted swap
files, the server needs to export the file. Do this by
performing the following steps:

1. Add the following line to /etc/dfs/dfstab:

share -F nfs -o \
rw=clientname,root=clientname path-to-swap-file

2. Run shareall(1M).

3. Have the client add the following line to
/etc/vfstab:

server:path-to-swap-file - local-path-to-swap-file nfs \
--- local-path-to-swap-file -- swap ---

4. Have the client run mount:

# mount local-path-to-swap-file

5. The client can then run swap -a to add the swap
space:

# swap -a local-path-to-swap-file
--------------------------------------------------------------------

So it looks like it could be done, but I think (not sure) that swap used
to hang off the root directory (/swap) so it sort of was a directory, not
a file. What did they call it, a tmpfs or something like that.

Have you tried to just create a /swap on the server (linux or bsd) and just
export it? There may not be anything magical about it.

One lead otherwise, there is a guy named Don Nicolas (probably spelled
wrong) that hangs out occassionaly in the sun and solaris groups that seems
to maintain a small collection of older sun hardware, he might know something
about doing what you want to do.

I still have some of the sparc pizza boxes buried in the basement but haven't
touched them since the late 90's. I think the 1+ and a 5 needed the network
boot but the 10 and 20 had drives in them. Was neat to watch all of them
boot up but really prehistoric these days.

-bruce
***@ripco.com
Casper H.S. Dik
2016-09-16 11:02:36 UTC
Permalink
Post by Bruce Esquibel
I still have some of the sparc pizza boxes buried in the basement but haven't
touched them since the late 90's. I think the 1+ and a 5 needed the network
boot but the 10 and 20 had drives in them. Was neat to watch all of them
boot up but really prehistoric these days.
I think only the ELC and SLC (basically an IPC pizzabox mounted on the back
of a monitor) had no room for an internal disk; all the others SPARCs did have
an internal disk.

Of course, you may not have a SPARCStation 1+ without the disk. They'll probably
won't boot anymore because their NVRAM battery has run out and so there is no
valid content when starting OpenBoot.

Casper
h***@gmail.com
2016-09-16 13:22:53 UTC
Permalink
Post by Casper H.S. Dik
Post by Bruce Esquibel
I still have some of the sparc pizza boxes buried in the basement but haven't
touched them since the late 90's.
(snip)
Post by Casper H.S. Dik
I think only the ELC and SLC (basically an IPC pizzabox mounted on the back
of a monitor) had no room for an internal disk; all the others SPARCs did have
an internal disk.
The one I am working on is a Sun 3/E, which is a 6U VME board (CPU, RAM,
and serial ports), with an other 6U board for SCSI and ethernet.

It didn't take long to get RARP and TFTP working on FreeBSD, but I couldn't
get bootparamd to work on either FreeBSD or Linux. As far as I can tell,
neither one will accept the packets addressed to the 255.255.255.255
broadcast address. But then I got bootparamd, compiled from source,
to run on OS X.

Then it mounts root, loads in vmunix, and tries to mount swap.

It I put the name of the directory with the swap file in bootparamd, it
looks like it mounts it, but then says 0 bytes swap. If I put the name
of the swap file in, the mount fails.

It seems to me that FreeBSD doesn't allow mounting of files, only
directories. It is about 20 years since I last did any of this, and forgot
that it mounted a file, but that looks like what it wants to do.

I have an IPC and IPX, both seem to have dead power supplies.
Might just be bad capacitors, but I didn't look into them yet.
If I had one of them running, I could try it for a server.

thanks,

-- glen
Casper H.S. Dik
2016-09-16 13:28:39 UTC
Permalink
Post by h***@gmail.com
It I put the name of the directory with the swap file in bootparamd, it
looks like it mounts it, but then says 0 bytes swap. If I put the name
of the swap file in, the mount fails.
How did you create the file? What type of file is it? SunOS does not
like files which are "holey" or seem to be holey, like compressed ZFS
files. And I hope it's < 2GB.


SunOS is such a long ago memory that I can't remember these
specific issues other than that "there was something there".

Casper
h***@gmail.com
2016-09-16 19:56:40 UTC
Permalink
On Friday, September 16, 2016 at 6:28:40 AM UTC-7, Casper H.S. Dik wrote:

(snip, I wrote)
Post by Casper H.S. Dik
Post by h***@gmail.com
It I put the name of the directory with the swap file in bootparamd, it
looks like it mounts it, but then says 0 bytes swap. If I put the name
of the swap file in, the mount fails.
How did you create the file? What type of file is it? SunOS does not
like files which are "holey" or seem to be holey, like compressed ZFS
files. And I hope it's < 2GB.
SunOS is such a long ago memory that I can't remember these
specific issues other than that "there was something there".
I created it with dd if=/dev/zero bs=1024 count=4096 ...

Yes, FreeBSD doesn't have mkfile.

But when it boots, it notes that there is 0K swap space, if I put the
name of the directory in the swap= parameter in bootparams.
If I put the file name, the mount fails.

I haven't tried decoding the NFS packets to see what it is actually
doing in the process.

The machine has 4M RAM, so I didn't make it too big. Maybe it
should be 8M.

thanks!
h***@gmail.com
2016-09-16 20:28:45 UTC
Permalink
On Friday, September 16, 2016 at 12:56:42 PM UTC-7, ***@gmail.com wrote:

(snip)
Post by h***@gmail.com
But when it boots, it notes that there is 0K swap space, if I put the
name of the directory in the swap= parameter in bootparams.
If I put the file name, the mount fails.
OK, got that one to work.

Turns out that you can mount files, but can't export them.

Also, FreeBSD has different rules on what you can export.

You can either export some directories (that aren't children of other
exported directories) or export one directory with -alldirs, which allows
mounting of any subdirectory. You can't export two directories with -alldirs,
and you can't export files. Without -alldirs, you can't mount a child
directory of an exported directory.

So, I moved things around so I can export one directory with both
the root and swap directory in it, and the swapfile inside the swap
directory.

Now I need init in /sbin. Seems not to like to start if it isn't there.

thanks!

-- glen
h***@gmail.com
2016-09-16 21:39:37 UTC
Permalink
On Friday, September 16, 2016 at 1:28:46 PM UTC-7, ***@gmail.com wrote:

(snip, I wrote)
Post by h***@gmail.com
Now I need init in /sbin. Seems not to like to start if it isn't there.
There were a few more things to get right, but now it boots to multiuser mode!

I even mounted a 2TB NFS disk, and it seems to work, though df gives negative
numbers, as I presume it does 32 bit calculations.

The server with root partition and /usr partition is only 27GB, and also gives
negative numbers in df.

I don't have a display on it, but the serial port works, and now telnet works.

-- glen

Loading...