Commit Graph

264 Commits

Author SHA1 Message Date
mlelstv 27a040a8a9 Big-Endian fixes. 2022-11-22 00:25:52 +00:00
mlelstv 0bf6d48843 Fix destroying and moving GPT header also for truncated/extended
images.
2022-11-20 11:57:02 +00:00
mlelstv ac9df4c9d7 Whitespace 2022-07-16 12:57:14 +00:00
kre 1467a58340 Note that biosboot without -A clears the PMBR "active" flag.
While here, fix some grammar and make the selection options
for biosboot a little clearer.

Ride nia@'s Dd bump.
2022-04-07 13:57:44 +00:00
nia 7a697167f6 gpt.8: Clarify that "windows" partition types are also used for FAT32
("msdos" in NetBSD terms), and UDF partitions. Use the same name as
Wikipedia, "Microsoft basic data".
2022-04-07 09:06:01 +00:00
jnemeth 464df8b50e PR/55875 - Valentin -- "gpt recover -r" does nothing
Delete do nothing undocumented option, that was there from initial
import.  No idea what it was intended to do and there is no longer
an "upstream".
2020-12-13 21:55:25 +00:00
christos a0c61f459b catch up with source rename of fbsd-zfs -> zfs 2020-07-27 20:54:18 +00:00
thorpej 759cf71618 When we add "entries", "index", and "sector_size" values to the dictionary,
add them as signed valaues, rather than unsigned (which is how we keep them
in memory).  This causes them be serialized in base-10 (rather than base-16,
which is the default for unsigned).  This behavior is documented in
prop_number(3).  Fixes t_gpt::backup_2part unit test.
2020-06-08 22:52:09 +00:00
thorpej d147ce2226 Update for proplib(3) API changes. 2020-06-07 05:42:25 +00:00
wiz 6f392fa3a0 Fix typo in macro. Sort option descriptions. 2020-05-24 20:59:16 +00:00
jmcneill e5906ade5e Add -H flag to ignore existing MBR (Hybrid MBR/GPT mode). 2020-05-24 18:42:20 +00:00
jmcneill 084befafcb Exit gracefully when auto-expanding a partition and it is already the
correct size. Add a -q flag to "resize" and "resizedisk" commands to skip
printing warnings in the already resize paths.
2020-05-24 14:42:44 +00:00
msaitoh 8012ca3f0e Remove extra semicolon. 2020-05-14 08:34:17 +00:00
martin 29b6fd854b Now that we use the same UUID for ZFS as FreeBSD, drop the FreeBSD marker
from the description.
2020-03-30 10:41:53 +00:00
jnemeth a1afb41542 Do the 'dkctl makewedges' dance to drop any wedges assoicated the
destroyed GPT.
2019-10-16 19:03:53 +00:00
christos 683824cce0 gpt_uuid_parse does not set errno ... 2019-10-11 23:04:52 +00:00
martin 8e17bc1a27 Remove outdated note about sysinst restrictions 2019-07-26 07:22:05 +00:00
sevan edae29ee93 Add rcsid 2019-06-30 11:38:16 +00:00
jnemeth 7d442200ff Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.
2019-06-25 04:53:40 +00:00
jnemeth acc2b630b1 adjust gpt_uuid_generate() to accept gpt==NULL 2019-06-25 04:25:11 +00:00
jnemeth 46e7349176 Add gpt_change_hdr() similar to gpt_change_ent() for changing
arbitrary header fields.
2019-06-25 03:42:45 +00:00
jnemeth e003a26f4c Add a third argument to the "cfn" function that is an argument to
gpt_change_ent().  The purpose of the third argument is to specify
whether the entry to be changed is a primary GPT entry or a secondary
GPT entry.  It is assumed that a secondary GPT entry will always
follow a corresponding primary entry.

