Re: How to fdisk/disklabel whole disk for FreeBSD from command line?

2000-03-01 Thread Marc Frajola

On Tue, 29 Feb 2000, Doug White wrote:
 On Mon, 28 Feb 2000, Marc Frajola wrote:
 
  Thanks very much for the reply. I checked out the URL you gave
  (http://www.freebsd.org/tutorials/formatting-media/), and unfortunately
  I'm still wondering how to create one FreeBSD fdisk slice so that
  disklabel can actually create partitions.
  
  The reason why I sent the message to freebsd-hackers was because
  when I tried 'fdisk -e', it seems to assign a slice, BUT disklabel
  gives an error like 'No space left on device' or some such thing after
  running fdisk, making it obvious that the fdisk -e didn't work as I
  thought it should.
 
 What are you using for your command lines?  You have to target the
 disklabel specifically at slice 1 on the disk otherwise disklabel will
 think you're trying to overwrite the slice table and get mad.

Here's what I did:

fdisk -e /dev/rda1
disklabel -r -w da1 auto

The disklabel command gives 'disklabel: No space left on device'.

  I will check out the 'install' PicoBSD floppy here shortly to
  see if I can learn anything from that.
 
 I just did that twice today and it definitely works :)  The only problem I
 had with those is that the disk boot order (this is a L440GX+ board where
 you can configure it) was screwy (i.e. primary-master wasn't the preferred
 boot disk).

  If anybody knows right off what the sequence of commands (complete
  with arguments) to fdisk and disklabel a new drive to make a
  "compatiblity mode" bootable FreeBSD system slice (and make it active),
  I'd appreciate hearing from you.
 
 I have an awk script mercilessly stolen from phk that does the disklabel
 dirty work.  Otherwise it's straightforward:
 
 fdisk -e wd0
 disklabel .. magic .. 
 newfs /dev/wd0s1a

OK, may I ask what the ".. magic .." part is??

I am using SCSI drives (hence da). I tried doing 'camcontrol rescan
da1' as suggested by somebody on the mailing list, and that had no
effect on the problem.

When I use 'sysinstall', I can write an fdisk slice label and a
FreeBSD disk label properly, and all is well. I just can't automate it.

