Commit Graph

50 Commits

Author SHA1 Message Date
Bruce Evans
519e76df7c Backed out rev.1.9 (except don't bring back the vax code deleted
in rev.1.9).  fsck uses the per-partition ffs-related information
in the label to find alternate superblocks when the main superblock
is hosed.  Rev.1.9 broke this by deleting the code that wrote the
label.

PR:		2537
xref:		fsck/setup.c rev.1.8
1998-07-20 12:04:42 +00:00
Philippe Charnier
16e80a4182 Make it compile again in the !__STDC__ case.
Found by: Bruce.
1998-07-16 12:04:52 +00:00
Philippe Charnier
27750b35a5 Add prototypes. Check malloc() return value. Use err(). Remove unused #includes
Do not \n nor dot terminate syslog()/err() messages. -Wall.
1998-07-15 06:28:05 +00:00
Bruce Evans
ca46ad5f48 Fixed printf format errors. 1998-06-28 20:11:23 +00:00
Bruce Evans
5a3e77d851 Fixed overflow in the calculation of the number of inodes per group
for filesystems with almost the maximum number of sectors.  The maxiumum
is 2^31, but overflow is common for that size, and overflow normally
occurred here at size (2^31 - 4096).
1998-05-31 12:21:50 +00:00
Poul-Henning Kamp
e72f5a72fd Add warning about root-fs blocksize expectations.
PR:		4485
Reviewed by:	phk
Submitted by:	Kees Jan Koster <kjk1@ukc.ac.uk>
1998-04-26 17:44:23 +00:00
Bruce Evans
87f01287d2 Removed definition of _NEW_VFSCONF. The new vfsconf interface is now
the default.
1998-01-20 10:40:18 +00:00
Bruce Evans
90e05a748a Don't create superblocks with size larger than SBSIZE (8192). The
size was rounded up to a multiple of the fragment size, but this
gave invalid file systems when the fragment size was > SBSIZE (fsck
aborts early on them).  Now a fragment size of 32768 seems to work
(too-simple tests with fsck and iozone worked).
1998-01-19 16:55:26 +00:00
Bruce Evans
6e1a705dd4 Fixed some spelling errors. 1998-01-16 06:31:23 +00:00
David E. O'Brien
e83b2033a7 Fix syntax error for the mount_mfs example.
Also update to a more realistic example.
1997-11-24 03:28:54 +00:00
Peter Wemm
079709dc3a Some tweaks to get this to cope with ELF where the address space starts
higher up in memory (0x0800000 upwards) rather than near zero (0x1000
for our qmagic a.out format).  The method that mount_mfs uses to allocate
the memory within data size rlimits for the ram disk is entirely too much
of a kludge for my liking.  I mean, if it's run as root, surely it makes
sense to just raise the resource limits to infinity or something, and if
it's a non-root user mount (do these work? with mfs?) it could just fail
if it's outside limits.
1997-09-13 11:41:50 +00:00
Bruce Evans
28596d2346 Removed "hack to prevent overflow of a 32bit block number". Lite2 has a
better hack in ffs_vfsops.c.  The hack here restricted the maximum file
size to 2^39 bytes (512GB).  fs_bsize * 2^31 - 1 (16TB for the default
blocksize of 8K) would have been better.  There is no good way to remove
this limit on old BSD4.4 file systems.
1997-07-13 15:13:07 +00:00
Tor Egge
dc6f8d1bd5 Allow use of the name "swap" instead of an actual swap device.
This makes configuration of mfs /tmp on diskless clients more intuitive
for people like me, that have used this feature on NetBSD and SunOS.
Using the -T option and /dev/null, while already supported,
is neither intuitive nor documented in the handbook.
Obtained from: NetBSD
1997-06-23 22:44:51 +00:00
Andrey A. Chernov
545cda7db5 Remove srandomdev fallback 1997-06-14 00:17:53 +00:00
Eivind Eklund
b5aa560439 Fix typo.
PR:		Closes PR docs/3488
Submitted by:	k-horik@yk.rim.or.jp
1997-05-04 20:04:59 +00:00
Peter Wemm
4af9705ceb Fix the mount_mfs case from the last cleanup. The code was (ab)using
it's internal malloc() implementation to try and avoid overstepping it's
resource limits (yuk!).  Remain using libc's malloc(), but check the
resource limits right before trying to malloc the ramdisk space and leave
some spare memory for libc.  In Andrey's words, the internal malloc
was "true evil"..  Among it's sins is it's ability to allocate less memory
than asked for and still return success.  stdio would just love that. :-)

