summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* s/filesystem/file system/g as discussed on -developerstrhodes2002-08-214-51/+51
|
* mdoc(7) police: Consistently name options' arguments in the SYNOPSIS and ↵ru2002-08-131-16/+23
| | | | DESCRIPTION sections..
* di_createtime -> di_birthtime.roberto2002-07-171-1/+1
| | | | Submitted by: Udo Schweigert <Udo.Schweigert@siemens.com>
* Fixed 4 printf format errors that were fatal on alphas. %qd is not evenbde2002-07-111-7/+9
| | | | | suitable for printing quad_t's since it is equivalent to %lld but quad_t is unsigned long on alphas. quad_t shouldn't be used anyway.
* The .Nm utilitycharnier2002-07-061-6/+9
|
* Get rid of paranoia that zeros the boot block area as this hasmckusick2002-06-221-7/+0
| | | | | | | bad effect on existing bootstraps. Submitted by: Jake Burkholder <jake@locore.ca> Sponsored by: DARPA & NAI Labs.
* This commit adds basic support for the UFS2 filesystem. The UFS2mckusick2002-06-214-510/+449
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | filesystem expands the inode to 256 bytes to make space for 64-bit block pointers. It also adds a file-creation time field, an ability to use jumbo blocks per inode to allow extent like pointer density, and space for extended attributes (up to twice the filesystem block size worth of attributes, e.g., on a 16K filesystem, there is space for 32K of attributes). UFS2 fully supports and runs existing UFS1 filesystems. New filesystems built using newfs can be built in either UFS1 or UFS2 format using the -O option. In this commit UFS1 is the default format, so if you want to build UFS2 format filesystems, you must specify -O 2. This default will be changed to UFS2 when UFS2 proves itself to be stable. In this commit the boot code for reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c) as there is insufficient space in the boot block. Once the size of the boot block is increased, this code can be defined. Things to note: the definition of SBSIZE has changed to SBLOCKSIZE. The header file <ufs/ufs/dinode.h> must be included before <ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and ufs_lbn_t. Still TODO: Verify that the first level bootstraps work for all the architectures. Convert the utility ffsinfo to understand UFS2 and test growfs. Add support for the extended attribute storage. Update soft updates to ensure integrity of extended attribute storage. Switch the current extended attribute interfaces to use the extended attribute storage. Add the extent like functionality (framework is there, but is currently never used). Sponsored by: DARPA & NAI Labs. Reviewed by: Poul-Henning Kamp <phk@freebsd.org>
* more file system > filesystemtrhodes2002-05-164-39/+39
|
* Remove the -v option, it is now default behaviour.phk2002-04-242-17/+5
| | | | Sponsored by: DARPA & NAI Labs
* Continue the cleanup preparations for UFS2 (& GEOM):phk2002-04-243-168/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use only one filedescriptor. Open in R/O or R/W based in the '-N' option. Make the filedescriptor a global variable instead of passing it around as semi-global variable(s). Remove the undocumented ability to specify type without '-T' option. Replace fatal() with straight err(3)/errx(3). Save calls to strerror() where applicable. Loose the progname variable. Get the sense of the cpgflag test correct so we only issue warnings if people specify cpg and can't get that. It can be argued that this should be an error. Remove the check to see if the disk is mounted: Open for writing would fail if it were mounted. Attempt to get the sectorsize and mediasize with the generic disk ioctls, fall back to disklabel and /etc/disktab as we can. Notice that on-disk labels still take precedence over /etc/disktab, this is probably wrong, but not as wrong as the entire concept of /etc/disktab is. Sponsored by: DARPA & NAI Labs.
* bbsize and sbsize cannot ever be trusted from the disklabel, inphk2002-04-073-53/+4
| | | | | | | | | particular as there may not be one. Remove #if 0'ed code which might mislead people to think otherwise. unifdef -ULOSTDIR, fsck can make lost+found on the fly. Sponsored by: DARPA & NAI Labs
* Fixed some style bugs in axings. Whitespace before __P was not axed whenbde2002-04-041-6/+6
| | | | | __P was axed. The ordering of several things was bogotified by axing ifdefs.
* Fixed some English errors in previous commit.bde2002-04-041-14/+15
| | | | | Fixed some style bugs in the removal of __P(()). Whitespace before "__P((" was not removed.
* Add more DWIM/autoadjustment and less evil style(9) banned exit(2) codes.phk2002-04-031-15/+17
| | | | | | Add some missing statics. Sponsored by: DARPA & NAI Labs.
* Unifdef -DCOMPATphk2002-04-031-22/+0
|
* Swing the axe and remove some archaic features from newfs which modernphk2002-03-204-339/+52
| | | | | | | | | | | | | | | | | | | diskdrives do neither need nor want: -O create a 4.3BSD format filesystem -d rotational delay between contiguous blocks -k sector 0 skew, per track -l hardware sector interleave -n number of distinguished rotational positions -p spare sectors per track -r revolutions/minute -t tracks/cylinder -x spare sectors per cylinder No change in the produced filesystem image unless one or more of these options were used. Approved by: mckusick
* Add the undocumented -R option to disable randomness for regression-testing.phk2002-03-197-3/+71
| | | | | | | | Add a couple of simple regression tests accessible with "make test", they depend on the md(4) driver. FYI I have also tried running the test against a week old newfs and it passed.
* Further cleanups.phk2002-03-193-58/+96
|
OpenPOWER on IntegriCloud