I glanced through the source code for disklabel and sysinstall. It
looks like sysinstall uses libdisk to write the label. The command-line
'disklabel' utility appears to use an ioctl to set the disklabel, and
the DIOCSDINFO call returns the error. My theory is that sysinstall
works because it does NOT go through the standard kernel interface (at
least if it does, I can't find the DIOCSDINFO call).

The reason the kernel returns the error appears to be because it
thinks one of the sizes given in the new label exceeds the size of the
fdisk slice.

Even if I try using 'disklabel -e da1' to edit the label, I still
get errors like 'disklabel: ioctl DIOCGDINFO: Invalid argument', so it
may not be something wrong with just the 'auto' mode on disklabel.

Anyway, I'm still very open to hints after spending several hours
trying to figure this out.

I noticed that 'fdisk -e /dev/rda1' seems to get the ending
cylinder number completely wrong, but even if I run fdisk entering what
I think are the proper numbers manually, disklabel still does not seem
to be happy.

As per your suggestion, I tried 'disklabel -r -w da1s1 auto', and
I get the following errors:

disklabel: ioctl DIOCGDINFO: Invalid argument
disklabel: auto: unknown disk type

So I'm doubt that disklabel really wants me to target slice 1
directly.

BTW, I'm using an Intel Xeon motherboard (SC450NX) with an Adaptec
2940U2W controller hooked up to a SCSI-to-SCSI RAID controller, and am
trying to do the fdisk/disklabel on the RAID drive. The BIOS reports
that the drive is slightly larger than what fdisk actually assigns to
the partition (in # of sectors -- I actually expected this slight
difference in size).

I really appreciate all the hints so far even though no solution
yet...

...Marc...

P.S.: If somebody who has PicoBSD source available could send me any
  relevant scripts or source excerpts from it that deal with fdisk
  or disklabel, it would be greatly appreciated.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



mounting filesystem multiple times

2000-03-01 Thread Dmitry S. Rzhavin

Hi!
I want to mount one filesystem rw once and ro multiple times
(lets say, 500 times). Can I do it? And if yes, will it slow
FreeBSD down and will it use additional memory, cpu and other
system resources in this case?


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



d: /kernel: malformed input file (not rel or archive) ??

2000-03-01 Thread Johan Kruger

If i try to load the example in
/usr/src/share/exaples/lkm/misc/module/misc_mod.o i get the following.
Pleeaaas help ?

borg# modload ./misc_mod.o 
ld: /kernel: malformed input file (not rel or archive)
modload: /usr/bin/ld: return code 1

-- 
Johan Kruger ( B.Ing Electronic Engineering )
Developement Engineer
Nanoteq PTA ( 012 6727000 )
e-mail : [EMAIL PROTECTED]
e-mail : [EMAIL PROTECTED]



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: d: /kernel: malformed input file (not rel or archive) ??

2000-03-01 Thread Maxim Sobolev

Johan Kruger wrote:

 If i try to load the example in
 /usr/src/share/exaples/lkm/misc/module/misc_mod.o i get the following.
 Pleeaaas help ?

 borg# modload ./misc_mod.o
 ld: /kernel: malformed input file (not rel or archive)
 modload: /usr/bin/ld: return code 1

What FreeBSD release you are using? If it is 2.2 than the -current is wrong
place to ask, but if it is 4.0 than you must note that the lkm subsustem has
been abolished long time ago in favor of the new kld system. See man kld and
/usr/share/examples/kld for details.

-Maxim




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



FreeBSD-boot

2000-03-01 Thread David van Deijk

Dear hackers,

I have encountered Problems using the FBSDBOOT.exe since version 
3.0 3.1 3.2 3.3 3.4. I have looked into the source and could not 
find ELF support but only aout. Are you able to tell me wheter this is
because of me or that i am right in this elf-aout thingy .
ThanX in advance.

Dag dag David.



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: d: /kernel: malformed input file (not rel or archive) ??

2000-03-01 Thread Kris Kennaway

On Wed, 1 Mar 2000, Johan Kruger wrote:

 If i try to load the example in
 /usr/src/share/exaples/lkm/misc/module/misc_mod.o i get the following.
 Pleeaaas help ?

LKMs are deprecated in favour of KLDs. Do you have options LKM in your
kernel if you really wnt to play with the old technology?

Kris


In God we Trust -- all others must submit an X.509 certificate.
-- Charles Forsythe [EMAIL PROTECTED]



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: FreeBSD-boot

2000-03-01 Thread Vladimir B. Grebenschikov

On Wed, 1 Mar 2000, David van Deijk wrote:

 I have encountered Problems using the FBSDBOOT.exe since version 
 3.0 3.1 3.2 3.3 3.4. I have looked into the source and could not 
 find ELF support but only aout. Are you able to tell me wheter this is
 because of me or that i am right in this elf-aout thingy .
 ThanX in advance.

try to load /boot/loader with FBSDBOOT.exe, and then boot
elf kernel from loader

I am don't tried to go this way, because of I have no DOS.
 
 Dag dag David.

--
TSB Russian Express, Moscow
Vladimir B. Grebenschikov, [EMAIL PROTECTED]



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: FreeBSD-boot

2000-03-01 Thread David van Deijk

  I have encountered Problems using the FBSDBOOT.exe since version 
  3.0 3.1 3.2 3.3 3.4. I have looked into the source and could not 
  find ELF support but only aout. Are you able to tell me wheter this is
  because of me or that i am right in this elf-aout thingy .
  ThanX in advance.
 
 try to load /boot/loader with FBSDBOOT.exe, and then boot
 elf kernel from loader
 
I did try this and he started running /boot/loader @ 0x010 and stopped doing 
anything to my great disappointment.

 I am don't tried to go this way, because of I have no DOS.
  
  Dag dag David.
 
 --
 TSB Russian Express, Moscow
 Vladimir B. Grebenschikov, [EMAIL PROTECTED]
 
 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: How to fdisk/disklabel whole disk for FreeBSD from command line?

2000-03-01 Thread Mike Smith

  What are you using for your command lines?  You have to target the
  disklabel specifically at slice 1 on the disk otherwise disklabel will
  think you're trying to overwrite the slice table and get mad.
 
 Here's what I did:
 
   fdisk -e /dev/rda1
   disklabel -r -w da1 auto
 
 The disklabel command gives 'disklabel: No space left on device'.

This is nonsensical; first you are trying to slice the disk, then you are 
trying to initialise it sliceless without first removing the slices.

If you want the disk sliced, use disklabel on rda1sX, where X is the 
slice you've created.  If you want it unsliced, dd 8k of zeroes over the 
beginning of da1 first.

-- 
\\ Give a man a fish, and you feed him for a day. \\  Mike Smith
\\ Tell him he should learn how to fish himself,  \\  [EMAIL PROTECTED]
\\ and he'll hate you for a lifetime. \\  [EMAIL PROTECTED]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Fix for quotas grace time when using chown and soft limits are hit again

2000-03-01 Thread Andre Albsmeier

Here is a problem with FreeBSD's quotas that I have observed
for a long time now but finally found some time to track it down:

Let's assume the following settings on a quota enabled system:

soft limits : 100MB
hard limits : 200MB
grace period: 7 days

On day 1, the user U1 creates 150MB of data. The soft
limits are reached but not the hard limits. The internal
grace timer is set accordingly (to current_time + 7 days).

On day 3, the user U1 removes 100MB. There are 50MB remaining
and the grace period is no more important. From now on, the
users U1's amount of data stays between 50 and 60 MB.

On day 10, user U2 leaves system forever. He got 100MB of
data and the admin decides that U1 has to take care of
them. So he moves U2's data to U1's directory and runs
a "chown -R U1" there. Now, U1 has around 150MB of data
belonging to him. The admin tells U1 that he is now over
the soft limit and has got 7 days time to inspect U2's data.

This is where the problem starts: When examining the quotas
for U1 we find that the grace period is already over and
the soft limits have turned into hard limits.
This only happens if U1 has been over the soft limit some time
before.

So far for the facts - now let's start the wild guess :-)

I assume the problem appears because the system still uses
the old grace timer (set to day 7) which is exceeded on day 10
when the files are given to U1. This was no problem before
(on days 8 and 9) because the grace time is only used if we
are over the soft limits.
When root does his chown, the grace timer for U1 is not set
to day 10 + 7 days.

I think the problem can be fixed _somehow_ with the following
patch to /sys/ufs/ufs/ufs_quota.c: (I have included some
comments manually _after_ creating the patch)

--- /sys/ufs/ufs/ufs_quota.cMon Aug 30 17:56:23 1999
+++ ufs_quota.c Wed Mar  1 21:27:14 2000
@@ -163,6 +163,10 @@
(void) tsleep((caddr_t)dq, PINOD+1, "chkdq2", 0);
}
dq-dq_curblocks += change;
/* check if we hit the soft limits */
+   if (dq-dq_curblocks = dq-dq_bsoftlimit  dq-dq_bsoftlimit)
/* check if we have been below the soft limits before */
+   if (dq-dq_curblocks - change  dq-dq_bsoftlimit)
/* yes, update the timer */
+   dq-dq_btime = time_second +
+   VFSTOUFS(ITOV(ip)-v_mount)-um_btime[i];
dq-dq_flags |= DQ_MOD;
}
return (0);
@@ -279,6 +283,10 @@
(void) tsleep((caddr_t)dq, PINOD+1, "chkiq2", 0);
}
dq-dq_curinodes += change;
/* same as above for inodes */
+   if (dq-dq_curinodes = dq-dq_isoftlimit  dq-dq_isoftlimit)
+   if (dq-dq_curinodes - change  dq-dq_isoftlimit)
+   dq-dq_itime = time_second +
+   VFSTOUFS(ITOV(ip)-v_mount)-um_itime[i];
dq-dq_flags |= DQ_MOD;
}
return (0);



