Changeset 2380 in MondoRescue
- Timestamp:
- Sep 9, 2009, 8:30:47 PM (16 years ago)
- Location:
- branches/2.2.9
- Files:
-
- 27 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi/README.pxe
r2191 r2380 11 11 label mondo 12 12 kernel vmlinuz-mondo 13 append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=131072 rw root=/dev/ram iso acpi=off apm=off devfs=nomount exec-shield=0 pxe [pr efix=machine] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [nfsmount=server:mountpoint] [nfspath=local_path] [ping=#] ...13 append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=131072 rw root=/dev/ram iso acpi=off apm=off devfs=nomount exec-shield=0 pxe [proto=nfs|sshfs] [prefix=machine] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [netfsmount=server:mountpoint] [netfspath=local_path] [ping=#] ... 14 14 15 15 ipdev is the device name (e.g. eth2) … … 19 19 gateway is the default gateway (e.g. 192.168.1.254) 20 20 dhcp is a keyword. Using it will provide all the previous 4 values to activate the LAN interface. 21 server is the ip addr of the NFS server 22 mountpoint is the mount point on the NFS server to use (should be in /etc/exports of the NFS server) 21 proto is the protocol to use for mounting the remote share (default is NFS, sshfs is also available) 22 server is the ip addr of the Remote Network server 23 mountpoint is the mount point on the Remote Network server to use (if NFS, should be in /etc/exports of the NFS server) 24 netfsmount is the server and mountpoint on which the ISO is available, if different from the one at backup time. For SSHFS the server part can be of the form user@server. 25 netfspath is the local path on the remote server where the image is located, if different from the one at backup time. 23 26 local_path is the local directory under which the mage was made (with the -d option) 24 27 rmadisk_size may have to be increase to 131072 on more recent distributions such as rhel 5 … … 40 43 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. 41 44 42 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. If you have a different NFS server for the deployment than for the archiving, you can also precise it through the n fsmount option. The structure on both server under the mountpoint has to be the same.45 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. If you have a different NFS server for the deployment than for the archiving, you can also precise it through the netfsmount option. The structure on both server under the mountpoint has to be the same. 43 46 44 47 CAVEAT: the limit to the number of char on the append line is 255. Use symlinks to reduce the size of your path if needed. … … 46 49 Please report any problem around that tool to bruno@mondorescue.org 47 50 51 2009-09-09 Changed to netfs for multi protocol support (nfs, sshfs, ...) 48 52 2009-05-07 nfspath added to allow redeployment from another NFS directory 49 53 2006-06-10 nfsmount added to allow redeployment from another NFS server -
branches/2.2.9/mindi/deplist.txt
r2222 r2380 46 46 /bin/mount 47 47 /sbin/mount.nfs /sbin/mount.nfs4 48 /sbin/mount.fuse 48 /usr/bin/sshfs 49 /sbin/mount.fuse /usr/bin/fusermount /usr/bin/ulockmgr_server 49 50 /sbin/mount.cifs /sbin/mount.cifs3 50 51 /sbin/mount.smb /sbin/mount.smb3 -
branches/2.2.9/mindi/mindi
r2344 r2380 57 57 PCMCIA_MODS="pcmcia_core ds yenta_socket" 58 58 USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage input hid uhci_hcd ehci_hcd uhci-hcd ehci-hcd ohci-hcd ohci_hcd usbkbd usbhid keybdev mousedev libusual scsi_mod ff-memless" 59 NET_MODS="sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 bnx2 e1000 e1000e igb eepro100 ne2k-pci tg3 libphy pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmnet exportfs "59 NET_MODS="sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 bnx2 e1000 e1000e igb eepro100 ne2k-pci tg3 libphy pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmnet exportfs fuse" 60 60 CDROM_MODS="$TAPE_MODS $IDE_MODS $USB_MODS $PCMCIA_MODS $SCSI_MODS $NET_MODS af_packet cdrom isocd isofs inflate_fs nls_iso8859-1 nls_base nls_cp437 nls_utf8 sg sr_mod zlib_inflate iso9660" 61 61 # Those modules will only go on the backup media, not the boot media. 62 EXTRA_MODS="$CDROM_MODS vfat fat loop md-mod linear raid0 raid1 xor raid10 raid5 raid456 lvm-mod dm-mod dm_mod dm-snapshot dm_snapshot dm-zero dm_zero dm-mirror dm_mirror dm-multipath dm-round-robin dm-emc dm-hp-sw dm-rdac multipath jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache ext4 jbd2 crc16 fuse"62 EXTRA_MODS="$CDROM_MODS vfat fat loop md-mod linear raid0 raid1 xor raid10 raid5 raid456 lvm-mod dm-mod dm_mod dm-snapshot dm_snapshot dm-zero dm_zero dm-mirror dm_mirror dm-multipath dm-round-robin dm-emc dm-hp-sw dm-rdac multipath jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache ext4 jbd2 crc16" 63 63 # Replace with that line for HP OCMP e.g. 64 64 #DENY_MODS="MPS_Driver_Mapper mps octtldrv tscttl streams kqemu fdomain" … … 592 592 fi 593 593 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW." 594 if [ -e "$MINDI_TMP/N FS-DEV" ] ; then595 LogIt "\nIncorporating N FS-related settings"596 for r in N FS-* ISO-PREFIX ; do594 if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then 595 LogIt "\nIncorporating Network-related settings" 596 for r in NETFS-* ISO-PREFIX ; do 597 597 cp -f $MINDI_TMP/$r $bigdir/tmp 2>> $LOGFILE || Die "Cannot copy $r - did you run out of disk space?" 598 598 echo "Copying $r to ramdisk" >> $LOGFILE … … 920 920 echo "datestamp `date`" >> $outfile 921 921 [ "$ESTIMATED_TOTAL_NOOF_SLICES" ] && echo "total-slices $ESTIMATED_TOTAL_NOOF_SLICES" >> $outfile 922 AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-IPADDR nfs-client-ipaddr $outfile 923 AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-NETMASK nfs-client-netmask $outfile 924 AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-BROADCAST nfs-client-broadcast $outfile 925 AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-DEFGW nfs-client-defgw $outfile 926 AddFileToCfgIfExists $MINDI_TMP/NFS-SERVER-MOUNT nfs-server-mount $outfile 927 AddFileToCfgIfExists $MINDI_TMP/NFS-SERVER-PATH nfs-server-path $outfile 928 AddFileToCfgIfExists $MINDI_TMP/NFS-DEV nfs-dev $outfile 929 AddFileToCfgIfExists $MINDI_TMP/NFS-SERVER-IPADDR nfs-server-ipaddr $outfile 922 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-IPADDR netfs-client-ipaddr $outfile 923 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-NETMASK netfs-client-netmask $outfile 924 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-BROADCAST netfs-client-broadcast $outfile 925 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-DEFGW netfs-client-defgw $outfile 926 AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-MOUNT netfs-server-mount $outfile 927 AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-PATH netfs-server-path $outfile 928 AddFileToCfgIfExists $MINDI_TMP/NETFS-DEV netfs-dev $outfile 929 AddFileToCfgIfExists $MINDI_TMP/NETFS-PROTO netfs-proto $outfile 930 AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-IPADDR netfs-server-ipaddr $outfile 930 931 AddFileToCfgIfExists $MINDI_TMP/ISO-DEV iso-dev $outfile 931 932 AddFileToCfgIfExists $MINDI_TMP/ISO-MNT iso-mnt $outfile … … 1508 1509 if [ _"$MONDO_SHARE" != _"" ]; then 1509 1510 if [ "$CDRECOVERY" != "yes" ] ; then 1510 if [ -e "$MINDI_TMP/N FS-DEV" ] ; then1511 if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then 1511 1512 echo -en "Press <enter> to continue.\n" 1512 1513 elif [ ! "$MINDI_TMP" ] ; then … … 1551 1552 # In case it's mondoarchive 1552 1553 elif [ _"$MONDO_SHARE" != _"" ]; then 1553 if [ -e "$MINDI_TMP/N FS-DEV" ] ; then1554 if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then 1554 1555 echo -en "default${sep}iso\n" 1555 1556 else … … 2341 2342 list_of_groovy_mods="$CDROM_MODS $FORCE_MODS" 2342 2343 2343 if [ -e "$MINDI_TMP/N FS-DEV" ] ; then2344 if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then 2344 2345 # For PXE boot 2345 2346 list_of_groovy_mods="$list_of_groovy_mods $NET_MODS" -
branches/2.2.9/mindi/rootfs/sbin/init
r2353 r2380 719 719 fi 720 720 if [ "`grep -i pxe /proc/cmdline`" ] || [ "`grep -i net /proc/cmdline`" ]; then 721 # We need to get here exported variables from start-n fs722 . /sbin/start-n fs721 # We need to get here exported variables from start-netfs 722 . /sbin/start-netfs 723 723 fi 724 724 … … 732 732 ExtractDataDisksAndLoadModules 733 733 # Fake the conf file to force it to NFS mode, even if we made originally a CD (mandatory for mondorestore to work correctly) 734 sed -i "s/backup-media-type.*/backup-media-type n fs/" /tmp/mondo-restore.cfg734 sed -i "s/backup-media-type.*/backup-media-type netfs/" /tmp/mondo-restore.cfg 735 735 elif [ "`grep -i usb= /proc/cmdline`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg 2>/dev/null | grep media-type`" ]; then 736 736 . /sbin/start-usb … … 743 743 HandleCDROM 744 744 ExtractDataDisksAndLoadModules 745 # We need to get here exported variables from start-n fs746 . /sbin/start-n fs745 # We need to get here exported variables from start-netfs 746 . /sbin/start-netfs 747 747 fi 748 748 res=$? … … 843 843 LogIt "backup-media-type is specified in config file - great." 844 844 LogIt "Calling post-init" 845 # start-n fs moved it under /tmp as the NFS share is already unmounted845 # start-netfs moved it under /tmp as the NFS share is already unmounted 846 846 if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then 847 847 post=`echo $pre | sed 's|^/tmp/isodir|/tmp|'` … … 861 861 echo $i | grep -qi post= && post=`echo $i | cut -d= -f2` 862 862 done 863 # start-n fs moved it under /tmp as the NFS share is already unmounted863 # start-netfs moved it under /tmp as the NFS share is already unmounted 864 864 if [ "`echo $post | grep -E '^/tmp/isodir'`" ]; then 865 865 post=`echo $post | sed 's|^/tmp/isodir|/tmp|'` -
branches/2.2.9/mindi/rootfs/sbin/start-netfs
r2377 r2380 3 3 # $Id$ 4 4 # 5 # This script sets up the network + N FS environment if needed.5 # This script sets up the network + Network FS environment if needed. 6 6 # 7 7 … … 11 11 12 12 # Get info from config file 13 ipdev=`grep nfs-dev /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 14 ipaddress=`grep nfs-client-ipaddr /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 15 ipnetmask=`grep nfs-client-netmask /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 16 ipbroadcast=`grep nfs-client-broadcast /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 17 ipgateway=`grep nfs-client-defgw /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 13 ipdev=`grep netfs-dev /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 14 ipaddress=`grep netfs-client-ipaddr /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 15 ipnetmask=`grep netfs-client-netmask /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 16 ipbroadcast=`grep netfs-client-broadcast /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 17 ipgateway=`grep netfs-client-defgw /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 18 proto=`grep netfs-proto /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 18 19 ipconf="" 19 20 pre="" 20 21 post="" 21 export n fsmount=`grep nfs-server-mount /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`22 export netfsmount=`grep netfs-server-mount /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 22 23 export imgname=`grep iso-prefix /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 23 24 if [ "$imgname" = "" ]; then 24 25 export imgname="mondorescue" 25 26 fi 26 export dirimg=`grep n fs-server-path /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`27 export dirimg=`grep netfs-server-path /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 27 28 if [ "$dirimg" = "" ]; then 28 29 export dirimg="/" … … 33 34 echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2` 34 35 echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2` 35 echo $i | grep -qi n fsmount= && export nfsmount=`echo $i | cut -d= -f2`36 echo $i | grep -qi netfsmount= && export netfsmount=`echo $i | cut -d= -f2` 36 37 echo $i | grep -qi prefix= && export imgname=`echo $i | cut -d= -f2` 37 echo $i | grep -qi n fspath= && export dirimg=`echo $i | cut -d= -f2`38 echo $i | grep -qi netfspath= && export dirimg=`echo $i | cut -d= -f2` 38 39 echo $i | grep -qi pre= && pre=`echo $i | cut -d= -f2` 39 40 echo $i | grep -qi post= && post=`echo $i | cut -d= -f2` 41 echo $i | grep -qi proto= && proto=`echo $i | cut -d= -f2` 40 42 done 41 43 … … 67 69 68 70 # ping server helps waking interface up 69 LogIt "Pinging NFSserver..."70 n fs_server_ipaddr=`echo $nfsmount | cut -d: -f1`71 ping -c $ipcount $n fs_server_ipaddr71 LogIt "Pinging Remote server..." 72 netfs_server_ipaddr=`echo $netfsmount | cut -d: -f1 | cut -d@ -f2` 73 ping -c $ipcount $netfs_server_ipaddr 72 74 73 # Finally mounts the NFS share 74 LogIt "Mounting NFS share ($nfsmount) on /tmp/isodir..." 75 touch /etc/mtab 76 mount -t nfs -o nolock,ro $nfsmount /tmp/isodir 75 # Which is our protocol for file sharing 76 if [ "$proto" = "" ]; then 77 LogIt "No protocol specified, defaulting to NFS" 78 $proto = "nfs" 79 fi 80 81 if [ "$proto" = "sshfs" ]; then 82 LogIt "Mounting SSHFS share ($netfsmount) on /tmp/isodir..." 83 sshfs -o ro $netfsmount /tmp/isodir 84 elif [ "$proto" != "" ]; then 85 LogIt "Mounting Network share ($netfsmount) on /tmp/isodir..." 86 touch /etc/mtab 87 mount -t $proto -o nolock,ro $netfsmount /tmp/isodir 88 else 89 LogIt "Unknown protocol $proto" 90 fi 77 91 78 LogIt "Mounting NFSimage ${imgname}-1.iso in $dirimg on /mnt/cdrom in loopback"92 LogIt "Mounting Remote image ${imgname}-1.iso in $dirimg on /mnt/cdrom in loopback" 79 93 mount -o ro,loop -t iso9660 /tmp/isodir/$dirimg/${imgname}-1.iso /mnt/cdrom 80 94 81 # Save the scripts on the N FSshare locally95 # Save the scripts on the Network share locally 82 96 if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then 83 97 cp $pre /tmp -
branches/2.2.9/mondo-doc/mondoarchive.8
r2342 r2380 119 119 .TP 120 120 .BI "-n " mount 121 Use files residing on NFS partitionas backup media.121 Use files residing on a remote share as backup media. 122 122 .I mount 123 is the remote mount-point, e.g. ' 192.168.1.3:/home/nfs'123 is the remote mount-point, e.g. 'nfs://192.168.1.3:/home/nfs' 124 124 for my file server. If not mounted, mondoarchive will do it for you. So nice ;-) 125 125 If your NFS server only accept write from a backup user, you may specify it with the syntax: 126 .B user@machine:/mount/path126 .B nfs://user@machine:/mount/path 127 127 and mondoarchive will try to do its best to support it. 128 Other protocols are available such as sshfs for fuse SSH based filesystem 129 mount, with the same syntax e.g. 'sshfs://user@192.168.1.3:/home/nfs' 128 130 129 131 .TP … … 422 424 Backup to an NFS mount: 423 425 .br 424 .I "mondoarchive -On 192.168.1.2:/home/nfs -d /Monday -E /mnt/nfs"426 .I "mondoarchive -On nfs://192.168.1.2:/home/nfs -d /Monday -E /mnt/nfs" 425 427 426 428 Verify existing NFS backup:- 427 429 .br 428 .I "mondoarchive -Vn 192.168.1.2:/home/nfs -d /Monday"430 .I "mondoarchive -Vn nfs://192.168.1.2:/home/nfs -d /Monday" 429 431 430 432 .BI USB: -
branches/2.2.9/mondo-doc/mondorescue-howto.sgml
r2087 r2380 560 560 <row> 561 561 <entry> 562 bash# mount 192.168.1.28:/home/nfs /mnt/nfs562 bash# mount nfs://192.168.1.28:/home/nfs /mnt/nfs 563 563 </entry> 564 564 </row> 565 565 <row> 566 566 <entry> 567 bash# mondoarchive -OVn192.168.1.28:/home/nfs -gF[...]567 bash# mondoarchive -OVn nfs://192.168.1.28:/home/nfs -gF[...] 568 568 </entry> 569 569 </row> … … 1508 1508 <entry> 1509 1509 1510 bash# mount 192.168.1.3:/home/nfs -t nfs /mnt/nfs1510 bash# mount nfs://192.168.1.3:/home/nfs -t nfs /mnt/nfs 1511 1511 </entry> 1512 1512 </row> 1513 1513 <row> 1514 1514 <entry> 1515 bash# mondoarchive -OVn 192.168.1.3:/home/nfs -g -s 200m1515 bash# mondoarchive -OVn nfs://192.168.1.3:/home/nfs -g -s 200m 1516 1516 </entry> 1517 1517 </row> … … 3119 3119 <entry> 3120 3120 3121 bash# mondoarchive -On192.168.1.3:/home/nfs3121 bash# mondoarchive -On nfs://192.168.1.3:/home/nfs 3122 3122 3123 3123 </entry> -
branches/2.2.9/mondo-doc/mondorestore.8
r2294 r2380 62 62 Use files residing on NFS partition as restore media. 63 63 .I mount 64 is the remote mount-point, e.g. '192.168.1.3:/home/nfs'64 is the remote mount-point, e.g. nfs://192.168.1.3:/home/nfs' 65 65 for my file server. Please mount it before restoring/verifying. 66 66 -
branches/2.2.9/mondo/src/common/libmondo-archive.c
r2309 r2380 787 787 mr_asprintf(&value, "iso"); 788 788 break; 789 case n fs:790 mr_asprintf(&value, "n fs");789 case netfs: 790 mr_asprintf(&value, "netfs"); 791 791 break; 792 792 case dvd: … … 858 858 estimated_total_noof_slices = 859 859 size_of_all_biggiefiles_K(bkpinfo) / bkpinfo->optimal_set_size + 1; 860 /* add n fs stuff here? */860 /* add netfs stuff here? */ 861 861 mr_asprintf(&command, "mkdir -p %s/images", bkpinfo->scratchdir); 862 862 if (system(command)) { … … 1262 1262 1263 1263 sprintf(command, "rm -f %s/%s/%s-[1-9]*.iso", bkpinfo->isodir, 1264 bkpinfo->n fs_remote_dir, bkpinfo->prefix);1264 bkpinfo->netfs_remote_dir, bkpinfo->prefix); 1265 1265 paranoid_system(command); 1266 1266 wipe_archives(bkpinfo->scratchdir); … … 3286 3286 * - @c manual_cd_tray 3287 3287 * - @c media_size 3288 * - @c n fs_mount3289 * - @c n fs_remote_dir3288 * - @c netfs_mount 3289 * - @c netfs_remote_dir 3290 3290 * - @c scratchdir 3291 3291 * - @c verify_data … … 3363 3363 } 3364 3364 sprintf(isofile, "%s/%s/%s-%d.iso", bkpinfo->isodir, 3365 bkpinfo->n fs_remote_dir, bkpinfo->prefix,3365 bkpinfo->netfs_remote_dir, bkpinfo->prefix, 3366 3366 g_current_media_number); 3367 3367 for (that_one_was_ok = FALSE; !that_one_was_ok;) { -
branches/2.2.9/mondo/src/common/libmondo-cli.c
r2309 r2380 55 55 static void free_mounted_fs_list (void); 56 56 static int get_dsf_mount_list (const char *dsf, char **included_dsf_list, char **excluded_dsf_list); 57 static int create_list_of_non_N FS_mounted_file_systems (void);57 static int create_list_of_non_NETFS_mounted_file_systems (void); 58 58 static MOUNTED_FS_STRUCT *find_mount_point_in_list (char *mount_point); 59 59 static MOUNTED_FS_STRUCT *find_device_in_list (char *device); … … 178 178 /** 179 179 * Frees the memory for all of the structures on the linked list of 180 * all of the non-N FS mounted file systems.180 * all of the non-NETFS mounted file systems. 181 181 */ 182 182 static void free_mounted_fs_list (void) { … … 195 195 196 196 /** 197 * Creates a singly linked list of all of the non-N FS mounted file systems.197 * Creates a singly linked list of all of the non-NETFS mounted file systems. 198 198 * @param DSFptr A pointer to the structure MOUNTED_FS_STRUCT used to hold 199 199 * the list of mounted file systems. … … 213 213 214 214 /** 215 * Find the structure, in the singly linked list of all of the non-N FS215 * Find the structure, in the singly linked list of all of the non-NETFS 216 216 * mounted file systems, that contains the specified device. 217 217 * @param device The device to find … … 234 234 235 235 /** 236 * Find the structure, in the singly linked list of all of the non-N FS236 * Find the structure, in the singly linked list of all of the non-NETFS 237 237 * mounted file systems, that contains the specified mount point. 238 238 * @param mount_point The mount point to find … … 255 255 256 256 /** 257 * Creates a linked list of all of the non-N FS mounted file systems.257 * Creates a linked list of all of the non-NETFS mounted file systems. 258 258 * We use a linked list because we don't know how many mounted file 259 259 * there are (and there can be a lot). 260 260 * @return 0 on success and greated than 0 on failure. 261 261 */ 262 static int create_list_of_non_N FS_mounted_file_systems (void)262 static int create_list_of_non_NETFS_mounted_file_systems (void) 263 263 { 264 264 int i = 0; … … 388 388 389 389 /* Get a list of the mounted file systems */ 390 if (create_list_of_non_N FS_mounted_file_systems()) {390 if (create_list_of_non_NETFS_mounted_file_systems()) { 391 391 log_to_screen ("Could not get the list of mounted file systems"); 392 392 return (1); … … 992 992 993 993 if (flag_set['n']) { 994 strncpy(bkpinfo->n fs_mount, flag_val['n'], MAX_STR_LEN);994 strncpy(bkpinfo->netfs_mount, flag_val['n'], MAX_STR_LEN); 995 995 if (!flag_set['d']) { 996 strncpy(bkpinfo->nfs_remote_dir, "/", MAX_STR_LEN); 997 } 998 /* test if we specified a user for the NFS dialog */ 999 p = strchr(bkpinfo->nfs_mount, '@'); 996 strncpy(bkpinfo->netfs_remote_dir, "/", MAX_STR_LEN); 997 } 998 /* test for protocol */ 999 p = strchr(bkpinfo->netfs_mount, ':'); 1000 if (p == NULL) { 1001 /* protocol not found abort */ 1002 fatal_error("No protocol specified for remote share mount. Please do man mondoarchive as syntax changed"); 1003 } else { 1004 /* Proto found. Store the 2 values */ 1005 p++; 1006 if (*p != '/') { 1007 fatal_error("No protocol correctly specified for remote share mount. Use protocol://server:share"); 1008 } 1009 p++; 1010 if (*p != '/') { 1011 fatal_error("No protocol correctly specified for remote share mount. Use protocol://server:share"); 1012 } 1013 /* new netfs mount */ 1014 strcpy(tmp,p); 1015 p--; 1016 p--; 1017 p--; 1018 *p = '\0'; 1019 mr_asprintf(&q,"%s",bkpinfo->netfs_mount); 1020 bkpinfo->netfs_proto = q; 1021 strcpy(bkpinfo->netfs_mount,tmp); 1022 } 1023 /* test if we specified a user */ 1024 p = strchr(bkpinfo->netfs_mount, '@'); 1000 1025 if (p != NULL) { 1001 1026 /* User found. Store the 2 values */ 1002 1027 p++; 1003 /* new NFSmount */1028 /* new netfs mount */ 1004 1029 strcpy(tmp,p); 1005 1030 p--; 1006 1031 *p = '\0'; 1007 mr_asprintf(&q,"%s",bkpinfo->n fs_mount);1008 bkpinfo->n fs_user = q;1009 strcpy(bkpinfo->n fs_mount,tmp);1032 mr_asprintf(&q,"%s",bkpinfo->netfs_mount); 1033 bkpinfo->netfs_user = q; 1034 strcpy(bkpinfo->netfs_mount,tmp); 1010 1035 } 1011 1036 sprintf(tmp, "mount | grep -E \"^%s[/]* .*\" | cut -d' ' -f3", 1012 bkpinfo->n fs_mount);1037 bkpinfo->netfs_mount); 1013 1038 strncpy(bkpinfo->isodir, 1014 1039 call_program_and_get_last_line_of_output(tmp), 1015 1040 MAX_STR_LEN / 4); 1016 1041 if (strlen(bkpinfo->isodir) < 3) { 1017 log_to_screen("NFS share is not mounted. Trying to mount it for you.\n"); 1018 sprintf(tmp, "mount %s", bkpinfo->nfs_mount); 1042 log_to_screen("Network share is not mounted. Trying to mount it for you.\n"); 1043 if (strstr(bkpinfo->netfs_proto, "sshfs")) { 1044 sprintf(tmp, "sshfs %s", bkpinfo->netfs_mount); 1045 } else { 1046 sprintf(tmp, "mount %s", bkpinfo->netfs_mount); 1047 } 1019 1048 if (system(tmp)) { 1020 log_to_screen("Unable to mount N FS share %s. Please mount manually.\n", bkpinfo->nfs_mount);1049 log_to_screen("Unable to mount Network share %s. Please mount manually.\n", bkpinfo->netfs_mount); 1021 1050 retval++; 1022 1051 } else { 1023 1052 sprintf(tmp, "mount | grep -E \"^%s[/]* .*\" | cut -d' ' -f3", 1024 bkpinfo->n fs_mount);1053 bkpinfo->netfs_mount); 1025 1054 strncpy(bkpinfo->isodir, 1026 1055 call_program_and_get_last_line_of_output(tmp), … … 1028 1057 if (strlen(bkpinfo->isodir) < 3) { 1029 1058 retval++; 1030 log_to_screen("N FS share %s is strangely not mounted. Please mount manually...\n", bkpinfo->nfs_mount);1059 log_to_screen("Network share %s is strangely not mounted. Please mount manually...\n", bkpinfo->netfs_mount); 1031 1060 } 1032 1061 } 1033 1062 } 1034 log_msg(3, "mount = %s", bkpinfo->n fs_mount);1063 log_msg(3, "mount = %s", bkpinfo->netfs_mount); 1035 1064 log_msg(3, "isodir= %s", bkpinfo->isodir); 1036 1065 } … … 1046 1075 } 1047 1076 if (flag_set['n']) { 1048 bkpinfo->backup_media_type = n fs;1049 /* Never try to eject a N FSdevice */1077 bkpinfo->backup_media_type = netfs; 1078 /* Never try to eject a Network device */ 1050 1079 bkpinfo->please_dont_eject = TRUE; 1051 1080 } … … 1155 1184 } 1156 1185 1157 if ((flag_set['N']) && (! bkpinfo->restore_data)) // exclude N FSmounts & devices1186 if ((flag_set['N']) && (! bkpinfo->restore_data)) // exclude Network mounts & devices 1158 1187 { 1159 // strncpy(psz, list_of_NFS_devices_and_mounts(), MAX_STR_LEN); 1160 mr_asprintf(&psz, "%s", list_of_NFS_mounts_only()); 1188 mr_asprintf(&psz, "%s", list_of_NETFS_mounts_only()); 1161 1189 if (bkpinfo->exclude_paths[0]) { 1162 1190 strncat(bkpinfo->exclude_paths, " ", 4*MAX_STR_LEN); … … 1233 1261 } 1234 1262 1235 if (flag_set['d']) { /* backup directory (if ISO/N FS) */1263 if (flag_set['d']) { /* backup directory (if ISO/NETFS) */ 1236 1264 if (flag_set['i']) { 1237 1265 strncpy(bkpinfo->isodir, flag_val['d'], MAX_STR_LEN / 4); … … 1242 1270 } 1243 1271 } else if (flag_set['n']) { 1244 strncpy(bkpinfo->n fs_remote_dir, flag_val['d'], MAX_STR_LEN);1272 strncpy(bkpinfo->netfs_remote_dir, flag_val['d'], MAX_STR_LEN); 1245 1273 } else { /* backup device (if tape/CD-R/CD-RW) */ 1246 1274 strncpy(bkpinfo->media_device, flag_val['d'], MAX_STR_LEN / 4); … … 1249 1277 1250 1278 if ((flag_set['n']) && (! bkpinfo->restore_data)) { 1251 mr_asprintf(&tmp1,"%s/%s/.dummy.txt", bkpinfo->isodir,bkpinfo->n fs_remote_dir);1252 if ( bkpinfo->nfs_user) {1253 sprintf(tmp, "su - %s -c \"echo hi > %s\"", bkpinfo->n fs_user, tmp1);1279 mr_asprintf(&tmp1,"%s/%s/.dummy.txt", bkpinfo->isodir,bkpinfo->netfs_remote_dir); 1280 if ((bkpinfo->netfs_user) && (strstr(bkpinfo->netfs_proto,"nfs"))) { 1281 sprintf(tmp, "su - %s -c \"echo hi > %s\"", bkpinfo->netfs_user, tmp1); 1254 1282 } else { 1255 1283 sprintf(tmp, "echo hi > %s", tmp1); … … 1259 1287 sprintf(tmp, 1260 1288 "Are you sure directory '%s' exists in remote dir '%s'?\nIf so, do you have rights to write to it?\n", 1261 bkpinfo->n fs_remote_dir, bkpinfo->nfs_mount);1289 bkpinfo->netfs_remote_dir, bkpinfo->netfs_mount); 1262 1290 log_to_screen(tmp); 1263 1291 } -
branches/2.2.9/mondo/src/common/libmondo-devices-EXT.h
r1647 r2380 46 46 extern int eject_device(char *); 47 47 48 extern char *list_of_N FS_devices_and_mounts();49 extern char *list_of_N FS_mounts_only(void);48 extern char *list_of_NETFS_devices_and_mounts(); 49 extern char *list_of_NETFS_mounts_only(void); 50 50 51 51 extern void sensibly_set_tmpdir_and_scratchdir(); -
branches/2.2.9/mondo/src/common/libmondo-devices.c
r2368 r2380 54 54 */ 55 55 bool g_restoring_live_from_cd = FALSE; 56 bool g_restoring_live_from_n fs = FALSE;56 bool g_restoring_live_from_netfs = FALSE; 57 57 58 58 extern t_bkptype g_backup_media_type; // set by main() … … 179 179 strcpy(output, "cdstream"); 180 180 break; 181 case n fs:182 strcpy(output, "n fs");181 case netfs: 182 strcpy(output, "netfs"); 183 183 break; 184 184 case tape: … … 1376 1376 run_program_and_log_output(tmp, 5); 1377 1377 if (g_ISO_restore_mode || bkpinfo->backup_media_type == iso 1378 || bkpinfo->backup_media_type == n fs) {1378 || bkpinfo->backup_media_type == netfs) { 1379 1379 log_msg(3, "Remounting CD"); 1380 1380 g_ISO_restore_mode = TRUE; … … 1387 1387 (void)system(tmp); 1388 1388 sprintf(tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir, 1389 bkpinfo->n fs_remote_dir, bkpinfo->prefix,1389 bkpinfo->netfs_remote_dir, bkpinfo->prefix, 1390 1390 cd_number_i_want); 1391 1391 if (!does_file_exist(tmp)) { 1392 1392 sprintf(tmp, "%s/isodir/%s/%s-%d.iso", bkpinfo->tmpdir, 1393 bkpinfo->n fs_remote_dir, bkpinfo->prefix,1393 bkpinfo->netfs_remote_dir, bkpinfo->prefix, 1394 1394 cd_number_i_want); 1395 1395 if (does_file_exist(tmp)) { … … 1486 1486 bkpinfo->nonbootable_backup = FALSE; 1487 1487 1488 // Tape, CD, N FS, ...?1488 // Tape, CD, NETFS, ...? 1489 1489 srandom(getpid()); 1490 1490 bkpinfo->backup_media_type = … … 1726 1726 1727 1727 1728 case n fs:1729 /* Never try to eject a N FS device */1728 case netfs: 1729 /* Never try to eject a NETFS device */ 1730 1730 bkpinfo->please_dont_eject = TRUE; 1731 1731 1732 /* Initiate bkpinfo n fs_mount path from running environment if not already done */1733 if (!bkpinfo->n fs_mount[0]) {1734 strcpy(bkpinfo->n fs_mount,1732 /* Initiate bkpinfo netfs_mount path from running environment if not already done */ 1733 if (!bkpinfo->netfs_mount[0]) { 1734 strcpy(bkpinfo->netfs_mount, 1735 1735 call_program_and_get_last_line_of_output 1736 1736 ("mount | grep \":\" | cut -d' ' -f1 | head -n1")); … … 1743 1743 { 1744 1744 if (!popup_and_get_string 1745 ("N FSdir.",1745 ("Network shared dir.", 1746 1746 "Please enter path and directory where archives are stored remotely. (Mondo has taken a guess at the correct value. If it is incorrect, delete it and type the correct one.)", 1747 bkpinfo->n fs_mount, MAX_STR_LEN / 4)) {1747 bkpinfo->netfs_mount, MAX_STR_LEN / 4)) { 1748 1748 log_to_screen("User has chosen not to backup the PC"); 1749 1749 finish(1); … … 1758 1758 // check whether already mounted - we better remove 1759 1759 // surrounding spaces and trailing '/' for this 1760 strip_spaces(bkpinfo->n fs_mount);1761 if (bkpinfo->n fs_mount[strlen(bkpinfo->nfs_mount) - 1] == '/')1762 bkpinfo->n fs_mount[strlen(bkpinfo->nfs_mount) - 1] = '\0';1760 strip_spaces(bkpinfo->netfs_mount); 1761 if (bkpinfo->netfs_mount[strlen(bkpinfo->netfs_mount) - 1] == '/') 1762 bkpinfo->netfs_mount[strlen(bkpinfo->netfs_mount) - 1] = '\0'; 1763 1763 sprintf(command, "mount | grep \"%s \" | cut -d' ' -f3", 1764 bkpinfo->n fs_mount);1764 bkpinfo->netfs_mount); 1765 1765 strcpy(bkpinfo->isodir, 1766 1766 call_program_and_get_last_line_of_output(command)); … … 1788 1788 (void)system(command); 1789 1789 if (!popup_and_get_string 1790 ("N FS share", "Which remote NFSshare should I mount?",1791 bkpinfo->n fs_mount, MAX_STR_LEN)) {1790 ("Network share", "Which remote share should I mount?", 1791 bkpinfo->netfs_mount, MAX_STR_LEN)) { 1792 1792 log_to_screen("User has chosen not to backup the PC"); 1793 1793 finish(1); … … 1795 1795 } 1796 1796 /* Initiate bkpinfo isodir path from running environment if mount already done */ 1797 if (is_this_device_mounted(bkpinfo->n fs_mount)) {1797 if (is_this_device_mounted(bkpinfo->netfs_mount)) { 1798 1798 strcpy(bkpinfo->isodir, 1799 1799 call_program_and_get_last_line_of_output 1800 1800 ("mount | grep \":\" | cut -d' ' -f3 | head -n1")); 1801 1801 } else { 1802 sprintf(bkpinfo->isodir, "%s/n fsdir", bkpinfo->tmpdir);1802 sprintf(bkpinfo->isodir, "%s/netfsdir", bkpinfo->tmpdir); 1803 1803 sprintf(command, "mkdir -p %s", bkpinfo->isodir); 1804 1804 run_program_and_log_output(command, 5); 1805 1805 if (bkpinfo->restore_data) { 1806 mr_asprintf(&tmp, "mount -t nfs -o nolock,ro %s %s", bkpinfo->nfs_mount, bkpinfo->isodir); 1806 if (strstr(bkpinfo->netfs_proto, "sshfs")) { 1807 mr_asprintf(&tmp, "sshfs -o ro %s %s", bkpinfo->netfs_mount, bkpinfo->isodir); 1808 } else { 1809 mr_asprintf(&tmp, "mount -t %s -o nolock,ro %s %s", bkpinfo->netfs_proto, bkpinfo->netfs_mount, bkpinfo->isodir); 1810 } 1807 1811 } else { 1808 mr_asprintf(&tmp, "mount -t nfs -o nolock %s %s", bkpinfo->nfs_mount, bkpinfo->isodir); 1812 if (strstr(bkpinfo->netfs_proto, "sshfs")) { 1813 mr_asprintf(&tmp, "sshfs %s %s", bkpinfo->netfs_mount, bkpinfo->isodir); 1814 } else { 1815 mr_asprintf(&tmp, "mount -t %s -o nolock %s %s", bkpinfo->netfs_proto, bkpinfo->netfs_mount, bkpinfo->isodir); 1816 } 1809 1817 } 1810 1818 run_program_and_log_output(tmp, 3); … … 1814 1822 strcpy(g_selfmounted_isodir, bkpinfo->isodir); 1815 1823 } 1816 if (!is_this_device_mounted(bkpinfo->n fs_mount)) {1824 if (!is_this_device_mounted(bkpinfo->netfs_mount)) { 1817 1825 popup_and_OK 1818 1826 ("Please mount that partition before you try to backup to or restore from it."); 1819 1827 finish(1); 1820 1828 } 1821 strcpy(tmp1, bkpinfo->n fs_remote_dir);1829 strcpy(tmp1, bkpinfo->netfs_remote_dir); 1822 1830 if (!popup_and_get_string 1823 1831 ("Directory", "Which directory within that mountpoint?", tmp1, … … 1826 1834 finish(1); 1827 1835 } 1828 strcpy(bkpinfo->n fs_remote_dir, tmp1);1836 strcpy(bkpinfo->netfs_remote_dir, tmp1); 1829 1837 1830 1838 // check whether writable - we better remove surrounding spaces for this 1831 strip_spaces(bkpinfo->n fs_remote_dir);1839 strip_spaces(bkpinfo->netfs_remote_dir); 1832 1840 1833 1841 if (!popup_and_get_string … … 1843 1851 bkpinfo->media_size[i] = 650; 1844 1852 } 1845 log_msg(3, "Just set n fs_remote_dir to %s",1846 bkpinfo->n fs_remote_dir);1853 log_msg(3, "Just set netfs_remote_dir to %s", 1854 bkpinfo->netfs_remote_dir); 1847 1855 log_msg(3, "isodir is still %s", bkpinfo->isodir); 1848 1856 break; … … 1961 1969 finish(1); 1962 1970 } 1963 mr_asprintf(&tmp, "%s", list_of_N FS_mounts_only());1971 mr_asprintf(&tmp, "%s", list_of_NETFS_mounts_only()); 1964 1972 if (strlen(tmp) > 2) { 1965 1973 if (bkpinfo->exclude_paths[0]) { … … 2033 2041 2034 2042 if (bkpinfo->backup_media_type == iso 2035 || bkpinfo->backup_media_type == n fs) {2043 || bkpinfo->backup_media_type == netfs) { 2036 2044 g_ISO_restore_mode = TRUE; 2037 2045 } … … 2039 2047 // skip 2040 2048 #else 2041 if (bkpinfo->backup_media_type == n fs) {2042 log_msg(3, "I think the NFSmount is mounted at %s",2049 if (bkpinfo->backup_media_type == netfs) { 2050 log_msg(3, "I think the Remote mount is mounted at %s", 2043 2051 bkpinfo->isodir); 2044 2052 } 2045 2053 log_it("isodir = %s", bkpinfo->isodir); 2046 log_it("nfs_mount = '%s'", bkpinfo->nfs_mount); 2047 if (bkpinfo->nfs_user) { 2048 log_it("nfs_user = '%s'", bkpinfo->nfs_user); 2054 log_it("netfs_mount = '%s'", bkpinfo->netfs_mount); 2055 log_it("netfs_proto = '%s'", bkpinfo->netfs_proto); 2056 if (bkpinfo->netfs_user) { 2057 log_it("netfs_user = '%s'", bkpinfo->netfs_user); 2049 2058 } 2050 2059 #endif … … 2087 2096 */ 2088 2097 /** 2089 * Get a space-separated list of N FS devices and mounts.2098 * Get a space-separated list of NETFS devices and mounts. 2090 2099 * @return The list created. 2091 2100 * @note The return value points to static data that will be overwritten with each call. 2092 2101 */ 2093 char *list_of_N FS_devices_and_mounts(void)2102 char *list_of_NETFS_devices_and_mounts(void) 2094 2103 { 2095 2104 char *exclude_these_devices = NULL; … … 2097 2106 static char result_sz[1024]; 2098 2107 2099 mr_asprintf(&exclude_these_directories,"%s",list_of_N FS_mounts_only());2100 mr_asprintf(&exclude_these_devices,"%s", call_program_and_get_last_line_of_output("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs| nfs|nfs4|smbfs|cifs|afs|gfs|ocfs|ocfs2|mvfs|nsspool|nsvol) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));2108 mr_asprintf(&exclude_these_directories,"%s",list_of_NETFS_mounts_only()); 2109 mr_asprintf(&exclude_these_devices,"%s", call_program_and_get_last_line_of_output("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|sshfs|nfs|nfs4|smbfs|cifs|afs|gfs|ocfs|ocfs2|mvfs|nsspool|nsvol) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'")); 2101 2110 snprintf(result_sz, 1023, "%s %s", exclude_these_directories, exclude_these_devices); 2102 2111 mr_free(exclude_these_devices); … … 2109 2118 2110 2119 /** 2111 * Get a space-separated list of N FS mounts.2120 * Get a space-separated list of NETFS mounts. 2112 2121 * @return The list created. 2113 2122 * @note The return value points to static data that will be overwritten with each call. 2114 2123 * @bug Even though we only want the mounts, the devices are still checked. 2115 2124 */ 2116 char *list_of_N FS_mounts_only(void)2125 char *list_of_NETFS_mounts_only(void) 2117 2126 { 2118 2127 char *exclude_these_directories = NULL; 2119 2128 static char result_sz[512]; 2120 2129 2121 mr_asprintf(&exclude_these_directories,"%s", call_program_and_get_last_line_of_output("mount -t coda,ncpfs, nfs,nfs4,smbfs,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | tr -s '\t' ' ' | cut -d' ' -f3 | tr -s '\n' ' ' | awk '{print $0;}'"));2130 mr_asprintf(&exclude_these_directories,"%s", call_program_and_get_last_line_of_output("mount -t coda,ncpfs,fuse.sshfs,nfs,nfs4,smbfs,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | tr -s '\t' ' ' | cut -d' ' -f3 | tr -s '\n' ' ' | awk '{print $0;}'")); 2122 2131 snprintf(result_sz, 511, "%s", exclude_these_directories); 2123 2132 mr_free(exclude_these_directories); … … 2176 2185 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -t nonfs,msdosfs,ntfs,ntfs-3g,smbfs,smb,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'")); 2177 2186 #else 2178 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -x nfs -x nfs4 -x vfat -x ntfs -x ntfs-3g -x smbfs -x smb -x cifs -x afs -x gfs -x ocfs -x ocfs2 -x mvfs -x nsspool -x nssvol -x iso9660 | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));2187 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -x nfs -x nfs4 -x fuse.sshfs -x vfat -x ntfs -x ntfs-3g -x smbfs -x smb -x cifs -x afs -x gfs -x ocfs -x ocfs2 -x mvfs -x nsspool -x nssvol -x iso9660 | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'")); 2179 2188 #endif 2180 2189 … … 2606 2615 malloc_string(command); 2607 2616 malloc_string(fdisk); 2608 log_msg(0, "Looking for partition table format type");2609 2617 sprintf(fdisk, "/sbin/parted2fdisk"); 2610 log_msg(1, "Using %s", fdisk);2611 2618 sprintf(command, "%s -l %s | grep 'EFI GPT'", fdisk, drive); 2612 2619 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output(command)); -
branches/2.2.9/mondo/src/common/libmondo-devices.h
r1647 r2380 38 38 int eject_device(char *); 39 39 40 char *list_of_N FS_devices_and_mounts();41 char *list_of_N FS_mounts_only();40 char *list_of_NETFS_devices_and_mounts(); 41 char *list_of_NETFS_mounts_only(); 42 42 43 43 void sensibly_set_tmpdir_and_scratchdir(); -
branches/2.2.9/mondo/src/common/libmondo-files-EXT.h
r2053 r2380 33 33 extern long size_of_all_biggiefiles_K(); 34 34 extern void copy_mondo_and_mindi_stuff_to_scratchdir(); 35 extern void store_n fs_config();35 extern void store_netfs_config(); 36 36 37 37 -
branches/2.2.9/mondo/src/common/libmondo-files.c
r2242 r2380 1091 1091 1092 1092 /** 1093 * Store the client's N FS configuration in files to be restored at restore-time.1094 * Assumes that @c bkpinfo->media_type = n fs, but does not check for this.1093 * Store the client's NETFS configuration in files to be restored at restore-time. 1094 * Assumes that @c bkpinfo->media_type = netfs, but does not check for this. 1095 1095 * @param bkpinfo The backup information structure. Fields used: 1096 * - @c n fs_mount1097 * - @c n fs_remote_dir1096 * - @c netfs_mount 1097 * - @c netfs_remote_dir 1098 1098 * - @c tmpdir 1099 1099 */ 1100 void store_n fs_config()1100 void store_netfs_config() 1101 1101 { 1102 1102 1103 1103 /*@ buffers ******** */ 1104 char n fs_dev[MAX_STR_LEN];1104 char netfs_dev[MAX_STR_LEN]; 1105 1105 char mac_addr[MAX_STR_LEN]; 1106 char n fs_mount[MAX_STR_LEN];1107 char n fs_client_ipaddr[MAX_STR_LEN];1108 char n fs_client_netmask[MAX_STR_LEN];1109 char n fs_client_broadcast[MAX_STR_LEN];1110 char n fs_client_defgw[MAX_STR_LEN];1111 char n fs_server_ipaddr[MAX_STR_LEN];1106 char netfs_mount[MAX_STR_LEN]; 1107 char netfs_client_ipaddr[MAX_STR_LEN]; 1108 char netfs_client_netmask[MAX_STR_LEN]; 1109 char netfs_client_broadcast[MAX_STR_LEN]; 1110 char netfs_client_defgw[MAX_STR_LEN]; 1111 char netfs_server_ipaddr[MAX_STR_LEN]; 1112 1112 char tmp[MAX_STR_LEN]; 1113 1113 char command[MAX_STR_LEN * 2]; … … 1116 1116 char *p; 1117 1117 1118 log_it("Storing N FSconfiguration");1119 strcpy(tmp, bkpinfo->n fs_mount);1118 log_it("Storing Network configuration"); 1119 strcpy(tmp, bkpinfo->netfs_mount); 1120 1120 p = strchr(tmp, ':'); 1121 1121 if (!p) { 1122 1122 fatal_error 1123 ("N FSmount doesn't have a colon in it, e.g. 192.168.1.4:/home/nfs");1123 ("Network mount doesn't have a colon in it, e.g. 192.168.1.4:/home/nfs"); 1124 1124 } 1125 1125 *(p++) = '\0'; 1126 strcpy(n fs_server_ipaddr, tmp);1127 strcpy(n fs_mount, p);1126 strcpy(netfs_server_ipaddr, tmp); 1127 strcpy(netfs_mount, p); 1128 1128 1129 1129 /* BERLIOS : there is a bug #67 here as it only considers the first NIC */ 1130 1130 sprintf(command, 1131 1131 "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\n' | head -n1 | cut -d' ' -f1"); 1132 strcpy(n fs_dev, call_program_and_get_last_line_of_output(command));1132 strcpy(netfs_dev, call_program_and_get_last_line_of_output(command)); 1133 1133 sprintf(command, 1134 1134 "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f7 | cut -d':' -f2"); 1135 strcpy(n fs_client_ipaddr,1135 strcpy(netfs_client_ipaddr, 1136 1136 call_program_and_get_last_line_of_output(command)); 1137 1137 sprintf(command, 1138 1138 "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f9 | cut -d':' -f2"); 1139 strcpy(n fs_client_netmask,1139 strcpy(netfs_client_netmask, 1140 1140 call_program_and_get_last_line_of_output(command)); 1141 1141 sprintf(command, 1142 1142 "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f8 | cut -d':' -f2"); 1143 strcpy(n fs_client_broadcast,1143 strcpy(netfs_client_broadcast, 1144 1144 call_program_and_get_last_line_of_output(command)); 1145 1145 sprintf(command, 1146 1146 "route -n | grep '^0.0.0.0' | awk '{print $2}'"); 1147 strcpy(n fs_client_defgw,1147 strcpy(netfs_client_defgw, 1148 1148 call_program_and_get_last_line_of_output(command)); 1149 1149 sprintf(tmp, 1150 "n fs_client_ipaddr=%s; nfs_server_ipaddr=%s; nfs_mount=%s",1151 n fs_client_ipaddr, nfs_server_ipaddr, nfs_mount);1152 if (strlen(n fs_dev) < 2) {1150 "netfs_client_ipaddr=%s; netfs_server_ipaddr=%s; netfs_mount=%s", 1151 netfs_client_ipaddr, netfs_server_ipaddr, netfs_mount); 1152 if (strlen(netfs_dev) < 2) { 1153 1153 fatal_error 1154 ("Unable to find ethN (eth0, eth1, ...) adapter via N FSmount you specified.");1154 ("Unable to find ethN (eth0, eth1, ...) adapter via Network mount you specified."); 1155 1155 } 1156 1156 /******** 1157 * If the N FSdevice that found above is a bonded device,1157 * If the Network device that found above is a bonded device, 1158 1158 * we need to replace it with an ethN device or the 1159 * networking will not start during an N FSrestore.1159 * networking will not start during an Network restore. 1160 1160 * 1161 * If the N FS device in nfs_dev begins with the word "bond", or alb or aft1162 * look for the corresponding slave ethN device and copy it to n fs_dev.1161 * If the Network device in netfs_dev begins with the word "bond", or alb or aft 1162 * look for the corresponding slave ethN device and copy it to netfs_dev. 1163 1163 * Using the common MAC address 1164 1164 ********/ 1165 if (!strncmp(n fs_dev, "bond", 4) || !strncmp(nfs_dev, "alb", 3) || !strncmp(nfs_dev, "aft", 3)) {1166 log_to_screen("Found bonding device %s; looking for corresponding ethN slave device\n", n fs_dev);1165 if (!strncmp(netfs_dev, "bond", 4) || !strncmp(netfs_dev, "alb", 3) || !strncmp(netfs_dev, "aft", 3)) { 1166 log_to_screen("Found bonding device %s; looking for corresponding ethN slave device\n", netfs_dev); 1167 1167 sprintf(command, 1168 "ifconfig %s | awk '{print $5}' | head -n1", n fs_dev);1168 "ifconfig %s | awk '{print $5}' | head -n1", netfs_dev); 1169 1169 strcpy(mac_addr, call_program_and_get_last_line_of_output(command)); 1170 1170 sprintf(command, 1171 "ifconfig | grep -E '%s' | grep -v '%s' | head -n1 | cut -d' ' -f1", mac_addr,nfs_dev); 1172 strcpy(nfs_dev, call_program_and_get_last_line_of_output(command)); 1173 log_to_screen("Replacing it with %s\n", nfs_dev); 1174 } 1175 1176 sprintf(tmp, "%s/NFS-DEV", bkpinfo->tmpdir); 1177 write_one_liner_data_file(tmp, nfs_dev); 1178 1179 sprintf(tmp, "%s/NFS-CLIENT-IPADDR", bkpinfo->tmpdir); 1180 write_one_liner_data_file(tmp, nfs_client_ipaddr); 1181 sprintf(tmp, "%s/NFS-CLIENT-NETMASK", bkpinfo->tmpdir); 1182 write_one_liner_data_file(tmp, nfs_client_netmask); 1183 sprintf(tmp, "%s/NFS-CLIENT-BROADCAST", bkpinfo->tmpdir); 1184 write_one_liner_data_file(tmp, nfs_client_broadcast); 1185 sprintf(tmp, "%s/NFS-CLIENT-DEFGW", bkpinfo->tmpdir); 1186 write_one_liner_data_file(tmp, nfs_client_defgw); 1187 sprintf(tmp, "%s/NFS-SERVER-IPADDR", bkpinfo->tmpdir); 1188 write_one_liner_data_file(tmp, nfs_server_ipaddr); 1189 sprintf(tmp, "%s/NFS-SERVER-MOUNT", bkpinfo->tmpdir); 1190 write_one_liner_data_file(tmp, bkpinfo->nfs_mount); 1191 sprintf(tmp, "%s/NFS-SERVER-PATH", bkpinfo->tmpdir); 1192 write_one_liner_data_file(tmp, bkpinfo->nfs_remote_dir); 1171 "ifconfig | grep -E '%s' | grep -v '%s' | head -n1 | cut -d' ' -f1", mac_addr,netfs_dev); 1172 strcpy(netfs_dev, call_program_and_get_last_line_of_output(command)); 1173 log_to_screen("Replacing it with %s\n", netfs_dev); 1174 } 1175 1176 sprintf(tmp, "%s/NETFS-DEV", bkpinfo->tmpdir); 1177 write_one_liner_data_file(tmp, netfs_dev); 1178 1179 sprintf(tmp, "%s/NETFS-PROTO", bkpinfo->tmpdir); 1180 write_one_liner_data_file(tmp, bkpinfo->netfs_proto); 1181 1182 sprintf(tmp, "%s/NETFS-CLIENT-IPADDR", bkpinfo->tmpdir); 1183 write_one_liner_data_file(tmp, netfs_client_ipaddr); 1184 sprintf(tmp, "%s/NETFS-CLIENT-NETMASK", bkpinfo->tmpdir); 1185 write_one_liner_data_file(tmp, netfs_client_netmask); 1186 sprintf(tmp, "%s/NETFS-CLIENT-BROADCAST", bkpinfo->tmpdir); 1187 write_one_liner_data_file(tmp, netfs_client_broadcast); 1188 sprintf(tmp, "%s/NETFS-CLIENT-DEFGW", bkpinfo->tmpdir); 1189 write_one_liner_data_file(tmp, netfs_client_defgw); 1190 sprintf(tmp, "%s/NETFS-SERVER-IPADDR", bkpinfo->tmpdir); 1191 write_one_liner_data_file(tmp, netfs_server_ipaddr); 1192 sprintf(tmp, "%s/NETFS-SERVER-MOUNT", bkpinfo->tmpdir); 1193 write_one_liner_data_file(tmp, bkpinfo->netfs_mount); 1194 sprintf(tmp, "%s/NETFS-SERVER-PATH", bkpinfo->tmpdir); 1195 write_one_liner_data_file(tmp, bkpinfo->netfs_remote_dir); 1193 1196 sprintf(tmp, "%s/ISO-PREFIX", bkpinfo->tmpdir); 1194 1197 write_one_liner_data_file(tmp, bkpinfo->prefix); 1195 log_it("Finished storing N FSconfiguration");1198 log_it("Finished storing Network configuration"); 1196 1199 } 1197 1200 -
branches/2.2.9/mondo/src/common/libmondo-files.h
r2053 r2380 33 33 34 34 void copy_mondo_and_mindi_stuff_to_scratchdir(); 35 void store_n fs_config();35 void store_netfs_config(); 36 36 void estimate_noof_media_required(long); 37 37 bool is_this_file_compressed(char *); -
branches/2.2.9/mondo/src/common/libmondo-fork.c
r2226 r2380 133 133 old_stderr[0] = '\0'; 134 134 135 if ( bkpinfo->nfs_user) {136 mr_asprintf(&tmp1, "su - %s -c \"%s\"", bkpinfo->n fs_user, basic_call);135 if ((bkpinfo->netfs_user) && (strstr(bkpinfo->netfs_proto,"nfs"))) { 136 mr_asprintf(&tmp1, "su - %s -c \"%s\"", bkpinfo->netfs_user, basic_call); 137 137 } else { 138 138 mr_asprintf(&tmp1, "%s", basic_call); -
branches/2.2.9/mondo/src/common/libmondo-mountlist.c
r2371 r2380 390 390 continue; 391 391 } 392 log_msg(2, "Processing partition %s on %s #%d in mountlist", device, drive, pos); 392 393 /* gap in the partition list? */ 393 394 if (curr_part_no - prev_part_no > 1) { … … 483 484 if (res == 0) { 484 485 mr_free(flaws_str); 486 log_msg(2, "Fine, no error in evaluate_drive_within_mountlist"); 485 487 return (NULL); 486 488 } else { 489 log_msg(2, "Error in evaluate_drive_within_mountlist: %s", flaws_str); 487 490 return (flaws_str); 488 491 } -
branches/2.2.9/mondo/src/common/libmondo-string.c
r2355 r2380 1119 1119 mr_asprintf(&type_of_backup, "ISO"); 1120 1120 break; 1121 case n fs:1122 mr_asprintf(&type_of_backup, "n fs");1121 case netfs: 1122 mr_asprintf(&type_of_backup, "netfs"); 1123 1123 break; 1124 1124 case usb: -
branches/2.2.9/mondo/src/common/libmondo-tools.c
r2348 r2380 395 395 * - Used: @c bkpinfo->make_cd_use_lilo 396 396 * - Used: @c bkpinfo->media_device 397 * - Used: @c bkpinfo->n fs_mount397 * - Used: @c bkpinfo->netfs_mount 398 398 * - Used: @c bkpinfo->nonbootable_backup 399 399 * - Used: @c bkpinfo->scratchdir … … 668 668 } // end of iso code 669 669 670 if (bkpinfo->backup_media_type == n fs) {671 strcpy(hostname, bkpinfo->n fs_mount);670 if (bkpinfo->backup_media_type == netfs) { 671 strcpy(hostname, bkpinfo->netfs_mount); 672 672 colon = strchr(hostname, ':'); 673 673 if (!colon) { 674 log_it("n fs mount doesn't have a colon in it");674 log_it("netfs mount doesn't have a colon in it"); 675 675 retval++; 676 676 } else { … … 680 680 hent = gethostbyname(hostname); 681 681 if (!hent) { 682 log_it("Can't resolve N FSmount (%s): %s", hostname,682 log_it("Can't resolve Network mount (%s): %s", hostname, 683 683 hstrerror(h_errno)); 684 684 retval++; 685 685 } else { 686 686 mr_asprintf(&ip_address, "%s", inet_ntoa((struct in_addr) *((struct in_addr *) hent->h_addr))); 687 mr_strcat(ip_address, strchr(bkpinfo->n fs_mount, ':'));688 strcpy(bkpinfo->n fs_mount, ip_address);687 mr_strcat(ip_address, strchr(bkpinfo->netfs_mount, ':')); 688 strcpy(bkpinfo->netfs_mount, ip_address); 689 689 paranoid_free(ip_address); 690 690 } 691 691 } 692 store_n fs_config();692 store_netfs_config(); 693 693 } 694 694 … … 759 759 } 760 760 g_current_media_number = 1; 761 bkpinfo->postnuke_tarball[0] = bkpinfo->n fs_mount[0] = '\0';761 bkpinfo->postnuke_tarball[0] = bkpinfo->netfs_mount[0] = '\0'; 762 762 return (res); 763 763 } … … 846 846 bkpinfo->call_after_iso[0] = '\0'; 847 847 bkpinfo->kernel_path[0] = '\0'; 848 bkpinfo->nfs_mount[0] = '\0'; 849 bkpinfo->nfs_user = NULL; 850 bkpinfo->nfs_remote_dir[0] = '\0'; 848 bkpinfo->netfs_mount[0] = '\0'; 849 bkpinfo->netfs_proto = NULL; 850 bkpinfo->netfs_user = NULL; 851 bkpinfo->netfs_remote_dir[0] = '\0'; 851 852 bkpinfo->postnuke_tarball[0] = '\0'; 852 853 bkpinfo->wipe_media_first = FALSE; -
branches/2.2.9/mondo/src/common/libmondo-verify.c
r2242 r2380 1055 1055 * - @c bkpinfo->manual_cd_tray 1056 1056 * - @c bkpinfo->media_device 1057 * - @c bkpinfo->n fs_remote_dir1057 * - @c bkpinfo->netfs_remote_dir 1058 1058 * - @c bkpinfo->tmpdir 1059 1059 * - @c bkpinfo->verify_data … … 1090 1090 1091 1091 sprintf(mountpoint, "%s/cdrom", bkpinfo->tmpdir); 1092 sprintf(fname, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->n fs_remote_dir,1092 sprintf(fname, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->netfs_remote_dir, 1093 1093 bkpinfo->prefix, g_current_media_number); 1094 1094 -
branches/2.2.9/mondo/src/common/mondostructures.h
r2226 r2380 183 183 dvd, ///< Back up to DVD+R[W] or DVD-R[W] disks. 184 184 cdstream, ///< Back up to recordable CDs but treat them like a tape streamer. 185 n fs, ///< Back up to an NFS mount on the local subnet.185 netfs, ///< Back up to an NETFS mount on the local subnet. 186 186 tape, ///< Back up to tapes. 187 187 usb, ///< Back up to USB devices. … … 558 558 559 559 /** 560 * The N FS mount to back up to/restore from.561 * If backup_media_type is not @b n fs, this is ignored.560 * The NETFS mount to back up to/restore from. 561 * If backup_media_type is not @b netfs, this is ignored. 562 562 * It must contain a colon, and the server's address should be in dotted-decimal IP 563 563 * address form. (Domain names will be resolved in post_param_configuration().) 564 564 */ 565 char n fs_mount[MAX_STR_LEN];566 567 /** 568 * The directory, relative to the root of @p n fs_mount, to put565 char netfs_mount[MAX_STR_LEN]; 566 567 /** 568 * The directory, relative to the root of @p netfs_mount, to put 569 569 * the backups in. 570 570 */ 571 char nfs_remote_dir[MAX_STR_LEN]; 572 573 /** 574 * The potential user to use for NFS backup 575 */ 576 char *nfs_user; 571 char netfs_remote_dir[MAX_STR_LEN]; 572 573 /** 574 * The potential user to use for NETFS backup 575 */ 576 char *netfs_user; 577 578 /** 579 * The protocol to use for Network backup (NFS, SSHFS, ...) 580 */ 581 char *netfs_proto; 577 582 578 583 /** -
branches/2.2.9/mondo/src/common/newt-specific.c
r2374 r2380 101 101 g_xmondo_stdout[MAX_NEWT_COMMENT_LEN]; ///< .... @bug Unneeded w/current XMondo. 102 102 bool g_called_by_xmondo = FALSE; ///< @bug Unneeded w/current XMondo. 103 char *g_selfmounted_isodir; ///< Holds the N FS mountpoint if mounted via mondoarchive.103 char *g_selfmounted_isodir; ///< Holds the NETFS mountpoint if mounted via mondoarchive. 104 104 105 105 /* @} - end of globalGroup */ … … 445 445 } 446 446 /* Free all allocated strings in bkpinfo */ 447 mr_free(bkpinfo->nfs_user); 447 mr_free(bkpinfo->netfs_user); 448 mr_free(bkpinfo->netfs_proto); 448 449 449 450 /* Then free the structure */ … … 1252 1253 * Ask the user which backup media type they would like to use. 1253 1254 * The choices are @p none (exit to shell), @c cdr, @c cdrw, @c dvd, 1254 * @c tape, @c cdstream, @c udev (only when @p g_text_mode is TRUE), @c n fs,1255 * @c tape, @c cdstream, @c udev (only when @p g_text_mode is TRUE), @c netfs, 1255 1256 * and @c iso. 1256 1257 * @param restoring TRUE if we're restoring, FALSE if we're backing up. … … 1267 1268 char *minimsg_sz; 1268 1269 static t_bkptype possible_bkptypes[] = 1269 { none, cdr, cdrw, dvd, tape, cdstream, udev, n fs, iso };1270 { none, cdr, cdrw, dvd, tape, cdstream, udev, netfs, iso }; 1270 1271 static char *possible_responses[] = 1271 1272 { "none", "cdr", "cdrw", "dvd", "tape", "cdstream", "udev", 1272 "n fs", "iso", NULL };1273 "netfs", "iso", NULL }; 1273 1274 char *outstr; 1274 1275 t_bkptype backup_type; … … 1328 1329 b4 = newtButton(17, 5, "USB Key/Disk"); 1329 1330 b5 = newtButton(1, 5, " DVD disks "); 1330 b6 = newtButton(17, 9, " N FSmount ");1331 b6 = newtButton(17, 9, " Net mount "); 1331 1332 b7 = newtButton(1, 13, " Hard disk "); 1332 1333 b8 = newtButton(17, 13, " Exit "); … … 1348 1349 output = dvd; 1349 1350 } else if (b_res == b6) { 1350 output = n fs;1351 output = netfs; 1351 1352 } else if (b_res == b7) { 1352 1353 output = iso; -
branches/2.2.9/mondo/src/include/my-stuff.h
r2237 r2380 318 318 #define DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE "/dev/md" 319 319 #define RAID_DEVICE_STUB DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE 320 #define SANE_FORMATS "swap image vfat ext2 ext3 ext4 xfs vfs jfs reiserfs vmfs dos minix coda nfs nfs4 ntfs ntfs-3g hpfs raid lvm cifs ocfs ocfs2"320 #define SANE_FORMATS "swap image vfat ext2 ext3 ext4 xfs vfs jfs reiserfs vmfs dos minix coda fuse.sshfs nfs nfs4 ntfs ntfs-3g hpfs raid lvm cifs ocfs ocfs2" 321 321 #define ALT_TAPE "/dev/ht0" 322 322 #define MKE2FS_OR_NEWFS "mke2fs" -
branches/2.2.9/mondo/src/mondorestore/mondo-rstr-newt.c
r2355 r2380 2297 2297 strcpy(isodir_path, "/"); 2298 2298 } 2299 if (does_file_exist("/tmp/N FS-SERVER-PATH")) {2300 strcpy(isodir_device, last_line_of_file("/tmp/N FS-SERVER-MOUNT"));2301 strcpy(isodir_format, "n fs");2302 strcpy(isodir_path, last_line_of_file("/tmp/N FS-SERVER-PATH"));2299 if (does_file_exist("/tmp/NETFS-SERVER-PATH")) { 2300 strcpy(isodir_device, last_line_of_file("/tmp/NETFS-SERVER-MOUNT")); 2301 strcpy(isodir_format, "netfs"); 2302 strcpy(isodir_path, last_line_of_file("/tmp/NETFS-SERVER-PATH")); 2303 2303 } 2304 2304 if (nuke_me_please) { -
branches/2.2.9/mondo/src/mondorestore/mondo-rstr-tools.c
r2242 r2380 614 614 } 615 615 616 if (bkpinfo->backup_media_type == n fs) {617 log_msg(2, "Mounting for N FSthingy");616 if (bkpinfo->backup_media_type == netfs) { 617 log_msg(2, "Mounting for Network thingy"); 618 618 log_msg(2, "isodir = %s", bkpinfo->isodir); 619 619 if ((!bkpinfo->isodir[0] || !strcmp(bkpinfo->isodir, "/")) … … 624 624 #ifdef __FreeBSD__ 625 625 sprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir, 626 bkpinfo->n fs_remote_dir, bkpinfo->prefix, g_current_media_number);626 bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number); 627 627 mddev = make_vn(mount_cmd); 628 628 sprintf(mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev); 629 629 #else 630 630 sprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s", 631 bkpinfo->isodir, bkpinfo->n fs_remote_dir,631 bkpinfo->isodir, bkpinfo->netfs_remote_dir, 632 632 bkpinfo->prefix, g_current_media_number, MNT_CDROM); 633 633 #endif … … 805 805 strcpy(bkpinfo->prefix,STD_PREFIX); 806 806 } 807 } else if (!strcmp(value, "n fs")) {808 bkpinfo->backup_media_type = n fs;807 } else if (!strcmp(value, "netfs")) { 808 bkpinfo->backup_media_type = netfs; 809 809 bkpinfo->please_dont_eject = TRUE; 810 810 if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) { … … 816 816 ("cat /proc/cmdline"), "pxe")) { 817 817 /* We need to override prefix value in PXE mode as it's 818 * already done in start-n fs */818 * already done in start-netfs */ 819 819 envtmp1 = getenv("imgname"); 820 820 if (envtmp1 == NULL) { … … 961 961 } 962 962 963 if (bkpinfo->backup_media_type == n fs) {963 if (bkpinfo->backup_media_type == netfs) { 964 964 if (!cfgf) { 965 log_msg(2, "n fs_mount remains %s", bkpinfo->nfs_mount);966 log_msg(2, "n fs_remote_dir remains %s",967 bkpinfo->n fs_remote_dir);965 log_msg(2, "netfs_mount remains %s", bkpinfo->netfs_mount); 966 log_msg(2, "netfs_remote_dir remains %s", 967 bkpinfo->netfs_remote_dir); 968 968 log_msg(2, 969 969 "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place"); 970 970 } else { 971 read_cfg_var(g_mondo_cfg_file, "nfs-server-mount", 972 bkpinfo->nfs_mount); 973 read_cfg_var(g_mondo_cfg_file, "nfs-server-path", 974 bkpinfo->nfs_remote_dir); 975 log_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount); 976 log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir); 971 read_cfg_var(g_mondo_cfg_file, "netfs-server-mount", 972 bkpinfo->netfs_mount); 973 read_cfg_var(g_mondo_cfg_file, "netfs-server-path", 974 bkpinfo->netfs_remote_dir); 975 log_msg(2, "netfs_mount is %s", bkpinfo->netfs_mount); 976 log_msg(2, "netfs_proto is %s", bkpinfo->netfs_proto); 977 log_msg(2, "netfs_remote_dir is %s", bkpinfo->netfs_remote_dir); 977 978 } 978 979 if (strstr(call_program_and_get_last_line_of_output 979 980 ("cat /proc/cmdline"), "pxe")) { 980 981 /* We need to override values in PXE mode as it's 981 * already done in start-n fs */982 envtmp1 = getenv("n fsmount");982 * already done in start-netfs */ 983 envtmp1 = getenv("netfsmount"); 983 984 if (envtmp1 == NULL) { 984 fatal_error("no n fsmount variable in environment");985 fatal_error("no netfsmount variable in environment"); 985 986 } 986 987 envtmp2 = getenv("dirimg"); … … 988 989 fatal_error("no dirimg variable in environment"); 989 990 } 990 strcpy(bkpinfo->n fs_mount,envtmp1);991 strcpy(bkpinfo->n fs_remote_dir,envtmp2);991 strcpy(bkpinfo->netfs_mount,envtmp1); 992 strcpy(bkpinfo->netfs_remote_dir,envtmp2); 992 993 } 993 994 } else if (bkpinfo->backup_media_type == iso) { -
branches/2.2.9/mondo/src/mondorestore/mondorestore.c
r2373 r2380 964 964 965 965 strcpy(bkpinfo->restore_path, "/"); 966 if (!g_restoring_live_from_cd && !g_restoring_live_from_n fs) {966 if (!g_restoring_live_from_cd && !g_restoring_live_from_netfs) { 967 967 popup_and_OK 968 968 ("Please insert tape/CD/USB Key, then hit 'OK' to continue."); 969 969 sleep(1); 970 970 } 971 if (!g_restoring_live_from_n fs) {971 if (!g_restoring_live_from_netfs) { 972 972 interactively_obtain_media_parameters_from_user(FALSE); 973 973 } … … 990 990 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 991 991 992 if (!g_restoring_live_from_n fs && (filelist = process_filelist_and_biggielist())) {992 if (!g_restoring_live_from_netfs && (filelist = process_filelist_and_biggielist())) { 993 993 save_filelist(filelist, "/tmp/selected-files.txt"); 994 994 strcpy(old_restpath, bkpinfo->restore_path); … … 3096 3096 mount_boot_if_necessary(); /* for Gentoo users */ 3097 3097 log_msg(2, "Still here."); 3098 if (bkpinfo->backup_media_type == n fs) {3099 g_restoring_live_from_n fs = TRUE;3098 if (bkpinfo->backup_media_type == netfs) { 3099 g_restoring_live_from_netfs = TRUE; 3100 3100 } 3101 3101 log_msg(2, "Calling restore_to_live_filesystem()"); … … 3123 3123 // BCO:To be reviewed 3124 3124 if ((bkpinfo->restore_mode == compare) || (bkpinfo->restore_mode == nuke)) { 3125 if (bkpinfo->backup_media_type == n fs3126 && !is_this_device_mounted(bkpinfo->n fs_mount)) {3127 log_msg(1, "Mounting nfs dir");3125 if (bkpinfo->backup_media_type == netfs 3126 && !is_this_device_mounted(bkpinfo->netfs_mount)) { 3127 log_msg(1, "Mounting remote %s dir", bkpinfo->netfs_proto); 3128 3128 sprintf(bkpinfo->isodir, "/tmp/isodir"); 3129 3129 run_program_and_log_output("mkdir -p /tmp/isodir", 5); 3130 sprintf(tmp, "mount %s -t nfs -o nolock,ro /tmp/isodir", 3131 bkpinfo->nfs_mount); 3130 if (strstr(bkpinfo->netfs_proto, "sshfs")) { 3131 sprintf(tmp, "sshfs -o ro /tmp/isodir", 3132 bkpinfo->netfs_mount); 3133 } else { 3134 sprintf(tmp, "mount %s -o nolock,ro /tmp/isodir", 3135 bkpinfo->netfs_mount); 3132 3136 run_program_and_log_output(tmp, 1); 3133 3137 } -
branches/2.2.9/mondo/src/mondorestore/mr-externs.h
r2350 r2380 107 107 extern bool g_text_mode; 108 108 extern bool g_restoring_live_from_cd; 109 extern bool g_restoring_live_from_n fs;109 extern bool g_restoring_live_from_netfs; 110 110 extern int fput_string_one_char_at_a_time(FILE *, char *); 111 111 extern char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res);
Note:
See TracChangeset
for help on using the changeset viewer.