| |
@@ -194,11 +194,21 @@
|
| |
exit 1
|
| |
fi
|
| |
|
| |
- if [ "$MEDIA" = "/dev/sda" ]; then
|
| |
+ ROOTDISK="$(mount | grep "on / " | awk '{printf $1"\n"}')"
|
| |
+ case "$ROOTDISK" in
|
| |
+ *nvme*)
|
| |
+ ROOTDISK="$(echo $ROOTDISK | head -c 10)"
|
| |
+ ;;
|
| |
+ *sd*)
|
| |
+ ROOTDISK="$(echo $ROOTDISK | head -c 8)"
|
| |
+ ;;
|
| |
+ esac
|
| |
+
|
| |
+ if [ "$MEDIA" = "$ROOTDISK" ]; then
|
| |
echo ""
|
| |
echo " ***********************************************************"
|
| |
echo " ** WARNING: You have requested the image be written to sda."
|
| |
- echo " ** /dev/sda is usually the root filesystem of the host. "
|
| |
+ echo " ** $ROOTDISK is mounted as the root filesystem of the host."
|
| |
echo " ***********************************************************"
|
| |
echo " ** Do you wish to continue? (type 'yes' to continue)"
|
| |
echo " ***********************************************************"
|
| |
On the majority of new systems it's /dev/nvme0.
And /dev/sda is the first usb key inserted, which
is often where you want to write to. Make the
check smarter by checking what the device is
with the root filesystem of the host.