As far as I understood things correctly, chkdq() is being called
from the chown code in the kernel. When the amount of blocks (inodes)
changes, there is no check being done if the soft limit is hit. In
chkdqchg() we find the interesting part which I tried to bring
into chkdq() with the above patch.

I have no idea about vfs, ufs and all these things so maybe one
of the more enlightened people (Matt, Alfred, ...) might be able
to correct me.

If the current behaviour is desired it would be nice if someone could
tell me if my patch goes in the right direction if I want to fix it
for me only.

Thanks,

-Andre


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



MAXUSERS question, what is max MAXUSERS setting?

2000-03-01 Thread Karsten W. Rohrbach

hiya folks

i just wondered what the maximum MAXUSERS setting for a 3.4 kernel would
be on a smp system with 512mb ram... the impact on the system structures
seems to be very... errrhh... rather complex.

any ideas? it gives me a warning if i got past 512, but what will happen
then?

/k

-- 
 Motto of the Electrical Engineer:
 Working computer hardware is a lot like an erect penis: it
 stays up as long as you don't fuck with it.
http://www.webmonster.de http://www.apache.de http://www.splatterworld.de
(NIC-HDL KR433/KR11-RIPE) 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



fdisk / disklabel issues...

2000-03-01 Thread Warren Welch

Hi all,

