summaryrefslogtreecommitdiffstats
path: root/sbin/fdisk
Commit message (Collapse)AuthorAgeFilesLines
* Add a -q[uiet] flag for scripts.obrien2008-07-312-4/+12
|
* Add Apple HFS+ (0xAF) MBR partition type identificator.andre2007-05-061-0/+1
| | | | Submitted by: rpaulo (SoC2007 student)
* o Add -p flag: print a slice table in fdisk configuration file format.maxim2007-04-302-4/+36
| | | | | | | | Now it is possible to do something like fdisk -p ad0 | fdisk -f - ad1. PR: bin/110182 Submitted by: Jukka A. Ukkonen MFC after: 1 month
* - Document -u, -i, and the difference between them better.ru2006-12-121-15/+13
| | | | - Remove some historical notes about "future" decisions.
* Document the following change in behavior:ru2006-12-081-2/+2
| | | | | | : fdisk.c revision 1.74 : date: 2004/06/14 07:21:19; author: phk; state: Exp; lines: +3 -3 : Make fdisk initialize the first instead of the last slice by default.
* - Fail with an understandable error message if we cannot detect thesimon2006-06-181-2/+5
| | | | | | | | | | | | | | | | sector size, instead of later failing with an error about /boot/mbr not being a multiple of the sector size (since we end up with an assumed sector size of MAX_SEC_SIZE * 2). - We query the sector size via an IOCTL anyway, so if that succeeds use that instead of probing for it via read(2) calls. This fixes the problem with fdisk failing to operate on at least graid3 and md(4) devices on kernels with src/sys/geom/geom_dev.c before rev. 1.90, due to fdisk failing to detect the sector size. - When detecting the root device allow "/" characters in it, which happens with e.g. gmirror devices. Reviewed by: cperciva MFC after: 1 week
* Call gctl_free() to free resource allocated with gctl_get_handle().rodrigc2005-09-171-1/+4
| | | | | | PR: bin/84664 Submitted by: Daan Vreeken <Danovitsch at Vitsch dot net> MFC after: 3 days
* Attempt gctl verb "write MBR" when updating.phk2005-07-152-28/+46
| | | | This should solve the problem of modifying a busy MBR.
* cosmetic changes.nyan2005-05-011-17/+15
|
* Use NDOSPART macro instead of a magic number.nyan2005-05-011-2/+2
|
* If we resort to opening a slice instead of the base device, do so withphk2005-04-291-1/+1
| | | | the correct mode for our arguments.
* Add 0xbf as new partition id for Solaris.phk2004-11-101-0/+1
| | | | Submitted by: Lawrence.Lee@sun.com
* Don't prepend "/dev" if an argument given is an absolute pathname.ru2004-10-201-1/+1
| | | | Reviewed by: jhb
* Mechanically kill hard sentence breaks.ru2004-07-021-1/+1
|
* Make fdisk initialize the first instead of the last slice by default.phk2004-06-141-3/+3
|
* style.Makefile(5):johan2004-02-231-1/+1
| | | | Use WARNS?= instead of WARNS=.
* Add the Solaris x86 boot partition type. This is used in Solaris 10harti2003-12-181-0/+1
| | | | | | (and perhaps earlier). Submitted by: Joerg Schilling <schilling@fokus.fraunhofer.de>
* Warn about partitions that would overlap with the master boot record, anddes2003-11-131-0/+5
| | | | | | if the user agrees, move them out one track. MFC after: 7 days
* s/disklabel/bsdlabel where needed.blackend2003-10-111-2/+2
|
* Use __FBSDID() to quiet GCC 3.3 warnings.obrien2003-05-031-4/+2
|
* Use symbolic constants from <sys/diskmbr.h> instead of local constants.phk2003-04-132-15/+23
| | | | | | | | | | | | | | | | | | Always set the magic sequence when we write, rather than trusting the previously read boot code to do so. Use explicit encoding/decoding of little endian disk image. Remove a comment which was OBE. Change the test vector for "fdisk -I" to reflect that there is a magic sequence in the result now. Add test case for "fdisk" which reads the image back. At least for the two test-cases this program now gives the same result on sparc64 as on i386. The lack of an installed /boot/mbr on sparc64 raises an (un)interesting question.
* Pull in the encoding/decoding functions for struct dos_partition.phk2003-04-132-0/+30
| | | | Add a very simple regression test for "fdisk -I".
* Use default geometry in case the device doesn't provide one:phk2003-03-291-1/+6
| | | | | | | 512 for sectorsize. 63 for sectors. 255 for heads. This will mostly show up on MD(4) devices.
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-301-2/+2
| | | | Add FreeBSD Id tag where missing.
* Make fdisk work on active GEOM devices.phk2002-12-291-8/+33
|
* Fix the regexp evilness so that fdisk can (again?) find the devicephk2002-10-271-1/+1
| | | | | | root is on from the root mount path. Spotted by: imp
* Don't attempt to find the geometry with disklabel based ioctl, it justphk2002-10-271-15/+0
| | | | issues a useless warning now.
* Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:phk2002-10-011-0/+1
| | | | | | | | | | | | | | | | Peter had repocopied sys/disklabel.h to sys/diskpc98.h and sys/diskmbr.h. These two new copies are still intact copies of disklabel.h and therefore protected by #ifndef _SYS_DISKLABEL_H_ so #including them in programs which already include <sys.disklabel.h> is currently a no-op. This commit adds a number of such #includes. Once I have verified that I have fixed all the places which need fixing, I will commit the updated versions of the three #include files. Sponsored by: DARPA & NAI Labs.
* Straighten out get_params().phk2002-09-201-33/+34
| | | | Sponsored by: DARPA & NAI Labs.
* Try to pick up disk geometry with specific DIOC* ioctls, rather thanphk2002-09-151-1/+21
| | | | | | expecting a bogo-disklabel to contain them, if possible. This makes fdisk work with GEOM.
* s/filesystem/file system/g as discussed on -developerstrhodes2002-08-212-7/+7
|
* Fixed some print format errors. Avoid some warnings about possiblebde2002-07-161-4/+5
| | | | | | (but not actual) alignment problems. Both of these bugs were detected on ia64's and were fatal on ia64's due to premature setting of WARNS to 4.
* mdoc(7) police: tidy up the markup and some wording.ru2002-05-301-105/+126
|
* Add a hack so that fdisk(8) can initialize an ia64 disk. There ispeter2002-05-011-0/+10
| | | | | no /boot/mbr to read the boot code from (ia64 does not *have* bootblocks!). fdisk depended on magic in the /boot/mbr file to initialize some fields.
* Add partition type for IBM's JFS.grog2002-04-281-0/+1
| | | | Submitted by: Hiten Pandya <hiten@uk.FreeBSD.org>
* Fix the fdisk(8) manual page.trhodes2002-04-182-112/+115
| | | | | | | | | s/partition/slice/ in fdisk.8 fix a bug in fdisk(8) where it did not honer -t when using -I PR: 36563 and 35688 Submitted by: bde Reviewed by: bde
* Get this to WARNS=4 and closer to style(9) at a sacrifice inphk2002-03-292-300/+102
| | | | linelength.
* Add some more partition types.joe2002-02-181-26/+56
| | | | | PR: i386/14793 MFC after: 3 days
* Oops, the arguments to a bcopy() were reversed, which broke zeroingiedowse2001-12-301-3/+2
| | | | | | | | | of unused partition entries and later detection of unused entries. Use memcpy to be consistent with the rest of the code, and fix a minor style nit. Submitted by: bde
* Default to WARNS=2.obrien2001-12-041-0/+1
| | | | | | Binary builds that cannot handle this must explicitly set WARNS=0. Reviewed by: mike
* Fixed spelling error in previous commit.bde2001-10-161-1/+1
|
* Add 0xEE (EFI GPT) and 0xEF (EFI System Partition)peter2001-10-151-0/+2
|
* mdoc(7) police: protect trailing full stops of abbreviationsru2001-08-101-1/+1
| | | | with a trailing zero-width space: `e.g.\&'.
* Fix a number of bugs and annoyances in fdisk, many of which wereiedowse2001-08-051-74/+96
| | | | | | | | | | | | | | | | | | | | pointed out by bde: - Ask for user confirmation before adjusting to a head/cylinder boundary (only when running interactively), and separate this adjustment from the automatic calculation of c/h/s parameters. - In sanitize_partition, don't change any values in the slice until we know that the automatic adjustment will succeed. - When auto-adjusting, ignore unused slices and give an appropriate error for other zero-size slices depending on the cause. - Change dos() to do all of the c/h/s calculations for a whole slice; this fixes a bug where the ending c/h/s of an unused slice was set incorrectly. - When changing the active slice, detect the currently active slice number instead of always defaulting to slice 4. - Call fflush(stdout) before calling fgets(). - Test for fgets() returning NULL so we don't loop on EOF. Reviewed by: bde
* fdisk(8): document the default for -b, add xref to boot0cfg(8).ru2001-07-181-0/+3
| | | | | | boot0cfg(8): add FILES section. Reviewed by: rnordier
* Remove whitespace at EOL.dd2001-07-151-1/+1
|
* After some (long-standing ;-) critics from Bruce, throw away the oldjoerg2001-07-132-39/+65
| | | | | | | | | | | | | | device search code i introduce nearly six years ago in rev 1.8. Bruce suggested to rather use the device name of the root filesystem instead which is certainly the most sensible default. Since there are many possible cases for a root filesystem name (device with and without slices, consider /dev/vinum/root even though it currently could not work as such), there's some heuristic using a RE in order to find out the canonical device name from the mounted name. This probably won't quite fit for a NFS root (can't test that right now), but then, there's hard to find a good default for those machines anyway. ;-) This unbreaks the functionality of rev 1.2 i once broke in 1.8. :)
* mdoc(7) police: removed HISTORY info from the .Os call.ru2001-07-101-1/+1
|
* Make open_disk() fail nicely upon encountering an ENOENT so to notjoerg2001-07-051-2/+4
| | | | | | | | | | prematurely terminate the search for a usable disk. ENOENT is quite normal in particulare now with the advent of devfs. While being here, also remove /dev/wd0 and /dev/od0 from the list of disks to search since we don't have them anymore. MFC after: 1 week
* wd0 -> ad0dd2001-04-081-2/+2
| | | | | PR: 26343 Submitted by: Sergey A. Osokin <osa@FreeBSD.org.ru>
OpenPOWER on IntegriCloud