This is in preparation for an upcoming change that will require it.
2019-06-21 02:14:59 +00:00
martin cad3861523 When biosboot is used on an existing wedge and we are switching to
the gpt of the parent device, do not pass the size of the wedge to
gpt_open, it certainly is smaller than the whole device.
Fixes bin/54312.
2019-06-20 10:56:38 +00:00
martin 08878476cc Do not try to close a NULL gpt. Fixes the core dump part of PR bin/54312 2019-06-20 10:41:58 +00:00
martin 5bb85d19b9 PR bin/54088: make "destroy" remove the protective MBR too.
We could make this optional if someone comes up with a good reason
to leave it intact.
2019-04-04 14:03:40 +00:00
martin 920f8d883d Ignore -f with the "destroy" command completely (it was effectively
ignored already, so no functional change). Leave it as valid option
for compatibility.
2019-04-04 13:58:20 +00:00
martin f63c9f4407 Allow specifying the partition via -b startsec for the biosboot cmd. 2019-04-04 13:55:40 +00:00
martin d48fad1d9d Allow -b to specify a partition for "gpt unset" as well. 2019-03-26 14:55:02 +00:00
martin d0774e18ba When displaying a single partition (gpt show -i ...) display offset
and size in sectors (instead of the totally confusing bytes),
followed by the humanized byte offset/size.

This makes the numbers match the "gpt show" or "gpt show -a"
output.
2019-03-26 11:23:55 +00:00
martin 1756583860 Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.
2019-03-25 20:15:49 +00:00
martin 2ee402b3d0 Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).
2019-03-24 13:45:35 +00:00
martin f2b09ed0f6 Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.
2019-03-24 13:31:00 +00:00
mlelstv 5ca1f5a8c5 print little-endian header fields correctly. 2019-03-14 10:26:10 +00:00
jnemeth 487d107169 Make it clear when displaying data from the MBR. 2019-03-03 03:20:42 +00:00
jnemeth f23b40fcf3 add some more FAT file system types 2019-03-03 02:28:14 +00:00
martin 8010630c8f Make "gpt migrate" work for disks with FAT32 and NTFS partitions 2019-02-10 10:35:51 +00:00
martin be31cead4d Fix three MBR extended partition related bugs:
1) when walking an extended MBR chain, do not assign duplicate indices
 2) the pointer to the next MBR may be any of the MBR_PTYPE_EXT* variants
 3) the ext MBR chain links are relative to the primary extended partition,
    unlike the contained partitions which are relative to the extended MBR
    block address.
2019-01-27 13:16:05 +00:00
martin 2e2c571302 Add a query function (for external code) to enumerate the know guids.
Add recently added VMware GUIDs to the internal enum type.
Fix some short names (bogus + duplicate).
2018-12-20 14:58:10 +00:00
mrg f5f53dd6ab add support to detect the 3 vmware GPT partition types:
- VMKcore (dump partition)
- VMFS
- VMware reserved

this enables vmkcore partitions for netbsd swap or dump, as well
as naming all of them.
2018-11-06 04:04:33 +00:00
mlelstv a66cbab44c When changing entries skip those that do not match the -L option.
Should fix PR 53668.
2018-10-14 20:10:49 +00:00
sevan 0a08194f8e Add the -T flag to usage() 2018-08-27 15:50:39 +00:00
jnemeth aa3b5bb2ee Not all things that write to the disk do something that dk(4) will
be interested in.  Let individual commands decide if ioctl(DIOCMWEDGES)
should be done.  I was conservative and set the flag on any command
that might create/modify/delete partitions in any way.
2018-07-03 03:41:23 +00:00
kre 1c825c2c91 Spello. (it is "existence").
ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!
2018-05-01 21:16:02 +00:00
wiz 64f2452046 Bump date for new EXIT STATUS section. 2018-05-01 21:04:01 +00:00
wiz 32e2530e6d Sort sections. 2018-05-01 21:03:37 +00:00
martin 72be6dafa1 Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.
2018-05-01 08:17:13 +00:00
mrg 28731ff616 if a new map entry doesn't fit, be more verbose about the sizes. 2018-04-11 07:14:23 +00:00
mrg d144e17dce add information about how to boot from gpt. mostly taken from the wiki. 2018-04-11 07:13:18 +00:00
mlelstv a23ee50408 Check device parameter to avoid segfaults. Agument synopsis for -l option. 2018-03-19 09:06:20 +00:00
sevan 9b1213ca1f Spelling 2018-02-13 00:34:11 +00:00