summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
Commit message (Collapse)AuthorAgeFilesLines
* Use NULL instead of 0 for pointers.araujo2016-04-181-1/+1
| | | | | | | strchr(3) will return NULL if the character does not appear in the string. MFC after: 2 weeks.
* It's 2015, and some people are still trying to use fdisk and thentrasz2015-09-021-1/+1
| | | | | | | | | | | | | go asking what debug flags to set for GEOM to make it work. Advice them to use gpart(8) instead. Something similar should probably done with disklabel, but I need to rewrite the disklabel examples first. Reviewed by: wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3315
* Code cleanup unused-but-set-variable spotted by gcc.araujo2015-08-251-2/+0
| | | | | Approved by: bapt (mentor) Differential Revision: D3475
* fix the docs, the number of frags per inode (NFPI) changed in r228794jmg2015-07-151-4/+4
| | | | | | | | to 2 from 4, but the man page didn't get updated... other minor changes to make igor happy... MFC after: 3 days
* Add META_MODE support.sjg2015-06-131-0/+20
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge sync of headsjg2015-05-273-34/+3
| |\ | |/ |/|
| * Updated dependenciessjg2014-05-161-1/+0
| |
| * Updated dependenciessjg2014-05-101-0/+2
| |
| * Merge headsjg2014-04-281-5/+3
| |\
| * \ Merge head@256284sjg2013-10-131-3/+3
| |\ \
| * \ \ sync from headsjg2013-04-124-2/+30
| |\ \ \
| * | | | Updated dependenciessjg2013-03-111-0/+1
| | | | |
| * | | | Updated dependenciessjg2013-02-161-2/+0
| | | | |
| | | | |
| | \ \ \
| *-. \ \ \ Sync from headsjg2012-11-043-2/+5
| |\ \ \ \ \
| * | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+21
| | |/ / / / | |/| | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | | Remove old ioctl use and support, once and for all.imp2015-01-061-30/+0
| | | | | |
* | | | | | mdoc: improvements to SEE ALSO.joel2014-12-271-2/+2
| | | | | |
* | | | | | Convert sbin/ to LIBADDbapt2014-11-251-2/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | Reduce overlinking
* | | | | Refer newfs and growfs users to fsck_ffs instead ofbrueffer2014-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsck, the latter does not accept the referred to "-b" flag. This change was accidently committed directly to 9-STABLE in r237505. PR: 82720 Submitted by: David D.W. Downey MFC after: 1 week
* | | | | Don't call arc4random_stir() explicitly. To quote arc4random(3)delphij2013-10-291-4/+2
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | manual page: There is no need to call arc4random_stir() before using arc4random() functions family, since they automatically initialize themselves. No objection: des MFC after: 2 weeks
* | | | Sweep man pages replacing ad -> ada.pluknet2013-10-011-3/+3
| |_|/ |/| | | | | | | | | | | | | | Approved by: re (blackend) MFC after: 1 week X-MFC note: stable/9 only
* | | Remove contractions.joel2013-04-111-1/+1
| | |
* | | The purpose of this change to the FFS layout policy is to reduce themckusick2013-03-224-1/+29
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | running time for a full fsck. It also reduces the random access time for large files and speeds the traversal time for directory tree walks. The key idea is to reserve a small area in each cylinder group immediately following the inode blocks for the use of metadata, specifically indirect blocks and directory contents. The new policy is to preferentially place metadata in the metadata area and everything else in the blocks that follow the metadata area. The size of this area can be set when creating a filesystem using newfs(8) or changed in an existing filesystem using tunefs(8). Both utilities use the `-k held-for-metadata-blocks' option to specify the amount of space to be held for metadata blocks in each cylinder group. By default, newfs(8) sets this area to half of minfree (typically 4% of the data area). This work was inspired by a paper presented at Usenix's FAST '13: www.usenix.org/conference/fast13/ffsck-fast-file-system-checker Details of this implementation appears in the April 2013 of ;login: www.usenix.org/publications/login/april-2013-volume-38-number-2. A copy of the April 2013 ;login: paper can also be downloaded from: www.mckusick.com/publications/faster_fsck.pdf. Reviewed by: kib Tested by: Peter Holm MFC after: 4 weeks
* | Fix problem with geom_label(4) not recognizing UFS labels on filesystemstrasz2012-10-303-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | extended using growfs(8). The problem here is that geom_label checks if the filesystem size recorded in UFS superblock is equal to the provider (i.e. device) size. This check cannot be removed due to backward compatibility. On the other hand, in most cases growfs(8) cannot set fs_size in the superblock to match the provider size, because, differently from newfs(8), it cannot recompute cylinder group sizes. To fix this problem, add another superblock field, fs_providersize, used only for this purpose. The geom_label(4) will attach if either fs_size (filesystem created with newfs(8)) or fs_providersize (filesystem expanded using growfs(8)) matches the device size. PR: kern/165962 Reviewed by: mckusick Sponsored by: FreeBSD Foundation
* | Fix sbin/ build with a 64-bit ino_t.mdf2012-09-271-1/+2
|/ | | | Original code by: Gleb Kurtsou
* Fix warning when compiling with gcc46:eadler2012-01-101-2/+0
| | | | | | | error: variable 'c' set but not used Approved by: dim MFC after: 3 days
* Reduce NFPI by half to keep the default number of inodes the same withmckusick2011-12-211-1/+1
| | | | | | | | | the now default 32K/4K filesystem the same as the number of inodes in the previously default 16K/2K filesystem. PR: bin/16265 Reported by: Olivier Cochard-Labbe <olivier@cochard.me> MFC: 4 weeks (9 is the only affected branch)
* Add missing static keywords for global variables to tools in sbin/.ed2011-11-042-2/+3
| | | | | | These tools declare global variables without using the static keyword, even though their use is limited to a single C-file, or without placing an extern declaration of them in the proper header file.
* Advertise growfs(8) a little better.trasz2011-06-221-1/+2
|
* Update the manual page to reflect the new 32K/4K defaults.mckusick2011-05-281-4/+4
| | | | Reminded by: Ivan Voras
* Raise the default blocksize for UFS/FFS filesystems frommckusick2011-05-261-2/+2
| | | | | | | | | | | | | | | | | | | 16K to 32K and the default fragment size from 2K to 4K. The rational is that most disks are now running with 4K sectors. While they can (slowly) simulate 512-byte sectors by doing a read-modify-write, it is desirable to avoid this functionality. By raising the minimum filesystem allocation to 4K, the filesystem will never trigger the small sector emulation. Also, the growth of disk sizes has lead us to double the default block size about every ten years. The rise from 8K to 16K blocks was done in 2001. So, by the 10-year metric, the time has come for 32K blocks. Discussed at: May 2011 BSDCan Developer Summit Reference: http://wiki.freebsd.org/201105DevSummit/FileSystems
* Stop trying to zero UFS1 superblocks if we fall off the end of the disk.cperciva2011-04-261-1/+4
| | | | | | | | | | This avoids a potentially many-hours-long loop of failed writes if newfs finds a partially-overwritten superblock (or, for that matter, random garbage which happens to have superblock magic bytes); on one occasion I found newfs trying to zero 800 million superblocks on a 50 MB disk. Reviewed by: mckusick MFC after: 1 week
* Xref makefs(8).jh2011-02-221-1/+2
| | | | | PR: 154708 Submitted by: jhs
* Add the -j option to enable soft updates journaling when creatingmckusick2011-02-162-3/+18
| | | | | | a new file system. Reviewed by: Kostik Belousov <kostikbel@gmail.com>
* The dump, fsck_ffs, fsdb, fsirand, newfs, makefs, and quot utilitiesmckusick2011-01-241-10/+9
| | | | | | | | | | | | | | include sys/time.h instead of time.h. This include is incorrect as per the manpages for the APIs and the POSIX definitions. This commit replaces sys/time.h where necessary with time.h. The commit also includes some minor style(9) header fixup in newfs. This commit is part of a larger effort by Garrett Cooper started in //depot/user/gcooper/posix-conformance-work/ -- to make FreeBSD more POSIX compliant. Submitted by: Garrett Cooper yanegomi at gmail dot com
* Add support for FS_TRIM to user-mode UFS utilities.kib2010-12-294-3/+19
| | | | | | Reviewed by: mckusick, pjd, pho Tested by: pho MFC after: 1 month
* Add the missed 'p' flag to getopt() optstring argument.kib2010-12-151-1/+1
| | | | MFC after: 1 week
* Reported problem:mckusick2010-09-241-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Large (60GB) filesystems created using "newfs -U -O 1 -b 65536 -f 8192" show incorrect results from "df" for free and used space when mounted immediately after creation. fsck on the new filesystem (before ever mounting it once) gives a "SUMMARY INFORMATION BAD" error in phase 5. This error hasn't occurred in any runs of fsck immediately after "newfs -U -b 65536 -f 8192" (leaving out the "-O 1" option). Solution: The default UFS1 superblock is located at offset 8K in the filesystem partition; the default UFS2 superblock is located at offset 64K in the filesystem partition. For UFS1 filesystems with a blocksize of 64K, the first alternate superblock resides at 64K which is the the location used for the default UFS2 superblock. By default, the system first checks for a valid superblock at the default location for a UFS2 filoesystem. For a UFS1 filesystem with a blocksize of 64K, there is a valid UFS1 superblock at this location. Thus, even though it is expected to be a backup superblock, the system will use it as its default superblock. So, we have to ensure that all the statistcs on usage are correct in this first alternate superblock as it is the superblock that will actually be used. While tracking down this problem, another limitation of UFS1 became evident. For UFS1, the number of inodes per cylinder group is stored in an int16_t. Thus the maximum number of inodes per cylinder group is limited to 2^15 - 1. This limit can easily be exceeded for block sizes of 32K and above. Thus when building UFS1 filesystems, newfs must limit the number of inodes per cylinder group to 2^15 - 1. Reported by: Guy Helmer<ghelmer@palisadesys.com> Followup by: Bruce Cran <brucec@freebsd.org> PR: 107692 MFC after: 4 weeks
* Synchronize newfs(8) manual with code.gjb2010-09-141-3/+4
| | | | | | | | PR: 61716 Submitted by: Radim Kolar <hsn at netmag cz> Patch by: arundel Approved by: keramida (mentor) MFC after: 1 week
* Rewording and typo fixes in newfs(8).gjb2010-09-121-3/+3
| | | | | | | | PR: 150490 Submitted by: Eitan Adler <foreignuser at eitanadler com> Additional fixes by: Warren Block <wblock at wonkity com>, keramida Approved by: keramida (mentor) MFC after: 1 week
* 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
OpenPOWER on IntegriCloud