Changeset 609 in MondoRescue for branches/stable
- Timestamp:
- Jun 2, 2006, 9:36:28 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/mindi
r608 r609 1342 1342 # This part tries to retrieve the correct device from a LABEL line in /etc/fstab 1343 1343 # current_partition contains only first column of /etc/fstab 1344 if [ "`echo "$current_partition" | /bin/grep -i "LABEL="`" != "" ] 1344 if [ "`echo "$current_partition" | /bin/grep -i "LABEL="`" != "" ]; then 1345 1345 str_to_find_fmt_with=$current_partition 1346 1346 redhat_label=`echo "$current_partition" | /bin/cut -d'=' -f2` … … 1348 1348 1349 1349 # 1st try : blkid, the good way 1350 if [ -x "/sbin/blkid" ] 1350 if [ -x "/sbin/blkid" ]; then 1351 1351 actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1` 1352 1352 fi 1353 1353 1354 1354 # 2nd try, which works on a standard partition (ext2/3), but not on swap 1355 if [ "x$actual_dev" = "x" ] 1355 if [ "x$actual_dev" = "x" ]; then 1356 1356 actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | /bin/cut -d' ' -f1` 1357 1357 fi 1358 1358 1359 1359 # 3rd try, with vol_id (which works with swap) 1360 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ] 1360 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then 1361 1361 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | /bin/awk '{ print $1 }' ` 1362 1362 for dev_swap in $list_swaps ; do 1363 1363 dev_exists=`/sbin/vol_id $dev_swap | /bin/grep "$redhat_label"` 1364 if [ "x$dev_exists" != "x" ] 1364 if [ "x$dev_exists" != "x" ]; then 1365 1365 actual_dev=$dev_swap 1366 1366 break; … … 1370 1370 1371 1371 # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda5 1372 if [ "x$actual_dev" = "x" -a "`echo "$current_partition" | /bin/grep -i "LABEL=SWAP"`" != ""]; then1372 if [ "x$actual_dev" = "x" -a _"`echo $current_partition | /bin/grep -i 'LABEL=SWAP'`" != _"" ]; then 1373 1373 try_dev="`echo "$redhat_label" | /bin/cut -d '-' -f2`" 1374 1374 present_dev="`/bin/cat /proc/swaps | /bin/grep -w /dev/$try_dev`" … … 1379 1379 1380 1380 # Check if one of all those tries has known success 1381 if [ "x$actual_dev" != "x" ] 1381 if [ "x$actual_dev" != "x" ]; then 1382 1382 current_partition=$actual_dev 1383 1383 else … … 1389 1389 1390 1390 partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB` 1391 if [ -d "/proc/lvm" ] && [ "`lvdisplay $current_partition 2> /dev/null`" ] 1391 if [ -d "/proc/lvm" ] && [ "`lvdisplay $current_partition 2> /dev/null`" ]; then 1392 1392 partition_size="lvm" 1393 elif [ -d "/dev/mapper" ] && [ "`lvm lvdisplay $current_partition 2> /dev/null`" ] 1393 elif [ -d "/dev/mapper" ] && [ "`lvm lvdisplay $current_partition 2> /dev/null`" ]; then 1394 1394 partition_size="lvm" 1395 1395 else
Note:
See TracChangeset
for help on using the changeset viewer.