History log of /netbsd-current/sbin/gpt/resize.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.25 24-May-2020 jmcneill

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.


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.24 24-Mar-2019 martin

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.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728
# 1.23 03-Jul-2018 jnemeth

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.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.22 04-Dec-2015 christos

branches: 1.22.14; 1.22.16;
Kill newline


# 1.21 03-Dec-2015 christos

WARNS=6


# 1.20 03-Dec-2015 christos

remove extra assignment


# 1.19 03-Dec-2015 christos

eliminate static globals so that commands can be re-used.


# 1.18 02-Dec-2015 christos

- check errors from map allocation
- make map_resize return -1 instead of 0, and handle errors locally
explaining what's going wrong


# 1.17 01-Dec-2015 christos

refactor more duplicated code.


# 1.16 01-Dec-2015 christos

Refactor the command dispatching and help printing logic.


# 1.15 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.14 01-Dec-2015 christos

- use gpt_msg to print informational messages (perhaps these should be printed
only with -v)
- don't print any messages with gpt_msg if quiet
- print a message if we didn't reconfigure the wedges


# 1.13 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.12 29-Nov-2015 christos

merge the create errors in one place and fix them.


# 1.11 30-Sep-2014 christos

Add internal uuid support, since the linux+macos versions of the library
are different than than *bsd ones, and others might not have it at all.


# 1.10 30-Sep-2014 christos

remove compat defines.


# 1.9 29-Sep-2014 christos

minor toolification: need libprop...


Revision tags: tls-maxphys-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 10-Dec-2013 jnemeth

branches: 1.8.4; 1.8.6; 1.8.8;
Explicitly state which partition was added/modified.


# 1.7 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.6 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.5 28-Nov-2013 jnemeth

when calling dehumanize_number() make sure the resulting number is >= 1


# 1.4 27-Nov-2013 christos

CID 1132764: Bogus test


# 1.3 27-Nov-2013 jnemeth

Remove FreeBSD specific code as per message to tech-userlevel.


# 1.2 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.1 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.24 24-Mar-2019 martin

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.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728
# 1.23 03-Jul-2018 jnemeth

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.


Revision tags: netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.22 04-Dec-2015 christos

branches: 1.22.14;
Kill newline


# 1.21 03-Dec-2015 christos

WARNS=6


# 1.20 03-Dec-2015 christos

remove extra assignment


# 1.19 03-Dec-2015 christos

eliminate static globals so that commands can be re-used.


# 1.18 02-Dec-2015 christos

- check errors from map allocation
- make map_resize return -1 instead of 0, and handle errors locally
explaining what's going wrong


# 1.17 01-Dec-2015 christos

refactor more duplicated code.


# 1.16 01-Dec-2015 christos

Refactor the command dispatching and help printing logic.


# 1.15 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.14 01-Dec-2015 christos

- use gpt_msg to print informational messages (perhaps these should be printed
only with -v)
- don't print any messages with gpt_msg if quiet
- print a message if we didn't reconfigure the wedges


# 1.13 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.12 29-Nov-2015 christos

merge the create errors in one place and fix them.


# 1.11 30-Sep-2014 christos

Add internal uuid support, since the linux+macos versions of the library
are different than than *bsd ones, and others might not have it at all.


# 1.10 30-Sep-2014 christos

remove compat defines.


# 1.9 29-Sep-2014 christos

minor toolification: need libprop...


Revision tags: tls-maxphys-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 10-Dec-2013 jnemeth

branches: 1.8.4; 1.8.6; 1.8.8;
Explicitly state which partition was added/modified.


# 1.7 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.6 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.5 28-Nov-2013 jnemeth

when calling dehumanize_number() make sure the resulting number is >= 1


# 1.4 27-Nov-2013 christos

CID 1132764: Bogus test


# 1.3 27-Nov-2013 jnemeth

Remove FreeBSD specific code as per message to tech-userlevel.


# 1.2 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.1 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


Revision tags: pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.22 04-Dec-2015 christos

Kill newline


# 1.21 03-Dec-2015 christos

WARNS=6


# 1.20 03-Dec-2015 christos

remove extra assignment


# 1.19 03-Dec-2015 christos

eliminate static globals so that commands can be re-used.


# 1.18 02-Dec-2015 christos

- check errors from map allocation
- make map_resize return -1 instead of 0, and handle errors locally
explaining what's going wrong


# 1.17 01-Dec-2015 christos

refactor more duplicated code.


# 1.16 01-Dec-2015 christos

Refactor the command dispatching and help printing logic.


# 1.15 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.14 01-Dec-2015 christos

- use gpt_msg to print informational messages (perhaps these should be printed
only with -v)
- don't print any messages with gpt_msg if quiet
- print a message if we didn't reconfigure the wedges


# 1.13 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.12 29-Nov-2015 christos

merge the create errors in one place and fix them.


# 1.11 30-Sep-2014 christos

Add internal uuid support, since the linux+macos versions of the library
are different than than *bsd ones, and others might not have it at all.


# 1.10 30-Sep-2014 christos

remove compat defines.


# 1.9 29-Sep-2014 christos

minor toolification: need libprop...


Revision tags: tls-maxphys-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 10-Dec-2013 jnemeth

branches: 1.8.4; 1.8.6; 1.8.8;
Explicitly state which partition was added/modified.


# 1.7 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.6 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.5 28-Nov-2013 jnemeth

when calling dehumanize_number() make sure the resulting number is >= 1


# 1.4 27-Nov-2013 christos

CID 1132764: Bogus test


# 1.3 27-Nov-2013 jnemeth

Remove FreeBSD specific code as per message to tech-userlevel.


# 1.2 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.1 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.