Changeset 1295 in MondoRescue
- Timestamp:
- Apr 11, 2007, 8:59:49 PM (18 years ago)
- Location:
- branches/2.2.2/mondo/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.2/mondo/src/common/libmondo-mountlist-EXT.h
r128 r1295 1 1 /* libmondo-mountlist-EXT.h */ 2 2 3 extern int evaluate_drive_within_mountlist(struct mountlist_itself4 *mountlist, char *drive,5 char *flaws_str);6 3 extern int evaluate_mountlist(struct mountlist_itself *mountlist, 7 4 char *flaws_str_A, char *flaws_str_B, -
branches/2.2.2/mondo/src/common/libmondo-mountlist.c
r1236 r1295 400 400 401 401 /*@ long *********************************************************** */ 402 long physical_drive_size = 0 ;403 long amount_allocated = 0 ;402 long physical_drive_size = 0L; 403 long amount_allocated = 0L; 404 404 405 405 /*@ pointers ******************************************************* */ … … 433 433 434 434 for (curr_part_no = 1; curr_part_no < 99; curr_part_no++) { 435 sprintf(device, "%s%d", drive, curr_part_no); 435 if ((strstr(device, "/cciss/") != NULL) || 436 (strstr(device, "/ataraid/") != NULL) || 437 (strstr(device, "/ida/") != NULL) || 438 (strstr(device, "/rd/") != NULL)) { 439 sprintf(device, "%sp%d", drive, curr_part_no); 440 } else { 441 sprintf(device, "%s%d", drive, curr_part_no); 442 } 436 443 pos = find_device_in_mountlist(mountlist, device); 437 444 if (pos < 0) { … … 440 447 if (physical_drive_size < 0) { 441 448 sprintf(tmp, " %s refers to non-existent hardware.", device); 449 log_it(tmp); 442 450 strcat(flaws_str, tmp); 443 451 res++; … … 969 977 #if linux 970 978 sscanf(incoming, 971 "%s %s %s %s %s ",979 "%s %s %s %s %s %s", 972 980 mountlist->el[items].device, 973 981 mountlist->el[items].mountpoint, 974 982 mountlist->el[items].format, 975 siz, mountlist->el[items].label );983 siz, mountlist->el[items].label, mountlist->el[items].uuid); 976 984 #elif __FreeBSD__ 977 985 sscanf(incoming, … … 981 989 mountlist->el[items].format, siz); 982 990 strcpy(mountlist->el[items].label, ""); 991 strcpy(mountlist->el[items].uuid, ""); 983 992 #endif 984 993 … … 1029 1038 1030 1039 sprintf(tmp, 1031 "%s %s %s %lld %s ",1040 "%s %s %s %lld %s %s", 1032 1041 mountlist->el[items].device, 1033 1042 mountlist->el[items].mountpoint, 1034 1043 mountlist->el[items].format, 1035 mountlist->el[items].size, mountlist->el[items].label); 1044 mountlist->el[items].size, 1045 mountlist->el[items].label, 1046 mountlist->el[items].uuid); 1036 1047 1037 1048 log_it(tmp); … … 1079 1090 mountlist->el[i].device, mountlist->el[i].mountpoint, 1080 1091 mountlist->el[i].format, mountlist->el[i].size, 1081 mountlist->el[i].label );1092 mountlist->el[i].label, mountlist->el[i].uuid); 1082 1093 } 1083 1094 paranoid_fclose(fout); -
branches/2.2.2/mondo/src/common/libmondo-mountlist.h
r128 r1295 4 4 5 5 6 int evaluate_drive_within_mountlist(struct mountlist_itself *mountlist,7 char *drive, char *flaws_str);8 6 int evaluate_mountlist(struct mountlist_itself *mountlist, 9 7 char *flaws_str_A, char *flaws_str_B, -
branches/2.2.2/mondo/src/common/mondostructures.h
r998 r1295 62 62 */ 63 63 char label[256]; 64 65 /** 66 * This is the filesystem UUID (if there is one). If not, this should be "". 67 */ 68 char uuid[64]; 64 69 }; 65 70 -
branches/2.2.2/mondo/src/mondorestore/mondo-restore.c
r1240 r1295 601 601 /* if (restore_some || restore_all || */ 602 602 if (ask_me_yes_or_no 603 ("Label your ext2 and ext3 partitions if necessary?")) {603 ("Label/Identify your ext2 and ext3 partitions if necessary?")) { 604 604 mvaddstr_and_log_it(g_currentY, 0, 605 "Using e2label to labelyour ext2,3 partitions");605 "Using tune2fs to identify your ext2,3 partitions"); 606 606 if (does_file_exist("/tmp/fstab.new")) { 607 607 strcpy(fstab_fname, "/tmp/fstab.new"); … … 840 840 mvaddstr_and_log_it(g_currentY, 841 841 0, 842 "Using e2label to labelyour ext2,3 partitions");842 "Using tune2fs to identify your ext2,3 partitions"); 843 843 844 844 sprintf(tmp, "label-partitions-as-necessary %s < /tmp/fstab", -
branches/2.2.2/mondo/src/mondorestore/mondo-rstr-newt.h
r541 r1295 137 137 struct raidlist_itself *); 138 138 void edit_raidrec_additional_vars(struct raid_device_record *); 139 int evaluate_drive_within_mountlist(struct mountlist_itself *, char *,140 char *);141 139 int evaluate_mountlist(struct mountlist_itself *, char *, char *, char *); 142 140 int find_device_in_mountlist(struct mountlist_itself *, char *); -
branches/2.2.2/mondo/src/restore-scripts/mondo/label-partitions-as-necessary
r901 r1295 7 7 8 8 read_partition_line() { 9 local tmp label mountpt mountline command format 10 if [ "`echo "$1" | grep "LABEL="`" != "" ] ; then 9 local tmp label mountpt command format 10 11 if [ "`echo "$1" | grep -E 'LABEL='`" != "" ] ; then 12 opttun="-L" 13 elif [ "`echo "$1" | grep -E 'UUID='`" != "" ] ; then 14 opttun="-U" 15 else 16 # Nothing to do 17 return 18 fi 19 11 20 tmp=`echo "$1" | tr -s ' ' '\t' | cut -f1` 12 21 label=`echo "$tmp" | cut -d'=' -f2` 13 22 format=`echo "$1" | tr -s ' ' '\t' | cut -f3` 14 mountline=`mount | grep " $label "` 15 # mountpt=`echo "$mountline" | cut -d' ' -f1` 16 ! mountpt=`grep " $label " $mountlist | cut -d' ' -f1` 17 if [ ! "$mountpt" ] ; then 18 LogIt "Not labeling anything as $label because $mountpt is not a mountpoint" 19 elif [ ! "$label" ] ; then 20 LogIt "Not labeling $mountpt as anything because $label is not a label" 21 else 22 if [ "$format" = "ext2" ] || [ "$format" = "ext3" ] ; then 23 command="e2label $mountpt $label" 24 LogIt "Running $command" 25 $command 26 elif [ "$format" = "swap" ] ; then 27 command="mkswap -L $label $mountpt" 28 LogIt "Running $command" 29 else 30 LogIt "I am NOT going to run e2label: the partition is format '$format', which doesn't like e2label anyway" 31 fi 23 mountpt=`grep -w " $label" $mountlist | cut -d' ' -f1` 24 if [ ! "$mountpt" ] ; then 25 LogIt "Not labeling anything as $label because $mountpt is not a mountpoint" 26 elif [ ! "$label" ] ; then 27 LogIt "Not labeling $mountpt as anything because $label is not a label" 28 else 29 if [ "$format" = "ext2" ] || [ "$format" = "ext3" ] ; then 30 command="tune2fs $opttun $label $mountpt" 31 LogIt "Running $command" 32 $command 33 elif [ "$format" = "swap" ] ; then 34 if [ "$opttun" = "-U" ]; then 35 echo "Unable yet to identify swap with UUID" 36 else 37 command="mkswap $opttun $label $mountpt" 38 LogIt "Running $command" 39 $command 40 fi 41 else 42 LogIt "I am NOT going to run tune2fs: the partition is format '$format', which doesn't like tune2fs anyway" 43 fi 32 44 fi 33 fi34 45 } 35 36 46 37 47 38 48 # --------------------------------------------- 39 49 40 LogIt " Labeling your drives with e2label"50 LogIt "Identifying your drives with tune2fs" 41 51 if [ "$#" -ne "1" ] ; then 42 52 LogIt "label-partitions-as-necessary /tmp/mountlist.txt < /tmp/fstab.new" 1
Note:
See TracChangeset
for help on using the changeset viewer.