summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
Commit message (Collapse)AuthorAgeFilesLines
* Fix "Empty input line" mdoc warning.sobomax2010-03-101-2/+2
| | | | Submitted by: Alexander Best
* o bdeficize expand_number_int() function;sobomax2010-03-093-38/+36
| | | | | o revert most of the recent changes (int -> int64_t conversion) by using this functon for parsing all options.
* Change secrorsize back to int, since that's the data type expected by thesobomax2010-03-092-3/+21
| | | | | | | ioctl(DIOCGSECTORSIZE). It creates issues on some architectures. MFC after: 1 week Reported by: Jayachandran C.
* Cast these to intmax_t before printing to fix build bustage. Betterimp2010-03-031-7/+9
| | | | solutions welcome.
* Use expand_number(3) from libutil instead of home-grown function to parsesobomax2010-03-033-92/+34
| | | | | | | human-friendly power-of-two numbers (i.e. 2k, 5M etc). Suggested by: many MFC after: 1 week
* Teach newfs(8) to understand size modifiers for all options takingsobomax2010-03-031-11/+84
| | | | | | | | | size or size-like argument. I.e. "-s 32k" instead of "-s 32768". Size parsing function has been shamelessly stolen from the truncate(1). I'm sure many sysadmins out there will appreciate this small improvement. MFC after: 1 week
* One last pass to get all the unsigned comparisons correct.mckusick2010-02-111-10/+13
|
* Ensure that newfs will never create a filesystem with more than 2^32mckusick2010-02-103-47/+67
| | | | | | | | | | | | | | | | inodes by cutting back on the number of inodes per cylinder group if necessary to stay under the limit. For a default (16K block) file system, this limit begins to take effect for file systems above 32Tb. This fix is in addition to -r203763 which corrected a problem in the kernel that treated large inode numbers as negative rather than unsigned. For a default (16K block) file system, this bug began to show up at a file system size above about 16Tb. Reported by: Scott Burns, John Kilburg, Bruce Evans Followup by: Jeff Roberson PR: 133980 MFC after: 2 weeks
* Correct two typos.delphij2010-02-061-2/+2
| | | | | Reported by: Brandon Falk <falkman gamozo org> MFC after: 1 week
* Raise WARNS for various tools where possible.ed2010-01-171-1/+1
| | | | Submitted by: Marius NĂ¼nnerich <marius@nuenneri.ch>
* Fix typo: s/partion/partition/mbr2010-01-021-1/+1
| | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 3 days
* Slightly improve gjournal documentation.trasz2009-04-291-0/+4
| | | | Reviewed by: pjd
* Don't add a bwrite() symbol, it breaks the build when building newfscognet2009-02-122-16/+16
| | | | | | statically. Instead, bring in a stripped down version of sbwrite(), and add the offset to every bwrite() calls.
* Move the check for the ending char in the partition name whereluigi2008-12-121-5/+6
| | | | | | | | | it was before -- the check is only made when getdisklabel() returns valid info. On passing, use MAXPARTITIONS to identify the max partition number, instead of the hardwired 'h' MFC after: 4 weeks
* Enable operation of newfs on plain files, which is useful when youluigi2008-12-035-16/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | want to prepare disk images for emulators (though 'makefs' in port can do something similar). This relies on: + minor changes to pass the consistency checks even when working on a file; + an additional option, '-p partition' , to specify the disk partition to initialize; + some changes on the I/O routines to deal with partition offsets. The latter was a bit tricky to implement, see the details in newfs.h: in newfs, I/O is done through libufs which assumes that the file descriptor refers to the whole partition. Introducing support for the offset in libufs would require a non-backward compatible change in the library, to be dealt with a version bump or with symbol versioning. I felt both approaches to be overkill for this specific application, especially because there might be other changes to libufs that might become necessary in the near future. So I used the following trick: - read access is always done by calling bread() directly, so we just add the offset in the (few) places that call bread(); - write access is done through bwrite() and sbwrite(), which in turn calls bwrite(). To avoid rewriting sbwrite(), we supply our own version of bwrite() here, which takes precedence over the version in libufs. MFC after: 4 weeks
* Replace reference from vinum.8 to gvinum.8, it was advised in the PR toremko2008-03-211-2/+2
| | | | | | | | | | replace this with vinum.4, but that's the kernel interface manual, which is not appropriate in my understanding. I think that gvinum is a suitable replacement for this. PR: docs/121938 Submitted by: "Federico" <federicogalvezdurand at yahoo dot com> MFC after: 3 days
* Use calloc().delphij2008-03-051-2/+1
|
* 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
|
OpenPOWER on IntegriCloud