Reviewed by: ache
1997-03-31 16:43:16 +00:00
Warner Losh
8d64695c7c compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 03:33:12 +00:00
Andrey A. Chernov
cb78754c12 Cleanup STANDALONE stuff
Not replace malloc() family for non-standalone variant
Pay attention on malloc() family return code now
Use srandomdev() now for RNG initialization
1997-03-24 15:43:36 +00:00
Guido van Rooij
8f89943eda Add generation number randomization. Newly created filesystems wil now
automatically have random generation numbers. The kenel way of handling those
also changed. Further it is advised to run fsirand on all your nfs exported
filesystems. the code is mostly copied from OpenBSD, with the randomization
chanegd to use /dev/urandom
Reviewed by:	Garrett
Obtained from: OpenBSD
1997-03-23 20:08:22 +00:00
Peter Wemm
75e2941193 Merge from Lite2:
- use new getvfsbyname() and mount(2) interface (mount_mfs)
 - use new fs include files
 - updated inode / cg layout calculations (?)
1997-03-11 12:48:17 +00:00
Mike Pritchard
21c7bd7842 Replace "mfs" with "mount_mfs" in the NAME section. 1997-02-06 17:49:55 +00:00
Alexander Langer
8abdc2eb40 Sweep through the tree fixing mmap() usage:
- Use MAP_FAILED instead of the constant -1 to indicate
    failure (required by POSIX).
  - Removed flag arguments of '0' (required by POSIX).
  - Fixed code which expected an error return of 0.
  - Fixed code which thought any address with the high bit set
    was an error.
  - Check for failure where no checks were present.

Discussed with:	bde
1997-01-16 21:58:40 +00:00
Wolfram Schneider
13bbf3d16f Add example for mount_mfs(8). 1996-12-26 02:01:09 +00:00
Mike Pritchard
215afc25bb Update the newfs(8) man page to reflect current
default values for some options better.  Closes PR# 1374.
1996-12-14 20:54:05 +00:00
Søren Schmidt
7cb29d3394 This update adds the support for != 512 byte sector SCSI devices to
the sd & od drivers. There is also slight changes to fdisk & newfs
in order to comply with different sectorsizes.
Currently sectors of size 512, 1024 & 2048 are supported, the only
restriction beeing in fdisk, which hunts for the sectorsize of
the device.
This is based on patches to od.c and the other system files by
John Gumb & Barry Scott, minor changes and the sd.c patches by
me.
There also exist some patches for the msdos filesys code, but I
havn't been able to test those (yet).

	John Gumb (john@talisker.demon.co.uk)
	Barry Scott (barry@scottb.demon.co.uk)