I've got a problem with a couple of machines...  The first time I saw the 
problem, I thought it was my hardware, but now I've encountered the problem 
on three different systems, all with different motherboards, and hard 
disks.  The only think in common, is that with all of them I'm working with 
FreeBSD 3.4, and that all the disks are LARGER than 12Gb IDE's.

One of the things that I notice are that the size of the disk that gets 
reported by the BIOS, and FreeBSD are totally different...  As an example, 
the following system reports:-

wdc0: unit 0 (wd0): ST313021A
wd0: 12419MB (25434228 sectors), 25232 cyls, 16 heads, 63 S/T, 512 B/S

from dmesg

yet, when I get the system BIOS to probe the disk, it reports:-
24062 cyls
16 heads
63 sects.

As you can see, FreeBSD recognizes the disk as larger than what it actually 
is.  I've found that if I partition the disk using the entire disk (fdisk 
-e wd0), then the last partition on the disk (the one that uses the last 
sectors on the disk) won't be newfs'd...

It's not at all good.  sysinstall also seems to have a problem with 
allowing you to set the geometry.  I'd expect that if I set the geometry to 
what the BIOS detects, and then say to use the entire disk, that it would 
use that defined geometry.  It doesn't...  The moment you say to use the 
entire disk, ('A', No), it resets the geometry to something it likes.  If I 
calculate the number of sectors manually (to what the bios detects), and 
then create a slice all things work fine within that slice.

I think there is something wrong with the way that FreeBSD is detecting the 
size of the disk.  (Interigating the disk that is...)  So far I've only had 
this problem with IDE disks.

Warren
[EMAIL PROTECTED]



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Disklabel from command line...

2000-03-01 Thread Warren Welch

Hi all,

Is it possible to create FreeBSD partitions from the command line?  I'd 
really like to be able to script creating a FreeBSD partitions, so that I 
could create /, /var, /usr, etc. without having to edit the disklabel manually.

Any scripts out there already?  Any ideas?

Thanks in advance,

Warren
[EMAIL PROTECTED]



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Great American Gas Out

2000-03-01 Thread The Raifords

Subject: Fw: Great American Gas Out

This message was received and forwarded - please forward it! 
Anytime we can stick it to them it's a good day. Last year on April 
30,1999, a gas out was staged across Canada and the U.S. to 
bring the price of gas down, and it worked. It's time to do 
something about it again.This time, lets make it
 for three days instead of just one. The oil cartel decided to slow 
production to drive up gasoline prices. Lets see how many 
Canadian\American people we can get to ban together for a three 
day period in April, NOT TO BUY ANY GASOLINE, during those 
three days. LETS HAVE A GAS OUT. Do not buy any 
gasoline from APRIL 7, 2000, THROUGH APRIL 9, 2000. Buy what 
you need before the dates listed above, or after, but try not to buy 
any during the GAS OUT. If you want to help, just sendthis to 
everyone you know and ask them to do the same.We brought the 
prices down once before, and we can do it ag
ain!





To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: How to fdisk/disklabel whole disk for FreeBSD from command line?

2000-03-01 Thread Greg Lehey

On Wednesday,  1 March 2000 at 11:11:35 -0800, Mike Smith wrote:
 What are you using for your command lines?  You have to target the
 disklabel specifically at slice 1 on the disk otherwise disklabel will
 think you're trying to overwrite the slice table and get mad.

 Here's what I did:

  fdisk -e /dev/rda1
  disklabel -r -w da1 auto

 The disklabel command gives 'disklabel: No space left on device'.

 This is nonsensical; first you are trying to slice the disk, then you are
 trying to initialise it sliceless without first removing the slices.

 If you want the disk sliced, use disklabel on rda1sX, where X is the
 slice you've created.  If you want it unsliced, dd 8k of zeroes over the
 beginning of da1 first.

You've got to admit that that's a workaround.  What we really need is
some kind of "please start again from scratch" option.

Greg
--
Finger [EMAIL PROTECTED] for PGP public key
See complete headers for address and phone numbers


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Building customized kernel without root passwd

2000-03-01 Thread Marty Leisner


Well, I never like to do anything as root which I don't need root
permissions to do.

If you have a "compiling" engine, and a "test" machine, this may be
reasonable.

