Commit Graph

127 Commits

Author SHA1 Message Date
lulf
f98c75f6cc - Back out the previous change in order to maintain compatibility. 2009-06-17 06:41:10 +00:00
lulf
e491a34e1d - The maximum number of heads is 255, not 256.
Pointed out by:		marcel
2009-06-15 16:51:07 +00:00
brian
4cdcaba809 Bump the document date to reflect the 'p' command enhancements.
Suggested by:	trhodes
2009-05-25 21:27:31 +00:00
brian
c60c7e0b06 Enhance the 'p' command so that it understands size qualifiers (K/M/G) and
so that it understands '*' as 'DTRT'.

PR:		68312
Submitted by:	Rene de Vries - rene at tunix dot nl (mostly)
MFC after:	3 weeks
2009-05-25 09:23:26 +00:00
luigi
4a006b061c Reword some entries for NTFS and DOS.
Add entries for DELL and ASUS recovery partitions.

MFC after:	3 days
2009-01-14 22:05:51 +00:00
luigi
f901337fc8 Another change from Christoph:
replace the table of partition with a simpler and faster array of strings.
The change in the array is done mechanically, using vi commands.
Most entries in the table are probably 15+ years old and largely outdated,
so the next step is to remove stale entries with more current values.

Submitted by:	Christoph Mallon, with small changes from me
MFC after:	3 days
2009-01-14 21:31:09 +00:00
luigi
ecf6d10e65 more changes from Christoph:
pass a pointer instead of an index to print_part()
so it does not depend on a static variable.

Submitted by:	Christoph Mallon
MFC after:	3 days
2009-01-14 21:08:19 +00:00
luigi
0181d68811 remove unused argument to print_s0()
Submitted by:	Christoph Mallon
MFC after:	3 days
2009-01-14 20:53:46 +00:00
luigi
67397b4c7d Some small fixes submitted by Christoph Mallon, specifically:
+ Remove a dead field of a struct. It serves no purpose anymore.
+ Remove a \n at the end of the format string of err(); the err()
  function already adds a \n ;
+ remove many unnecessary casts which obfuscate the code.

This file has a huge number of indentation bugs, but I'd rather fix
them when/if we happen to modify the relevant parts of the code.

Submitted by:	Christoph Mallon
MFC after:	3 days
2009-01-13 23:36:38 +00:00
lulf
5eb1ad1462 - Improve error message given on g_providername call failure.
- While there, make error messages consistent with the rest.

Approved by:	kib (mentor)
2008-09-30 07:18:49 +00:00
ru
bc0c6af203 Add missing library dependencies.
PR:		bin/127573
Submitted by:	Eygene Ryabinkin
2008-09-23 13:12:51 +00:00
lulf
6e02adf310 - Make use of the new and g_device_path utility function in libgeom to avoid
duplication of code in fdisk and boot0cfg. Also make use of g_providername to
  fix an issue with fdisk and boot0cfg not using the correct provider when
  writing the MBR.

Reviewed by:	phk
Approved by:	pjd (mentor)
2008-09-07 13:58:35 +00:00
obrien
30175e1d31 Add a -q[uiet] flag for scripts. 2008-07-31 00:55:29 +00:00
andre
c1f9a3e303 Add Apple HFS+ (0xAF) MBR partition type identificator.
Submitted by:	rpaulo (SoC2007 student)
2007-05-06 18:48:30 +00:00
maxim
24e3ce108a o Add -p flag: print a slice table in fdisk configuration file format.
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
2007-04-30 18:29:36 +00:00
ru
e780f220d8 - Document -u, -i, and the difference between them better.
- Remove some historical notes about "future" decisions.
2006-12-12 15:26:25 +00:00
ru
f566a238ab Document the following change in behavior:
: 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.
2006-12-08 21:50:48 +00:00
simon
80d29aa8a8 - Fail with an understandable error message if we cannot detect the
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
2006-06-18 22:02:22 +00:00
rodrigc
29e27ce1a6 Call gctl_free() to free resource allocated with gctl_get_handle().
PR:		bin/84664
Submitted by:	Daan Vreeken <Danovitsch at Vitsch dot net>
MFC after:	3 days
2005-09-17 14:56:10 +00:00
phk
885176b2cb Attempt gctl verb "write MBR" when updating.
This should solve the problem of modifying a busy MBR.
2005-07-15 08:02:51 +00:00
nyan
5009ff132c cosmetic changes. 2005-05-01 09:50:02 +00:00
nyan
fa2fcbedc1 Use NDOSPART macro instead of a magic number. 2005-05-01 05:01:55 +00:00
phk
691e072f68 If we resort to opening a slice instead of the base device, do so with
the correct mode for our arguments.
2005-04-29 21:24:27 +00:00
phk
1fcd5aef88 Add 0xbf as new partition id for Solaris.
Submitted by:	Lawrence.Lee@sun.com
2004-11-10 07:48:29 +00:00
ru
7d75b385f4 Don't prepend "/dev" if an argument given is an absolute pathname.
Reviewed by:	jhb
2004-10-20 05:43:45 +00:00
ru
46fddaa54b Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
phk
354d52981a Make fdisk initialize the first instead of the last slice by default. 2004-06-14 07:21:19 +00:00
johan
31854a224a style.Makefile(5):
Use WARNS?= instead of WARNS=.
2004-02-23 20:25:27 +00:00
harti
9509c3737c Add the Solaris x86 boot partition type. This is used in Solaris 10
(and perhaps earlier).

