Re: SETTLED - Re: proper way to format/use floppies (i386)

2005-08-27 Thread Michael Adam
Hi Richard,

Richard P. Koett [EMAIL PROTECTED] wrote:
 
 I'm coming in rather late on this discussion - just curious about the
 formatting step? Presumably you would do something like:
 
 $ fdformat fd0

Yes exactly, but the low level formatting was not the question.
But thanks for answering anyway!

 I've had so many f*cking problems with floppy disks over the years I
 wouldn't trust using one without a successful format first.

Well, I can sing you a song of broken filesystems on floppies, too.
Perhaps I should also make it a habit to always fdformat first... 

Cheers, Michael



SETTLED - Re: proper way to format/use floppies (i386)

2005-08-26 Thread Michael Adam
Hi Jonathan,

I finally found a satisfactory answer from the sources. See below.

Jonathan Schleifer [EMAIL PROTECTED] wrote:
 c is always the whole disk and because the 
 disk has no disklabel and no partition table, it's also a. 

Well, the floppy _does_ have a disklabel. By default, it only has
partition c. The disklabel is thus simply empty. 

 It's the same like with
 CD-ROMs. You can access them also as cd0a and cd0c.

But cd-roms have a disklabel with c and a - please do a 
disklabel cd0 with a CD inserted! So it still seems strange 
to me that you can mount partition a where there is no
partition a and you can't do a newfs fd0a...

 I don't see any sense for a partition table and / or disklabel on a
 floppy disk.

But why would there be the floppy types in /etc/disktab?
As mentioned before the floppy3 type creates partition a
and partition b. 

Even more interestingly, I found an answer that satisfies me:

The OpenBSD developers' preferred way can be seen in the 
Makefile for the creation of the distribution boot-floppy images: 

from /usr/src/distrib/i386/common/Makefile.inc :
  
  VND?=   svnd0
  VND_DEV=/dev/${VND}a
  VND_RDEV=   /dev/r${VND}a
  VND_CRDEV=  /dev/r${VND}c
  FLOPPYSIZE?=144
  FLOPPYTYPE?=floppy3
...
  ${FS}: bsd.gz
  ...
  disklabel -w -r ${VND} ${FLOPPYTYPE}
  newfs -m 0 -o space -i 524288 -c 80 ${VND_RDEV}
  

So the short answer is:

$ disklabel -w fd0 floppy
$ newfs fd0a
$ mount /dev/fd0a /mnt

Thanks to all for your replies!

Michael



Re: proper way to format/use floppies (i386)

2005-08-25 Thread Michael Adam
Hi JCR,

J.C. Roberts [EMAIL PROTECTED] wrote:
 As far as I can tell, you basically asked for the right or preferred
 way of putting a filesystem onto a floppy

Yes, that is exactly my question.

 The best answer I know is fdformat. It works. It's simple and it's the
 most commonly accepted way to do what you asked.

Please put me straight if I am mistaken, but for all I know, 
fdformat does not create any filesystem on a floppy *at all*! 
It does a low level format of the floppy i.e. organize the raw
data space into cylinders, heads and sectors, etc. 

If you happen to have a filesystem on a floppy after doing
fdformat, then I am really puzzled.

The OpenBSD-FAQ-Section you seem to be referring to
must be the installation section 4.3.1 - Creating floppies on Unix
but there, after preparing the floppy with fdformat, a filesystem 
is put onto it with dd if=floppy37.fs of=/dev/rfd0c bs=32k.
 
Michael



problem remounting mfs readonly

2005-08-25 Thread Michael Adam
Hi,

I have encountered a problem remounting a memory file system (mfs) 
read-only. When create a mfs with, say

   # mount_mfs -s 16384 swap /mfs

then I get the following output by mount:

  mfs:9556 on /mfs type mfs (asynchronous, local, size=16384 512-blocks)

where the number 9556 is the process number.

Now, when I want to remount this readonly, trying it the usual way
I get the following error:

  # mount -ur /mfs
  mount_mfs: /dev/mfs:9556: No such file or directory

The problem is revealed by 

  # mount -dvur /mfs
  exec: mount_mfs -o async -o update -o ro mfs:9556 /mfs

The problem is thus the name of the special which is taken from the
mount table. I can now of course do the remount with the modified
command line

  #  mount_mfs -o async -o update -o ro swap /mfs

The problem I am having here is that this way, I have to take care of
all the mount options the mfs mount may have in addition to the ones
above by myself since the mount_mfs command does not seem to
collect these automagically like the mount command. 

I can for example modify the output of the mount -dvur command 
with sed to change mfs:number into swap. But this is kind of
a hack. 

So my question is: Is there a better way to remount the mfs?

Thanks in advance, 

Michael



Re: proper way to format/use floppies (i386)

2005-08-24 Thread Michael Adam
Jonathan Schleifer [EMAIL PROTECTED] wrote:
 Michael Adam [EMAIL PROTECTED] wrote:
  which is the right or preferred way to do so (since there are, as
  I pointed out several possible ways).
 
 I already answered that before:
 Jonathan Schleifer [EMAIL PROTECTED] wrote:
  Floppies usually don't have a partition table nor a disk label, so
  just newfs fd0c and you should be fine.

Well yes, it is working. But still: The floppy does have a disklabel
which does only have partition c by default. And it seems strange
to me, that I should create a filesystem on a partition c. And even
stranger, this file system can afterwards be accessed through partition
a which does not even show up in the disklabel.

What puzzles me even more is the fact, that in the boot Absolute OpenBSD
by Michael W. Lucas, it is said on page 310, that FFS file systems need
a valid partition table on every disk and then the author desribes the 
following steps:
  # disklabel -w /dev/rfd0c floppy
  # newfs /dev/rfd0c

which yields a disklabel with overlapping partitions, and disklabel -E fd0
tells me that the disklabel has an error an offers me to disable one partition
or the other...

These are the reasons why I was not completely content with your short 
an simple answer. (I do favor simple solutions, of course!) 

 You also heart this from others. So it's not that your main question got
 lost ;).

Not on your side anyway... ;-)

Cheers, Michael



Re: proper way to format/use floppies (i386)

2005-08-24 Thread Michael Adam
Spruell, Darren-Perot [EMAIL PROTECTED] wrote:
 
 Is there any reason to use FFS on a floppy? Won't FAT (-12, or whatever)
 work fine? Could you just mformat it and be along?

Yes, in fact there are:

1. As a matter of principle.
2. I need the FFS file permissions and ownerships on the floppy.

Michael



proper way to format/use floppies (i386)

2005-08-23 Thread Michael Adam
Hi,

I could not tell from the documentation which is the proper way
to setup and use floppy disks on the i386 architecture, i.e. which
is the right partition to use. 
I am talking about the standard 3.5 inch 1.44 MB floppy disks.
There are several possibilities to put a file system onto one:

First of all, a floppy needs to be low level formatted, which can be
achieved by the fdformat program. (Ususally, this is not necessary
nowadays, since floppies come preformatted.)

Then fdisk shows an empty partition table.
Without adding a type a6 partition, I have a valid disklabel:

 16 partitions:
 #  size   offset   fstype[fsize  bsize  cpg]
   c:   2880 0  unused00 # Cyl  0 -79

I can then do a newfs fd0c and afterwards the disklabel 
looks as follows:

 16 partitions:
 #  size   offset   fstype   [fsize  bsize  cpg]
  c:   2880 0  4.2BSD 2048  16384   80  # Cyl  0 -79

