Changeset 611 in MondoRescue
- Timestamp:
- Jun 2, 2006, 11:48:53 PM (18 years ago)
- Location:
- branches/2.0.8
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0.8/mindi/README.pxe
r576 r611 1 $Id$ 2 1 3 README for mondo/mindi usage with PXE 2 4 … … 9 11 label mondo 10 12 kernel vmlinuz-mondo 11 append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=36864 rw root=/dev/ram iso_mode acpi=off apm=off devfs=nomount exec-shield=0 pxe [prefix="machine"] [ipconf=(ipadr:netmask:broadcast:gateway|dhcp)] [ping=#] ... 13 append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=36864 rw root=/dev/ram iso_mode acpi=off apm=off devfs=nomount exec-shield=0 pxe [prefix="machine"] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [ping=#] ... 14 15 ipdev is the device name (e.g. eth2) 16 ipadr is the IP Address (e.g. 192.168.1.1) 17 netmask is the Netmask (e.g. 255.255.255.0) 18 broadcast is the Network broadcast (e.g. 192.168.1.255) 19 gateway is the default gateway (e.g. 192.168.1.254) 20 dhcp is a keyword. Using it will provide all the previous 4 values to activate the LAN interface. 12 21 13 22 The initrd and kernel file come rom the first bootable media … … 25 34 Without prefix keyword, the name of the images used during archiving with the -p option will be used (they may differ). If -p wasn't used then the name mondorescue-1.iso, ... will be used. 26 35 27 During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media. You may alter the IP configuration stored from the original machine by passing the ipconf option describing respectively the IP address, netmask, broadcast and default gateway you want to setup for the machine, separated by ':'. Or alternatively, you may specify the dhcp keyword so that a D hCP request is made to get those information. On some configurations, you may also want to increase the number of ping queries made before the NFS mount, which is of 3 by default, using the ping option and give the number you want.36 During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media. You may alter the IP configuration stored from the original machine by passing the ipconf option describing respectively the IP address, netmask, broadcast and default gateway you want to setup for the machine, separated by ':'. Or alternatively, you may specify the dhcp keyword so that a DHCP request is made to get those information. In the 2 cases, you have to mention on which physical interface those parameters should apply. On some configurations, you may also want to increase the number of ping queries made before the NFS mount, which is of 3 by default, using the ping option and give the number you want. 28 37 29 38 Please report any problem around that tool to bruno@mondorescue.org 30 39 40 2006-06-02 ipdev added to allow redeployment on another interface 31 41 2005-12-18 new ipconf and ping option 32 42 2005-12-14 detailed explanations on where to find initrd and kernel -
branches/2.0.8/mindi/mindi
r586 r611 1314 1314 1315 1315 if [ -d "/proc/lvm" ] || [ -d "/dev/mapper" ]; then 1316 echo -en "\rAnalyzing LVM...\r"1317 all_partitions=`$MINDI_LIB/analyze-my-lvm | fgrep ">>>" | cut -d' ' -f2-32`1316 echo -en "\rAnalyzing LVM...\r" 1317 all_partitions=`$MINDI_LIB/analyze-my-lvm | fgrep ">>>" | cut -d' ' -f2-32` 1318 1318 fi 1319 1319 all_partitions="$all_partitions `ListAllPartitions 2> /dev/null`" … … 1326 1326 for c_p in $all_partitions ; do 1327 1327 # echo "c_p = $c_p" > /dev/stderr 1328 [ "`echo "/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw" | fgrep "$c_p"`" != "" ] || [ "`echo "$c_p" | fgrep "/dev/scd"`" != "" ] || [ "`echo "$c_p" | fgrep "/dev/ram"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | fgrep ":/"`" != "" ] && continue1328 [ "`echo "/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw" | fgrep "$c_p"`" != "" ] || [ "`echo "$c_p" | fgrep "/dev/scd"`" != "" ] || [ "`echo "$c_p" | fgrep "/dev/ram"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | fgrep ":/"`" != "" ] && continue 1329 1329 [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$c_p"`" ] && continue 1330 [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue1331 if [ -h "$c_p" ] && [ "`echo "$c_p" | fgrep "/dev/hd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/sd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/md"`" = "" ] ; then1332 current_partition=`ResolveSoftlink $c_p`1333 [ "`echo "$current_partition" | fgrep "/dev/mapper"`" != "" ] && current_partition="$c_p"1334 [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$current_partition"`" ] && continue1335 else1336 current_partition="$c_p"1337 fi1338 [ "$c_p" = "none" ] && continue1339 absolute_partition=`ResolveSoftlink $c_p`1340 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`1341 1342 # This part tries to retrieve the correct device from a LABEL line in /etc/fstab1343 # current_partition contains only first column of /etc/fstab1344 if [ "`echo "$current_partition" | /bin/grep -f -i "LABEL="`" != "" ]; then1345 str_to_find_fmt_with=$current_partition1346 redhat_label=`echo "$current_partition" | /bin/cut -d'=' -f2`1347 actual_dev=""1348 1330 [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue 1331 if [ -h "$c_p" ] && [ "`echo "$c_p" | fgrep "/dev/hd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/sd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/md"`" = "" ] ; then 1332 current_partition=`ResolveSoftlink $c_p` 1333 [ "`echo "$current_partition" | fgrep "/dev/mapper"`" != "" ] && current_partition="$c_p" 1334 [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$current_partition"`" ] && continue 1335 else 1336 current_partition="$c_p" 1337 fi 1338 [ "$c_p" = "none" ] && continue 1339 absolute_partition=`ResolveSoftlink $c_p` 1340 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1` 1341 1342 # This part tries to retrieve the correct device from a LABEL line in /etc/fstab 1343 # current_partition contains only first column of /etc/fstab 1344 if [ "`echo "$current_partition" | /bin/grep -i "LABEL="`" != "" ]; then 1345 str_to_find_fmt_with=$current_partition 1346 redhat_label=`echo "$current_partition" | /bin/cut -d'=' -f2` 1347 actual_dev="" 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" ] 1356 actual_dev=`/bin/mount -l | /bin/grep " [$redhat_label]" | /bin/cut -d' ' -f1`1355 if [ "x$actual_dev" = "x" ]; then 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 -
branches/2.0.8/mondo/mondo/common/libmondo-files.c
r415 r611 1279 1279 fprintf(fout, "done\n"); 1280 1280 fprintf(fout, "ifconfig lo 127.0.0.1 # config loopback\n"); 1281 fprintf(fout, "ipdev=%s\n", nfs_dev); 1281 1282 fprintf(fout, "ipaddress=%s\n", nfs_client_ipaddr); 1282 1283 fprintf(fout, "ipnetmask=%s\n", nfs_client_netmask); … … 1287 1288 fprintf(fout, " echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2`\n"); 1288 1289 fprintf(fout, "done\n"); 1289 fprintf(fout, "if [ \"$ipconf\" = \"dhcp\" ]; then\n"); 1290 fprintf(fout, " udhcpc -i %s\n", nfs_dev); 1290 fprintf(fout, "grep -q \"dhcp\" \"$ipconf\"\n"); 1291 fprintf(fout, "if [ $? = 0 ]; then\n"); 1292 fprintf(fout, " ipdev=`echo $ipconf | cut -d: -f1`\n"); 1293 fprintf(fout, " udhcpc -i $ipdev\n", ); 1291 1294 fprintf(fout, "else\n"); 1292 1295 fprintf(fout, " if [ \"$ipconf\" != \"\" ]; then\n"); 1293 fprintf(fout, " ipaddress=`echo $ipconf | cut -d: -f1`\n"); 1294 fprintf(fout, " ipnetmask=`echo $ipconf | cut -d: -f2`\n"); 1295 fprintf(fout, " ipbroadcast=`echo $ipconf | cut -d: -f3`\n"); 1296 fprintf(fout, " ipgateway=`echo $ipconf | cut -d: -f4`\n"); 1296 fprintf(fout, " ipdev=`echo $ipconf | cut -d: -f1`\n"); 1297 fprintf(fout, " ipaddress=`echo $ipconf | cut -d: -f2`\n"); 1298 fprintf(fout, " ipnetmask=`echo $ipconf | cut -d: -f3`\n"); 1299 fprintf(fout, " ipbroadcast=`echo $ipconf | cut -d: -f4`\n"); 1300 fprintf(fout, " ipgateway=`echo $ipconf | cut -d: -f5`\n"); 1297 1301 fprintf(fout, " fi\n"); 1298 fprintf(fout, " ifconfig %s $ipaddress netmask $ipnetmask broadcast $ipbroadcast\n", nfs_dev);1302 fprintf(fout, " ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast $ipbroadcast\n"); 1299 1303 fprintf(fout, " route add default gw $ipgateway\n"); 1300 1304 fprintf(fout, "fi\n"); -
branches/2.0.8/mondo/mondo/mondorestore/mondo-restore.c
r576 r611 3157 3157 "to the Mondo mailing list when you are seeking technical "); 3158 3158 log_msg(0, 3159 "support. Without it, we can't help you. - Hugo");3159 "support. Without it, we can't help you. - DevTeam"); 3160 3160 log_msg(0, 3161 3161 "------------------------------------------------------------");
Note:
See TracChangeset
for help on using the changeset viewer.