Submitted by:	Joerg Schilling <schilling@fokus.fraunhofer.de>
2003-12-18 13:13:02 +00:00
des
c0bafc9a83 Warn about partitions that would overlap with the master boot record, and
if the user agrees, move them out one track.

MFC after:	7 days
2003-11-13 21:13:43 +00:00
blackend
88e85b883a s/disklabel/bsdlabel where needed. 2003-10-11 08:24:07 +00:00
obrien
19105c8312 Use __FBSDID() to quiet GCC 3.3 warnings. 2003-05-03 18:41:59 +00:00
phk
a9021891fc Use symbolic constants from <sys/diskmbr.h> instead of local constants.
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.
2003-04-13 21:57:08 +00:00
phk
2ceb0a613a Pull in the encoding/decoding functions for struct dos_partition.
Add a very simple regression test for "fdisk -I".
2003-04-13 21:34:16 +00:00
phk
a931dc5a57 Use default geometry in case the device doesn't provide one:
512 for sectorsize.
	63 for sectors.
	255 for heads.
This will mostly show up on MD(4) devices.
2003-03-29 22:06:52 +00:00
schweikh
86f7487fb6 Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00
phk
f387a3fcba Make fdisk work on active GEOM devices. 2002-12-29 15:17:11 +00:00
phk
4a5e62a6e7 Fix the regexp evilness so that fdisk can (again?) find the device
root is on from the root mount path.

Spotted by:	imp
2002-10-27 10:52:54 +00:00
phk
c9805dcdfb Don't attempt to find the geometry with disklabel based ioctl, it just
issues a useless warning now.
2002-10-27 10:33:38 +00:00
phk
19150ba4f8 Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 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.
2002-10-01 07:24:55 +00:00
phk
d605f09966 Straighten out get_params().
Sponsored by:	DARPA & NAI Labs.
2002-09-20 08:12:51 +00:00
phk
2a9f9dcde0 Try to pick up disk geometry with specific DIOC* ioctls, rather than
expecting a bogo-disklabel to contain them, if possible.

This makes fdisk work with GEOM.
2002-09-15 16:08:52 +00:00
trhodes
136be46680 s/filesystem/file system/g as discussed on -developers 2002-08-21 18:11:48 +00:00
bde
17cab9c595 Fixed some print format errors. Avoid some warnings about possible
(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.
2002-07-16 23:18:29 +00:00
ru
23be08df4b mdoc(7) police: tidy up the markup and some wording. 2002-05-30 09:41:33 +00:00
peter
6059c4954f Add a hack so that fdisk(8) can initialize an ia64 disk. There is
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.
2002-05-01 06:48:29 +00:00
grog
a8a9a0dc87 Add partition type for IBM's JFS.
Submitted by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-04-28 01:52:17 +00:00
trhodes
a4c67b08cb Fix the fdisk(8) manual page.
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
2002-04-18 16:25:18 +00:00
phk
e611c891de Get this to WARNS=4 and closer to style(9) at a sacrifice in
linelength.
2002-03-29 19:33:14 +00:00
joe
7b1c9df62b Add some more partition types.
PR:		i386/14793
MFC after:	3 days
2002-02-18 19:32:38 +00:00