And I can mount /dev/fd0c. But _strangely_, I can mount /dev/fd0a
as well! (But I can't do newfs fd0a ...)

The other way would be to add a proper partition to the disklabel:
Either by doing disklabel -w fd0 floppy3 or by interactively
adding a partition a that covers the whole disk.  The first command
yields a disklabel like this:

 16 partitions:
 #  size   offset   fstype   [fsize  bsize  cpg]
   a:   2880 0  4.2BSD   5124096   80  # Cyl  0 -79
   b:   2880 0  unused   0 0 # Cyl  0 -79
   c:   2880 0  unused   0 0 # Cyl  0 -79

The second command's disklabel does not have the b partition.

Then, doing newfs fd0a or newfs fd0c yields a filesystem I can
mount as /dev/fd0a or /dev/fd0c in either case. The command 
newfs fd0c changes the disklabel to the following form though:

 16 partitions:
 #  size   offset   fstype   [fsize  bsize  cpg]
  a:   2880 0  4.2BSD   5124096   80  # Cyl  0 -79
  b:   2880 0  unused   0 0 # Cyl  0 -79
  c:   2880 0  unused  2048  16384   80  # Cyl  0 -79

which should actually be invalid since a and c overlap.
Anyway, it works and both partitions can be used.

Well, I am a little confused and would like to know which is the
proper way of handling this. I think that the proper way is to 
add an use partition a, but I have seen usage of partition c
in several documentations on the web, so this is why I ask.

Thanks in advance!

Michael



Re: proper way to format/use floppies (i386)

2005-08-23 Thread Michael Adam
Hi Steve,

On 8/23/05, STeve Andre' wrote:

 I would avoid all this and use the 'mtools' package instead.  It deals
 with msdos fat-12(?) floppies, and is tons easier to use.  Then you
 can hand those floppies to others and they can read/write them.

Using fat on the floppy is not an option. I need ffs.
Also I don't complain that it is too complicated, but
there are several working ways, and I am asking 
which one is the proper or preferred way.

Thanks anyway, Michael



Re: proper way to format/use floppies (i386)

2005-08-23 Thread Michael Adam
Hi,

On 8/23/05, J.C. Roberts [EMAIL PROTECTED] wrote:
 On Tue, 23 Aug 2005 16:58:47 +0200, Michael Adam
 [EMAIL PROTECTED] wrote:
 
 [...]
 First of all, a floppy needs to be low level formatted, which can be
 achieved by the fdformat program. (Ususally, this is not necessary
 nowadays, since floppies come preformatted.)
 
 
 Actually, it's in the FAQ under installation so it's not exactly
 listed as a FAQ item per se.
 
 $ fdformat /dev/rfd0c

Well, as I wrote above, I know about the fdformat program,
and low level formatting is actually not what my question
was aimed at -- it was aimed at the disklabel / filesystem
level of formatting. But this may have got lost in my overly 
long email. :-)

Also, the question was not how to get the job of putting
a filesystem onto a floppy accomplished at all, but which
is the right or preferred way to do so (since there are, as
I pointed out several possible ways).

Thanks anyway, Michael



How to change flags of a route?

2005-07-19 Thread Michael Adam
Hi,

I asked this question a week ago but there was no reply,
so I am asking it again somewhat differently. I would 
really greatly appreciate any comments on this!

Is it possible to change a cloned link-level host route 
(generated by arp requests) into a static gateway host 
route? 

The scenario is the following: On an OpenBSD firewall and
router, I have an interface if0 with address 192.168.1.1/24.
There  is a second interface if1 with an irrelevant address and
network, and a default route exists to some IP behind if1. 
Now, there is a host 192.168.1.2 which sits behind a third host
192.168.1.3 from the network segment of if0. So I would like to
set a host route as follows:

route add -host 192.168.1.2 192.168.1.3

this would generate a static host route:

DestinationGatewayFlags Interface
192.168.1.0/24   link#2UC if0
192.168.1.2   192.168.1.3UGHSif0

Now, it can happen that network traffic destined for host
192.168.1.2 comes in on if1 before the route is set. So 
my firewall sends out an arp request. Since it sees that
the IP belongs to the network of if0, it generates a cloning 
route of the form

