Commit Graph

259 Commits

Author SHA1 Message Date
wiz 1a64f4201c Call the file system "ext2" consistently. Suggested by tsutsui. 2010-02-21 13:26:45 +00:00
wiz 8f657e21de Fix typo (specifed -> specified). 2010-02-18 14:00:39 +00:00
wiz 40effc38c9 Pull over some of Jason McIntyre's fixes for newfs_ext2fs.
Suggested by tsutsui.
2010-02-18 13:51:45 +00:00
mlelstv 0aef69272b Skip handling of APPLEUFS_LABEL if it is smaller than a device block.
In particular:

- newfs will not try to erase the label
- fsck_ffs will not try to validate the label

This lets newfs and fsck work on 2048-byte-per-sector media.

Does Apple UFS support such media and how?
2010-01-31 16:04:34 +00:00
dsl e9c65c5007 Push the mount path for mount_mfs through realpath().
This matches what other fs do.
Fixes PR/20362
2009-12-20 15:21:13 +00:00
pooka bc6c058985 Add note saying that special must be a raw device.
PR bin/42391
2009-12-01 10:56:33 +00:00
snj 550147bd6a Remove 3rd and 4th clauses in christos' license. OK christos. 2009-10-21 01:07:44 +00:00
uwe c03dac31b4 G/c sentence fragment left over from vinum reference (forgotten in 1.69).
Noticed by bad@ in PR bin/41652
2009-07-01 02:43:34 +00:00
haad e936991891 Remove debuging CFLAGS. 2009-06-06 11:09:16 +00:00
haad f5b48500f1 Add support for DIOCGDISKINFO to disk like device drivers. Change
partutil.c::getdiskinfo to use it to get disk geometry info.
Use DIOCGWEDGEINFO ioctl to get information about partition size, if disk
driver doesn't support it use old DIOCGDINFO. This patch adds support for
wedge like devices(lvm logical volumes, ZFS zvol partitions) to newfs and
other tools.

No objections on tech-userlevel@.
2009-06-05 21:52:31 +00:00
lukem 2a89584323 Note that FFSv1 is also known as FFS, UFS, or UFS1.
Note that FFSv2 is also known as UFS2.
Add a reference to Kirk's BSDcon03 paper on UFS2.
2009-05-10 13:28:00 +00:00
lukem 87a1d67eda Consistently use FFSv1 or FFSv2 2009-05-07 06:56:56 +00:00
lukem 6978bdec0e fix sign-compare issues 2009-04-11 07:20:09 +00:00
pooka 54f76d2fa4 Issue a better error message if attempting to create a file system
on a block device.  Inspired by PR kern/41127.
2009-04-03 13:22:05 +00:00
gmcgarry 3c9a95916d Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC. 2008-08-29 00:02:21 +00:00
simonb 8e5470fdb2 Handle 't' suffix for terabytes for number arguments. 2008-08-01 15:32:29 +00:00
lukem 6543a91fea Remove the \n and tabs from the __COPYRIGHT() strings.
(Tweak some to use a consistent format.)
2008-07-20 01:20:21 +00:00
reinoud cff0e3f587 Fix small documentation bug as reported in PR#38192 :
FFS  -> FFSv1
UFS2 -> FFSv2
2008-03-08 19:26:46 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
tsutsui f4f8fe5f57 Add Xref newfs_ext2fs(8). 2007-12-10 12:34:49 +00:00
jnemeth 1d506ab633 PR/37155 - Marcelo Schmidt -- specifying too large of a size causes segvs 2007-12-08 21:40:23 +00:00
jnemeth 415d88d5b8 PR/37503 - De Zeurkous -- inaccurate description of -s option 2007-12-08 20:52:19 +00:00
tsutsui 726acbb131 Use powerof2() macro in <sys/param.h> rather than a homegrown version. 2007-11-27 13:31:10 +00:00
pooka 704e075311 Make all mount(2) return value error checks against -1. Some file
systems just checked != 0, breaking MNT_GETARGS.  Others worked with < 0,
but make them check against -1 too for consistency.  And sprinkle some
stylish line wrapping where appropriate.
2007-07-16 17:06:52 +00:00
dsl 7af7206539 Add additional 'sizeof args' parameter to mount(2). 2007-07-14 15:57:24 +00:00
christos cedd1a800a PR/36229: Geoff Wing: uninitialized dkwedge_info structure in mount_mfs
causes random failures
2007-04-28 02:56:32 +00:00
christos f5b5006944 PR/28884: Izumi Tsutsui: mount_mfs(8) doesn't set default fssize if "swap" is
specified
2006-11-25 18:18:22 +00:00
christos 6dd4b3398f c99 initializers. 2006-10-16 03:04:45 +00:00
christos 41cacf46ed Make the "traditional" comment match reality. 2006-08-27 18:49:08 +00:00
christos a1ed611584 Don't hard-code 3. From our secret user. 2006-08-27 18:27:49 +00:00
christos 5a70d8a008 - Deal with wedges and the new disk geometry structures, instead of using
struct disklabel.

Functionality lost:
  1. struct disklabel used to be updated to contain bsize, fsize, cpg.
     This information was used to locate the alternative superblock in
     the filesystem if the primary superblock was corrupted. We need
     to find a new place to store this information if we need this
     functionality.
  2. On vax SMD drives that contained bad sector lists, the newfs program
     knew how to get the offset and skip to the correct location in order
     to place the label.