1996-12-01 11:25:38 +00:00
Nate Williams
2936258f1d ts_sec -> tv_sec
ts_nsec -> tv_nsec
1996-09-20 04:24:31 +00:00
Wolfram Schneider
7a5ab50d3f man page link tmpfs.8 -> mfs.8 for former SunOS users 1996-02-02 06:31:57 +00:00
Joerg Wunsch
768efa9d3c A better algorithm to place the numbers on the lines.
Submitted by:	satoshi
1996-01-30 23:14:34 +00:00
Mike Pritchard
e71057d8d0 Fix a bunch of spelling errors. 1996-01-29 23:52:43 +00:00
Joerg Wunsch
7f3b8ca95f Make the numbers for the "superblock backups" fit nicely on the screen,
even for larger partitions.  Until now, partition sizes > 500 MB messed
up the screen.
1996-01-25 23:44:32 +00:00
Mike Pritchard
e361857343 Change the reference to format(8) (which we don't have) to fdformat(1) and
scsiformat(8) (which we do have).  Closes PR# 663.
1996-01-22 12:55:16 +00:00
Peter Wemm
10dcae5806 Add hooks into the mount_mfs code in newfs to do the FreeBSD-style
LKM loading if it was not configured into the system.

Note that the LKM for MFS is not enabled by default, but I got it working on
my machine..  I'll see what I did..
1996-01-01 08:37:28 +00:00
David Greenman
70dded0aec Shorten a variable name. 1995-09-17 09:54:05 +00:00
Joerg Wunsch
ccf9a17c14 Avoid the "calculated sectors per cylinder disagrees with disklabel"
warning for the default case where the user hasn't specified either -t
or -u on the command line.  It's been confusing our users.
1995-09-09 13:03:09 +00:00
David Greenman
76b19b6b87 Fixed error in maxcontig calculation that caused it to default to "1". 1995-09-08 13:52:55 +00:00
Rodney W. Grimes
5ebc7e6281 Remove trailing whitespace. 1995-05-30 06:12:45 +00:00
David Greenman
c9c23c03fa Flush stdout when writing out each superblock backup. 1995-05-02 07:45:39 +00:00
Poul-Henning Kamp
e7bf085313 Yank out the rewriting of disklabels. This code can and will get confused
in a couple of cases, and it doesn't do much anyway.  It used to save only
the newfs params (block/frag/cgroup.. and nothing more.  Something that
don't belong in a disklabel in the first place.
1995-04-19 02:19:20 +00:00
Poul-Henning Kamp
4e93a5203c Allow zero as value for certain arguments to indicate "take from disklabel". 1995-02-05 18:03:37 +00:00
Poul-Henning Kamp
55abc5794a Change the defaults for newfs to disregard the geometry in the disklabel.
We pretend we have one head with two megabyte worth of sectors per cylinder.

The code try to access another head in what it belives to the same
physical cylinder, because it belives that it would be faster than
waiting for the next free sector under this head to come around.

Most modern drives doesn't have a "classical" geometry, and thus
we end up fooling ourselves doing the above optimization.  With this
change we will fill a cylinder sequentially if we can, and thus get
much more mileage from the track-buffer/cache built into the drives.

As a result a lot of seeks to the next or previous track should be
avoided by this.

(My disk is a lot less noisy actually...)

You can still get the old behaviour, by specifying zero for the
numbers.

This will also solve the problem with newfs barfing at really big
drives.

Obtained from:	adult advice from Kirk.
1995-02-05 08:42:31 +00:00
Garrett Wollman
3fa88dec7f Add support for filesystem-specific `-o' options, and re-implement the
most common cd9660 and nfs options like God intended them.  (It is now
possible to say

	mount -o ro,soft,bg,intr there:/foo/bar /foo/bar

again.)  This whole getmntopt() business is an incredible botch;
it never should have been anything more than a wrapper around
getsubopt(3).  Because if the way the current hackaround is implemented,
options which take arguments (like the old `rsize' and `wsize') are still
unavailable, and must be accessed the new, broken way.

(It's unimaginable how Berkeley managed to screw up one of the few things
about NFS that Sun actually got right to begin with!)
1994-11-01 23:51:53 +00:00
David Greenman
a3189e21e6 Restrict fs_maxfilesize to 2^40; this is part of a bug fix from Kirk
McKusick to work around problems in FFS related to the blkno of a 64bit
offset not fitting into an int.

Submitted by:	Marshall Kirk McKusick
1994-10-22 02:21:53 +00:00
Jordan K. Hubbard
3270fb5ece Put back the `:' in the trinary ?: so this can actually compile again! :) 1994-10-13 08:46:44 +00:00
Poul-Henning Kamp
72ab19aeb7 Added '-F file' option of mount_mfs. This allows me to make floppy images
without waiting for my floppy-drive all the time :-)  Might have other
interesting uses too.
1994-10-12 22:04:36 +00:00
David Greenman
3156bbb2d1 Backed out part of the last change that prevents the rpos table from
being output if <= 1 rpos; there is a bug in the kernel which doesn't
quite get along with this. Changed default #rpos to 1, and fixed up
manual page. Converted nrpos to 1 if user specifies 0.
1994-10-09 20:10:56 +00:00
David Greenman
56499741c4 Fixed manpage to conform to current reality.
Submitted by:	Rod Grimes, with additional sentence by me.
1994-10-01 20:00:28 +00:00
David Greenman
7ce005d7c1 1) If nrpos <= 1, don't output rpos table (and set fs_cpc to 0) - disabling
the use of the rotational position table.
2) Allow specification of 0 rotational positions (disables function).
3) Make rotdelay=0 and nrpos=0 by default.

   The purpose of the above is to optimize for modern SCSI (and IDE) drives
that do read-ahead/write-behind.
1994-10-01 16:56:22 +00:00
David Greenman
cf8181ddff Set fs_clean. 1994-08-26 10:41:13 +00:00
Garrett Wollman
404c1a5fc1 Convert to our man installation style. Also fixed long-standing bug
in `fastboot'/`fasthalt' in which the interpreter would hang around
after `reboot' or `halt' is run, causing an irritating ``Killed'' message.
1994-08-05 02:42:42 +00:00
Rodney W. Grimes
8fae3551ec BSD 4.4 Lite sbin Sources
Note:  XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.
1994-05-26 06:35:07 +00:00