diff options
author | mishra <none@none> | 2007-11-06 11:18:21 -0800 |
---|---|---|
committer | mishra <none@none> | 2007-11-06 11:18:21 -0800 |
commit | c92a08386ee67cad7e8f58bb28e68f0d30c18b4e (patch) | |
tree | 1717278c03dd7d94305acf991f18f56770e268b0 /usr/src/cmd/format/label.c | |
parent | 1f156c6a7686102f9a1057cb9294c57041f3da68 (diff) | |
download | illumos-joyent-c92a08386ee67cad7e8f58bb28e68f0d30c18b4e.tar.gz |
6607176 Format allows disk belonging to a ZFS pool to be resized and labeled.
Diffstat (limited to 'usr/src/cmd/format/label.c')
-rw-r--r-- | usr/src/cmd/format/label.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/usr/src/cmd/format/label.c b/usr/src/cmd/format/label.c index 749c6ff918..023aa3870a 100644 --- a/usr/src/cmd/format/label.c +++ b/usr/src/cmd/format/label.c @@ -35,6 +35,7 @@ #include "main.h" #include "partition.h" #include "ctlr_scsi.h" +#include "checkdev.h" #include <string.h> #include <stdlib.h> #include <memory.h> @@ -278,6 +279,18 @@ write_label() #endif /* defined(_SUNOS_VTOC_8) */ /* + * Check to see if any partitions used for svm, vxvm or live upgrade + * are on the disk. If so, refuse to label the disk, but only + * if we are trying to shrink a partition in use. + */ + if (checkdevinuse(cur_disk->disk_name, (diskaddr_t)-1, + (diskaddr_t)-1, 0, 1)) { + err_print("Cannot label disk when " + "partitions are in use as described.\n"); + return (-1); + } + + /* * If EFI label, then write it out to disk */ if (cur_label == L_TYPE_EFI) { |