2006-08-26 22:03:47 +00:00
mrg aadd7d4847 sprinkle some -fno-strict-aliasing and -Wno-pointer-sign with GCC4. 2006-05-11 23:16:28 +00:00
christos 32c4e3d517 Since MNT_GETARGS is not allowed when any other flags are set, don't set
ASYNC in the getargs case.
2006-05-04 19:46:10 +00:00
christos 7067dcb9a4 Always check the results of getmntopts() and free them. 2006-03-21 21:11:41 +00:00
christos 4738a03371 remove vinum reference. 2006-02-25 01:56:41 +00:00
simonb e37b3f410c Use 64-bit arithmetic to calculate fragsperinodeblk, avoiding 32-bit
overflows for large values of "-i bytes-per-inode".
2006-01-21 12:32:14 +00:00
dsl 1e0f45064e Add '-V' to usage output.
Correct a couple of comments.
2006-01-16 21:34:41 +00:00
dsl afbe178ee2 Add a '-V verbose' option that controls the amount of info writen to stdout.
0: No output. Default for mount_mfs unless -N specified
 1: Output size of partition and cylinder groups.
 2: Follow with a progress-bar line of dots (scaled to finish at RH margin)
 3: Include a single line of alternate suberblock addresses before progress
    bar.  Default for newfs.
 4: Output lots of lines of alternate superblock numbers that scroll madly
    up the screen.
If -N given, newfs/mount_mfs exits before displaying any progress bar.
Output constrained (almost always) to 1 column less than the terminal width.
2006-01-15 19:49:25 +00:00
dsl 3fbee23326 Don't look for old superblocks if newfs -N 2006-01-11 22:33:03 +00:00
dsl 00ded1a669 The 'cylinder group' size calculation was incorrect. If the cylinder groups
were full then not enough bits were left for the inode allocation map.
Always put a multiple of 8 fragments (and non-zero) inodes into the eqns
so that answer is correct.
Fix the sum that may discard the last cylinder group if it isn't large enough
to contain all its inodes.
Spotted during some other tests, eg:
$ newfs -s 109610 -n1 -f512 -b4096 -N -O2 -F ./z
CGSIZE miscalculated 4097 > 4096
$
2006-01-11 22:03:51 +00:00
dsl 08d4007d3e Modify previous so that at most 79 (more likely 78) dots are printed, with
at most 1 dot per cylinder group.
This is much more useful for filesystems with very large numbers of cgs.
2006-01-11 12:17:42 +00:00
dsl c2452a4af0 There really isn't any point reporting all the alternate superblocks,
big filesystems can have thousands of them - no one ever writes them down.
After the first line of numbers just output a '.' for each cylinder group.
Also limit the lines to 79 columns so broken terminal emulaters don't
double-space the output lines.
2006-01-09 20:59:25 +00:00
hubertf 3e91637cdf The -b option is really on fsck_ffs, not fsck
Pointed out by Sebastian Schuetz on IRCnet #NetBSD
2006-01-05 11:22:47 +00:00
hubertf cfc5c5528b Xref newfs_msdos, noted by rabioli on Freenode #NetBSD 2005-12-27 14:49:28 +00:00
dsl 3a2bad7a99 Include the size we are trying to create in the 'partition to small'
error message.
2005-11-28 22:35:06 +00:00
chs 3ea0c57c60 don't set fs_maxsymlinklen and fs_old_inodefmt twice,
we set them correctly the first time.  fixes PR 26995.
2005-11-05 19:15:54 +00:00
jmmv 2a3e5eeb7c Apply the NFS exports list rototill patch:
- Remove all NFS related stuff from file system specific code.
- Drop the vfs_checkexp hook and generalize it in the new nfs_check_export
  function, thus removing redundancy from all file systems.
- Move all NFS export-related stuff from kern/vfs_subr.c to the new
  file sys/nfs/nfs_export.c.  The former was becoming large and its code
  is always compiled, regardless of the build options.  Using the latter,
  the code is only compiled in when NFSSERVER is enabled.  While doing this,
  also make some functions in nfs_subs.c conditional to NFSSERVER.
- Add a new command in nfssvc(2), called NFSSVC_SETEXPORTSLIST, that takes a
  path and a set of export entries.  At the moment it can only clear the
  exports list or append entries, one by one, but it is done in a way that
  allows setting the whole set of entries atomically in the future (see the
  comment in mountd_set_exports_list or in doc/TODO).
- Change mountd(8) to use the nfssvc(2) system call instead of mount(2) so
  that it becomes file system agnostic.  In fact, all this whole thing was
  done to remove a 'XXX' block from this utility!
- Change the mount*, newfs and fsck* userland utilities to not deal with NFS
  exports initialization; done internally by the kernel when initializing
  the NFS support for each file system.
- Implement an interface for VFS (called VFS hooks) so that several kernel
  subsystems can run arbitrary code upon receipt of specific VFS events.
  At the moment, this only provides support for unmount and is used to
  destroy NFS exports lists from the file systems being unmounted, though it
  has room for extension.

Thanks go to yamt@, chs@, thorpej@, wrstuden@ and others for their comments
and advice in the development of this patch.
2005-09-23 12:10:31 +00:00
tron 1dbccd015b Use FFS_MAXNAMLEN instead of MAXNAMLEN. 2005-08-23 11:10:23 +00:00
christos c4ee9f6d2e 64 bit inode changes 2005-08-19 02:07:18 +00:00
jmmv 68e38c123b Replace a dot with a colon, as a list of items follows it. 2005-08-05 13:32:06 +00:00