[PATCH 1/3] imsm: Warn user about reboot risk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Current check-pointing implementation doesn't allow for interrupting reshape of boot arrays
due to checkpoint restore has to be done before system start.
There is problem with passing backup file name to array automatically mounted during boot time,
especially when scan mode is used.

Until IMSM check-pointing implementation will be introduced, warning about reboot risk
should be placed in mdadm.

Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
---

 super-intel.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 62ccd15..9c2caf7 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -7251,6 +7251,29 @@ int imsm_takeover(struct supertype *st, struct geo_params *geo)
 	return 0;
 }
 
+static int warn_user_about_risk(void)
+{
+	int rv = 0;
+
+	fprintf(stderr,
+		"\nThis is experimental feature. Data on the RAID volume(s) "
+		"can be lost!!!\n\n"
+		"To continue command execution please make sure that\n"
+		"grow process will not be interrupted. Use safe power\n"
+		"supply to avoid unexpected system reboot. Make sure that\n"
+		"reshaped container is not assembled automatically during\n"
+		"system boot.\n"
+		"If reshape is be interrupted, assemble array manually\n"
+		"using e.g. '-Ac' option and up to date mdadm.conf file.\n"
+		"Assembly in scan mode is not possible in such case.\n"
+		"Growing container with boot array is not possible.\n"
+		"If boot array reshape is interrupted, whole file system\n"
+		"can be lost.\n\n");
+	rv = ask("Do you want to continue? ");
+	fprintf(stderr, "\n");
+
+	return rv;
+}
 static int imsm_reshape_super(struct supertype *st, long long size, int level,
 			      int layout, int chunksize, int raid_disks,
 			      int delta_disks, char *backup, char *dev,
@@ -7283,6 +7306,14 @@ static int imsm_reshape_super(struct supertype *st, long long size, int level,
 		/* On container level we can only increase number of devices. */
 		dprintf("imsm: info: Container operation\n");
 		int old_raid_disks = 0;
+
+		/* this warning will be removed when imsm checkpointing
+		 * will be implemented, and restoring from check-point
+		 * operation will be transparent for reboot process
+		 */
+		if (warn_user_about_risk() == 0)
+			return ret_val;
+
 		if (imsm_reshape_is_allowed_on_container(
 			    st, &geo, &old_raid_disks)) {
 			struct imsm_update_reshape *u = NULL;

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux