From ae6e1d5ff8e2589cf23673efe9969661a132b788 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 6 Apr 2010 14:16:20 +0000 Subject: image restore script: handle hybrid images (by matching main device) --- rescue/NEWS | 1 + rescue/restore-image.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'rescue') diff --git a/rescue/NEWS b/rescue/NEWS index 5751ca5cb..951f566f8 100644 --- a/rescue/NEWS +++ b/rescue/NEWS @@ -1,4 +1,5 @@ - Handle LVM (#44723) +- image restore script: handle hybrid images (by matching main device) Version 1.16 - 9 October 2009, by Olivier "blino" Blin diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh index 99de39a27..4cf06c9e6 100755 --- a/rescue/restore-image.sh +++ b/rescue/restore-image.sh @@ -93,7 +93,8 @@ do you want to continue?" function detect_root() { - inst_source_dev=$(sed '\|'$restore_media'|!d;s/[0-9] .*$//;s/^.*\///' /proc/mounts) + inst_source_dev=$(awk "\$2 == \"$restore_media\" { print \$1 }" /proc/mounts | sed -e 's/[0-9]$//') + inst_source_dev=${inst_source_dev#/dev/} devices=$(grep "^ .*[^0-9]$" < /proc/partitions | grep -v ${inst_source_dev} | awk '$3 > '$MIN_DISKSIZE' { print $4,$3 }') if [ -z "${devices}" ]; then -- cgit v1.2.1