Just let the compilers be able to write to the build directory (I think --
I haven't looked into this in a while (and generally use linux).





To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



DLink DGE-500SX

2000-03-01 Thread Mark Newton


We've been speaking with our local DLink salescritter about FreeBSD
support (we couldn't help it - he coldcalled us with a visit yesterday
and tried to demo a whole lot of gear which wouldn't work under FreeBSD :-)

We suggested to him that the best way to get us interested would be 
to contribute some hardware to the FreeBSD project so that some drivers
could be written.

He called us back today and said he was interested in getting a DGE-500SX
Gigabit ethernet card to someone like Bill Paul (Hi, Bill!) along with
programming docs, in the hope that there's interest in making it work.

So is there? :-)

- mark



Mark Newton   Email:  [EMAIL PROTECTED] (W)
Network Engineer  Email:  [EMAIL PROTECTED]  (H)
Internode Systems Pty Ltd Desk:   +61-8-82232999
"Network Man" - Anagram of "Mark Newton"  Mobile: +61-416-202-223


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



RE: FreeBSD-boot

2000-03-01 Thread John Baldwin


On 01-Mar-00 David van Deijk wrote:
 Dear hackers,
 
 I have encountered Problems using the FBSDBOOT.exe since version 
 3.0 3.1 3.2 3.3 3.4. I have looked into the source and could not 
 find ELF support but only aout. Are you able to tell me wheter this is
 because of me or that i am right in this elf-aout thingy .
 ThanX in advance.

fbsdboot.exe doesn't work anymore, and it never will.  DOS screws up too
many things while it is booting (interrupt vectors, etc.) for the loader
and/or kernel to even have a chance of booting.

 Dag dag David.

-- 

John Baldwin [EMAIL PROTECTED] -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: fdisk / disklabel issues...

2000-03-01 Thread Jason Seidel

 Hi all,
 
 I've got a problem with a couple of machines...  The first time I saw the 
 problem, I thought it was my hardware, but now I've encountered the problem 
 on three different systems, all with different motherboards, and hard 
 disks.  The only think in common, is that with all of them I'm working with 
 FreeBSD 3.4, and that all the disks are LARGER than 12Gb IDE's.

This is a commom problem.

 
 One of the things that I notice are that the size of the disk that gets 
 reported by the BIOS, and FreeBSD are totally different...  As an example, 
 the following system reports:-
 
 wdc0: unit 0 (wd0): ST313021A
 wd0: 12419MB (25434228 sectors), 25232 cyls, 16 heads, 63 S/T, 512 B/S
 
 from dmesg
 
 yet, when I get the system BIOS to probe the disk, it reports:-
 24062 cyls
 16 heads
 63 sects.
 
 As you can see, FreeBSD recognizes the disk as larger than what it actually 
 is.  I've found that if I partition the disk using the entire disk (fdisk 
 -e wd0), then the last partition on the disk (the one that uses the last 
 sectors on the disk) won't be newfs'd...
 
 It's not at all good.  sysinstall also seems to have a problem with 
 allowing you to set the geometry.  I'd expect that if I set the geometry to 
 what the BIOS detects, and then say to use the entire disk, that it would 
 use that defined geometry.  It doesn't...  The moment you say to use the 
 entire disk, ('A', No), it resets the geometry to something it likes.  If I 
 calculate the number of sectors manually (to what the bios detects), and 
 then create a slice all things work fine within that slice.

Yep.. Seen this happen

 
 I think there is something wrong with the way that FreeBSD is detecting the 
 size of the disk.  (Interigating the disk that is...)  So far I've only had 
 this problem with IDE disks.

I have had a machine that the bios picks up the drive as one thing, the
BSD probe picks it up as another, the sysinstall picks that as another.
But the one thing that was weird was that the geometry on the drive said
another size yet.  

What you want to do in the sysinstall is pick "A" like you did and choose
to use the entire disk like before. Then after that, you want to set the
geometry according to what it says on the hard drive. If you don't have
that, look it up on the web. This will keep your partition and the new
drive geometry.

Remember, FreeBSD doesn't care what the bios says  

 
 Warren
 [EMAIL PROTECTED]
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with "unsubscribe freebsd-hackers" in the body of the message
 

+++
Jason Seidel [Systems Administrator]  
RapidNet, INC.  USA"Oh, Bother," said Pooh as he 
[EMAIL PROTECTED]reached for the reset button. 
 
Web Support:http://www.rapidnet.com
Local Phone Support#:   (605) 341-3283 FAX #: (605) 348-1031
800 Phone Support#: 1-800-763-2525
+++



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message