Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mounting files instead of directories?

17 views
Skip to first unread message

herrman...@gmail.com

unread,
Sep 15, 2016, 12:59:04 PM9/15/16
to
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

unread,
Sep 15, 2016, 5:19:47 PM9/15/16
to
On 09/15/2016 06:59 PM, herrman...@gmail.com wrote:
> 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.


> 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

herrman...@gmail.com

unread,
Sep 15, 2016, 5:32:10 PM9/15/16
to
On Thursday, September 15, 2016 at 2:19:47 PM UTC-7, J.O. Aho wrote:
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

unread,
Sep 16, 2016, 1:56:10 AM9/16/16
to
It's a long time since I used SunOS and back then didn't do much
administration of systems, so not sure about that.

> 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

unread,
Sep 16, 2016, 6:47:10 AM9/16/16
to
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
b...@ripco.com

Casper H.S. Dik

unread,
Sep 16, 2016, 7:02:44 AM9/16/16
to
Bruce Esquibel <b...@ripco.com> writes:

>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

herrman...@gmail.com

unread,
Sep 16, 2016, 9:22:54 AM9/16/16
to
On Friday, September 16, 2016 at 4:02:44 AM UTC-7, Casper H.S. Dik wrote:
> Bruce Esquibel <bj...@ripco.com> writes:

> >I still have some of the sparc pizza boxes buried in the basement but haven't
> >touched them since the late 90's.

(snip)
> 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

unread,
Sep 16, 2016, 9:28:40 AM9/16/16
to
herrman...@gmail.com writes:

>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

herrman...@gmail.com

unread,
Sep 16, 2016, 3:56:42 PM9/16/16
to
On Friday, September 16, 2016 at 6:28:40 AM UTC-7, Casper H.S. Dik wrote:

(snip, I wrote)
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!

herrman...@gmail.com

unread,
Sep 16, 2016, 4:28:46 PM9/16/16
to
On Friday, September 16, 2016 at 12:56:42 PM UTC-7, herrman...@gmail.com wrote:

(snip)

> 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

herrman...@gmail.com

unread,
Sep 16, 2016, 5:39:38 PM9/16/16
to
On Friday, September 16, 2016 at 1:28:46 PM UTC-7, herrman...@gmail.com wrote:

(snip, I wrote)

> 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
0 new messages