DestinationGatewayFlags Interface
192.168.1.0/24   link#1UC if0
192.168.1.2link#1UHLc if0

for the still incomplete arp entry, and the link#1 is replaced
by the MAC address as soon as the arp requests completes
(if an arp reply comes through, for instance if host 192.168.1.3
does proxy arp for 192.168.1.2).

I would like to change this arp route into the static route
above, but the problem is that although the command

route change -host 192.168.1.2 192.168.1.3

replaces the Gateway entry of the route with 192.168.1.3
this change is only temporary since the flags are not changed:

DestinationGatewayFlags Interface
192.168.1.0/24   link#1UC if0
192.168.1.2192.168.1.3   UHLc if0

and hence the next arp request overwrites the route again. 
This behaviour is not changed when I add the -static parameter
to the route change command.

My question is if there is a reliable way of changing the 
route in the desired way preferably without removing it first. 
I feel this should be possible! Maybe I am just missing 
something obvious.
I could of course disable traffic to the host by firewall rules
or by bringing down interface if1, then remove the arp route
and finally add the static route. But this is not an option:
It would be best to be able to change the route on the fly 
without interrupting the traffic.

Well, this was some kind of novel, but I hope I have made my
problem clearer this time. I would be glad about any hints!

Thanks, Michael



Re: How to change flags of a route?

2005-07-19 Thread Michael Adam
Hi,

On 7/19/05, Alexander Bochmann [EMAIL PROTECTED] wrote:
 That setup is broken by design.

Well yes, but sometimes you don't have all aspects of the
network setup under your control.

 The only real way to make this work is
 to have 192.168.1.2 do proxy-arp for
 192.168.1.3, which will solve your routing
 problem automatically, as the ARP request
 won't fail anymore, and you won't need to
 set up anything on your gateway.

Yes, this is also exactly what I did. And in the long run,
I will probably split up the network segment thereby fixing
the broken network setup. But despite this, I have got the
feeling that it should be possible to change routes in the
aforementioned way.

Thanks for your answer,

Michael



Re: How to change flags of a route?

2005-07-19 Thread Michael Adam
On 7/19/05, Roy Morris wrote:
 
 sorry, I must be reading this wrong or not understanding. Why
 would you not just put in a static arp entry? Is there ever a
 time when you don't want traffic to take this route?

No, I want all traffic to take this route. There are several
imaginable solutions:

1. Fix network setup by splitting the network segment 192.168.1.0/24
   into subnets. This is the cleanest solution. But this might not
   be an option: One might not have control over all affected servers.
   Or the network space might be exhausted. (In the real setup we
   we have a smaller network of public addresses.)

2. Add a static proxy arp entry for 192.168.1.2 on the gateway 
   host 192.168.1.3. This works and is the solution I chose 
   for now. But somehow using hardware-addresses when I could
   fix it with IP addresses gives me a slightly bad feeling of doing 
   something wrong conceptually. The advantage of this solution
   is that the gateway host is the only host that needs special
   treatment.

3. Add a static host route for 192.168.1.2 via gateway 192.168.1.3.
   This has the advantage of omitting hardware addresses and the
   disadvantage of having to add routes on all servers in the network
   segment 192.168.1.0/24 that want to talk to 192.168.1.2. 
   And then, I can not alter an already set arp route into a static 
   gateway route without first deleting it, which was the problem
   described in my original mail.

4. Add a static arp entry for 192.168.1.2 with the MAC address
   of the gateway host 192.168.1.3 on the BSD box in question.
   This is possible but somehow the wrong place. It combines
   the disadvantages of solutions 2 and 3. 
   I have to check whether it is possible to change an incomplete
   or automatic arp entry into a static one without deleting or if
   the same problem as with the static host route occurs here.

There are several solutions for the problem, but I would like to
at least have the option to use solution 3 reliably since it might
(in some other setup) not be in my power to use solutions 1 or 2.

Michael