Changeset 957 in MondoRescue for branches/stable/mindi
- Timestamp:
- Nov 21, 2006, 11:07:15 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/mindi
r953 r957 924 924 local res currline partition all_partitions ap_orig remaining i j 925 925 926 grep -vx " *#.*" $MY_FSTAB | grep -vx " *none.*" | $AWK '/^\/dev\/[imhs]d|| LABEL\=\// && !/fdd|cdr|zip|floppy/ {print $1}'926 grep -vx " *#.*" $MY_FSTAB | grep -vx " *none.*" | $AWK '/^\/dev\/[imhs]d||^LABEL\=\/|^UUID=/ && !/fdd|cdr|zip|floppy/ {print $1}' 927 927 [ -e "/etc/raidtab" ] && $AWK '/^ *device/ {print $2}' /etc/raidtab 928 928 return … … 1211 1211 [ "$c_p" = "none" ] && continue 1212 1212 redhat_label="" 1213 uuid="" 1213 1214 absolute_partition=`readlink -f $c_p` 1214 1215 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1` … … 1284 1285 fi 1285 1286 1287 # This part tries to retrieve the correct device from a UUID line in /etc/fstab 1288 # current_partition contains only first column of /etc/fstab 1289 if [ "`echo "$current_partition" | /bin/grep -i "UUID="`" != "" ]; then 1290 str_to_find_fmt_with=$current_partition 1291 uuid=`echo "$current_partition" | /bin/cut -d'=' -f2` 1292 actual_dev="" 1293 1294 # 1st try, findfs - the RHEL way of finding labels and their partitions 1295 if [ -x "/sbin/findfs" ]; then 1296 actual_dev=`/sbin/findfs UUID=${uuid} 2> /dev/null` 1297 fi 1298 1299 # 2nd try : blkid, the good way for all LABEL except swap 1300 if [ "x$actual_dev" = "x" -a -x "/sbin/blkid" ]; then 1301 actual_dev=`/sbin/blkid | /bin/grep "$uuid" | grep UUID= | /bin/cut -d':' -f1` 1302 # For LVM FS it will give a /dev/dm-# which should then be converted 1303 if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then 1304 major=`/bin/ls -l $actual_dev | awk '{print $5}'` 1305 minor=`/bin/ls -l $actual_dev | awk '{print $6}'` 1306 for dev in `ls /dev/mapper/*`; do 1307 major1=`/bin/ls -l $dev | awk '{print $5}'` 1308 minor1=`/bin/ls -l $dev | awk '{print $6}'` 1309 if [ $major1 = $major ] && [ $minor1 = $minor ]; then 1310 actual_dev=`/bin/ls -l $dev | awk '{print $10}'` 1311 break 1312 fi 1313 done 1314 fi 1315 fi 1316 1317 # 3th try, with vol_id 1318 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then 1319 list_dev=`mount | /bin/grep -E '^/' | /bin/awk '{ print $1 }' ` 1320 for dev in $list_dev ; do 1321 dev_exists=`/sbin/vol_id $dev | /bin/grep "$uuid"` 1322 if [ "x$dev_exists" != "x" ]; then 1323 actual_dev=$dev 1324 break; 1325 fi 1326 done 1327 fi 1328 1286 1329 # Check if one of all those tries has known success 1287 1330 if [ "x$actual_dev" != "x" ]; then 1288 1331 current_partition=$actual_dev 1289 1332 else 1290 Die "Your system uses a labelledpartition ($current_partition), but you lack the tool to support it.\nPlease replace labels with their correct devices in /etc/fstab or install findfs|blkid|vol_id\n"1333 Die "Your system uses a UUID partition ($current_partition), but you lack the tool to support it.\nPlease replace labels with their correct devices in /etc/fstab or install findfs|blkid|vol_id\n" 1291 1334 fi 1292 1335 else
Note:
See TracChangeset
for help on using the changeset viewer.