summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
Commit message (Collapse)AuthorAgeFilesLines
* Report erase interval (correctly) in sectors.phk2007-12-161-2/+2
|
* Rename the undocumented -E option to -X.phk2007-12-164-15/+32
| | | | | | | | | | Implement -E option which will erase the filesystem sectors before making the new filesystem. Reserved space in front of the superblock (bootcode) is not erased. NB: Erasing can take as long time as writing every sector sequentially. This is relevant for all flash based disks which use wearlevelling.
* - Pay attention to the fact that ioctl(2) is only known toyar2007-11-281-4/+5
| | | | | | | | | return -1 on error while any other return value from it can indicate success. (See RETURN VALUE in our ioctl(2) manpage and the POSIX spec.) - Avoid assumptions about the state of the data buffer after ioctl(2) failure.
* MFp4:yar2007-11-283-22/+59
| | | | | | | | | | | | | | | | | | | | | | Add a new option to newfs(8), -r, to specify reserved space at the end of the device. It can be useful, e.g., when the device is to become a member of a gmirror array later w/o losing the file system on it. Document the new option in the manpage. While I'm here, improve error handling for -s option, which is syntactically similar to -r; and document the fact that -s0 selects the default fs size explicitly, which can be useful, e.g., in a menu-based wrapper around newfs(8) requiring some value be entered for the fs size. Also fix a small typo in the help line for -s (missing space). Idea and initial implementation by: marck Discussed on: -fs Critical review by: bde Tested with: cmp(1)
* Document -J in usage.pjd2007-03-021-0/+1
| | | | Submitted by: Eric Anderson <anderson@freebsd.org>
* Add -J flag to both newfs(8) and tunefs(8) which allows to enable gjournalpjd2006-10-314-2/+11
| | | | | | | | support. I left -j flag for UFS journal implementation which we may gain at some point. Sponsored by: home.pl
* Explicitly say which gid do we use as a fallback, when operatordelphij2006-09-271-1/+1
| | | | | | is not found. Suggested by: kensmith
* Don't treat failure to find the operator GID as a fatal error; thisiedowse2005-08-141-4/+9
| | | | | made it impossible to use newfs (and mdmfs) when /etc/group is missing and /etc is read-only.
* When creating a new FFS file system, the block size will indirectlydelphij2005-02-201-0/+10
| | | | | | | | | | | | | affect the largest file size that is allowed by the file system. On the other hand, when creating a snapshot, the snapshot file will appear as it is as big as the file system itself. Hence we will not be able to create a file system on large file systems with small block sizes. Add a warning about this, and gives some hints to correct the issue. Reviewed by: mckusick MFC After: 1 week
* Document -l and -n options in usage().ru2005-01-221-0/+2
|
* Polish previous revision:ru2005-01-221-6/+12
| | | | | | - Bump document date. - Spell "file system" properly. - Add missing markup bits.
* Add an option to suppress the creation of the .snap directory inwes2005-01-214-32/+60
| | | | | | | | the new filesystem. This is intended for memory and vnode filesystems that will never be fsck'ed or dumped. Obtained from: St. Bernard Software RAPID MFC after: 2 weeks
* Cast to intmax_t when using %jd format.pjd2005-01-081-1/+1
| | | | MFC after: 3 days
* Fix '-s' option for large disks and fix printing maximum file system size.pjd2004-09-191-4/+7
|
* Generalize the UFS bad magic value used to determine when a filesystemjhb2004-08-191-4/+9
| | | | | | | | has only been partly initialized via newfs(8) so that it applies to both UFS1 and UFS2. Submitted by: "Xin LI" delphij at frontfree dot net MFC: maybe?
* Assorted markup, grammar, and spelling fixes.ru2004-05-171-3/+3
|
* Remove advertising clause from University of California Regent's license,markm2004-04-094-16/+0
| | | | | | per letter dated July 22, 1999. Approved by: core, imp
* Add a "-l" flag to newfs, which sets the FS_MULTILABEL flag. Thisrwatson2004-02-264-2/+11
| | | | | | | | permits users of newfs to set the multilabel flag on UFS1 and UFS2 file systems from inception without using tunefs. Obtained from: TrustedBSD Project Sponsored by: DARPA, McAfee Research
* Fix whitespace error in previous commit.wes2003-11-271-1/+1
| | | | Approved by: RE@ (Robert Watson)
* Don't use UFS2_BAD_MAGIC on UFS (v1) filesystems; it is Not Readywes2003-11-231-1/+1
| | | | | | | for Prime Time there. Submitted by: Xin LI <delphij@frontfree.net> Approved by: RE@ (John, Scott)
* Add the -E command line option to force error conditions for testing.wes2003-11-163-2/+18
| | | | Sponsord by: St. Bernard Software
* Write the UFS2 superblock with a 'BAD' magic number at the beginningwes2003-11-161-1/+4
| | | | | | | | of newfs, to signify the newfs operation has not yet completed. Re- write the superblock with the correct magic number once all of the cylinder groups have been created to show the operation has finished. Sponsored by: St. Bernard Software
* Create a .snap directory mode 770 group operator in the root ofmckusick2003-11-041-6/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | a new filesystem. Dump and fsck will create snapshots in this directory rather than in the root for two reasons: 1) For terabyte-sized filesystems, the snapshot may require many minutes to build. Although the filesystem will not be suspended during most of the snapshot build, the snapshot file itself is locked during the entire snapshot build period. Thus, if it is accessed during the period that it is being built, the process trying to access it will block holding its containing directory locked. If the snapshot is in the root, the root will lock and the system will come to a halt until the snapshot finishes. By putting the snapshot in a subdirectory, it is out of the likely path of any process traversing through the root and hence much less likely to cause a lock race to the root. 2) The dump program is usually run by a non-root user running with operator group privilege. Such a user is typically not permitted to create files in the root of a filesystem. By having a directory in group operator with group write access available, such a user will be able to create a snapshot there. Having the dump program create its snapshot in a subdirectory below the root will benefit from point (1) as well. Sponsored by: DARPA & NAI Labs.
* s/disklabel/bsdlabel where needed.blackend2003-10-111-2/+2
|
* Remove an unneccessary comma.ceri2003-09-141-1/+1
|
* mdoc(7): Use the new feature of the .In macro.ru2003-09-081-1/+1
|
* Exit with a non-zero status upon a block allocation failure.yar2003-08-051-3/+3
| | | | | | | | | | The old way of just returning could result in a file system extremely likely to panic the kernel. The warning printed wouldn't help much since tools invoking newfs(8), e.g., mdmfs(8), couldn't detect the error. PR: bin/55078 MFC after: 1 week
* When newfs'ing a partition with UFS2 that had previously been newfs'eddougb2003-05-221-0/+24
| | | | | | | | | | | | | | | | | with UFS1, the UFS1 superblocks were not deleted. This allowed any RELENG_4 (or other non-UFS2-aware) fsck to think it knew how to "fix" the file system, resulting in severe data scrambling. This patch is a more advanced version than the one originally submitted. Lukas improved it based on feedback from Kirk, and testing by me. It blanks all UFS1 superblocks (if any) during a UFS2 newfs, thereby causing fsck's that are not UFS2 aware to generate the "SEARCH FOR ALTERNATE SUPER-BLOCK FAILED" message, and exit without damaging the fs. PR: bin/51619 Submitted by: Lukas Ertl <l.ertl@univie.ac.at> Reviewed by: kirk Approved by: re (scottl)
* Put back the error checking in wtfs() that was lost when newfs wasiedowse2003-05-101-1/+2
| | | | | | | | | | | | | | changed to use libufs in revision 1.71. Without this, any write failures in newfs were silently ignored. Note that this will display a meaningless errno string in the case of a short write as opposed to a write error, since bwrite()'s return value does not allow the caller to determine if errno is valid. Reported by: Lukas Ertl <l.ertl@univie.ac.at> Reviewed by: jmallett Approved by: re (bmah)
* Use __FBSDID() to quiet GCC 3.3 warnings.obrien2003-05-032-8/+8
|
* Remove reference to diskpart(8)brueffer2003-04-201-1/+0
| | | | | PR: 51193 Submitted by: Yonatan@xpert.com
* Throw the switch--change to UFS2 as our default file system format forrwatson2003-04-202-2/+2
| | | | | | | | | | | | | | | | | | | | FreeBSD 5.1-RELEASE and later: - newfs(8) will now create UFS2 file systems unless UFS1 is specifically requested (-O1). To do this, I just twiddled the Oflag default. - sysinstall(8) will now select UFS2 as the default layout for new file systems unless specifically requested (use '1' and '2' to change the file system layout in the disk labeler). To do this, I inverted the ufs2 flag into a ufs1 flag, since ufs2 is now the default and ufs1 is the edge case. There's a slight semantic change in the key behavior: '2' no longer toggles, it changes the selection to UFS2. This is very similar to a patch David O'Brien sent me at one point, and that I couldn't find. Approved by: re (telecon) Reviewed by: mckusick, phk, bmah
* mdoc(7) police: markup laundry.ru2003-02-231-3/+3
|
* Fix the -R flag so that it provides sequential "random" numbersmckusick2003-02-222-15/+27
| | | | | | so that the regression test will succeed. Sponsored by: DARPA & NAI Labs.
* Our first keyword hit for apropos ufs2.jwd2003-02-191-1/+1
|
* Replace use of random() with arc4random() to provide less guessablemckusick2003-02-141-5/+5
| | | | | | | | values for the initial inode generation numbers in newfs and for newly allocated inode generation numbers in the kernel. Submitted by: Theo de Raadt <deraadt@cvs.openbsd.org> Sponsored by: DARPA & NAI Labs.
* Correct lines incorrectly added to the copyright message. Add missing period.mckusick2003-02-143-12/+3
| | | | | Submitted by: Bruce Evans <bde@zeta.org.au> Sponsored by: DARPA & NAI Labs.
* Convert newfs to libufs (really). Solves one real issue with previousjmallett2003-02-115-116/+43
| | | | | | | version of such. Differences in filesystems generated were found to be from 1) sbwrite with the "all" parameter 2) removal of writecache. The sbwrite call was made to perform as the original version, and otherwise this was checked against a version of newfs with the write cache removed.
* Bring in support for volume labels to the filesystem utilities.gordon2003-02-014-2/+25
| | | | Reviewed by: mckusick
* Back out conversion to libufs, for now. It seems to cause problems.jmallett2003-01-294-42/+111
| | | | Reported by: phk
* Convert newfs to use libufs. I've tested this on md filesystems, as hasjmallett2003-01-274-111/+42
| | | | keramida, and all seems well.
* Correctly calculate the initial number of fragments in a filesystemmckusick2002-12-021-2/+2
| | | | | | | | so that fsck does not complain with `SUMMARY BLK COUNT(S) WRONG IN SUPERBLK' the first time it is run on a new filesystem. Reported by: Poul-Henning Kamp <phk@freebsd.org> Sponsored by: DARPA & NAI Labs.
* Add some more checks to newfs so that it will not build filesystemsmckusick2002-11-302-15/+29
| | | | | | | | | | that the kernel will refuse to mount. Specifically it now enforces the MAXBSIZE blocksize limit. This update also fixes a problem where newfs could segment fault if the selected fragment size was too large. PR: bin/30959 Submitted by: Ceri Davies <setantae@submonkey.net> Sponsored by: DARPA & NAI Labs.
* Create a new 32-bit fs_flags word in the superblock. Add code to movemckusick2002-11-271-6/+6
| | | | | | | | | | | | | | | | | the old 8-bit fs_old_flags to the new location the first time that the filesystem is mounted by a new kernel. One of the unused flags in fs_old_flags is used to indicate that the flags have been moved. Leave the fs_old_flags word intact so that it will work properly if used on an old kernel. Change the fs_sblockloc superblock location field to be in units of bytes instead of in units of filesystem fragments. The old units did not work properly when the fragment size exceeeded the superblock size (8192). Update old fs_sblockloc values at the same time that the flags are moved. Suggested by: BOUWSMA Barry <freebsd-misuser@netscum.dyndns.dk> Sponsored by: DARPA & NAI Labs.
* Properly calculate the initial number of fragments in a large filesystem.mckusick2002-11-151-1/+2
| | | | Sponsored by: DARPA & NAI Labs.
* Bound the size of the superblock to SBLOCKSIZE.mckusick2002-10-181-0/+2
| | | | | Submitted by: BOUWSMA Beery <freebsd-misuser@netscum.dyndns.dk> Sponsored by: DARPA & NAI Labs.
* Remove a comma trailing an if clause.phk2002-10-011-1/+1
| | | | | | According to Kirk: "Luckily, the statement is usually true". Spotted by: FlexeLint
* Use the standardized CHAR_BIT constant instead of NBBY in userland.mike2002-09-251-5/+6
|
* Failure to rewrite the disklabel should not be fatal.phk2002-09-221-4/+2
| | | | Sponsored by: DARPA & NAI Labs.
* Fix some 'SYNOPSIS' and 'usage' messages.trhodes2002-08-271-2/+2
|
OpenPOWER on IntegriCloud