Changeset 2380 in MondoRescue


Ignore:
Timestamp:
Sep 9, 2009, 8:30:47 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • Change NFS support into a NetFS support to allow for multiple protocol in addition to NFS (NEEDS TESTING)
  • Better logging to detect a potential nuke issue
Location:
branches/2.2.9
Files:
27 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi/README.pxe

    r2191 r2380  
    1111label mondo
    1212        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 [prefix=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=#] ...
    1414
    1515ipdev is the device name (e.g. eth2)
     
    1919gateway is the default gateway (e.g. 192.168.1.254)
    2020dhcp 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)
     21proto is the protocol to use for mounting the remote share (default is NFS, sshfs is also available)
     22server is the ip addr of the Remote Network server
     23mountpoint is the mount point on the Remote Network server to use (if NFS, should be in /etc/exports of the NFS server)
     24netfsmount 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.
     25netfspath is the local path on the remote server where the image is located, if different from the one at backup time.
    2326local_path is the local directory under which the mage was made (with the -d option)
    2427rmadisk_size may have to be increase to 131072 on more recent distributions such as rhel 5
     
    4043Without 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.
    4144
    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 nfsmount option. The structure on both server under the mountpoint has to be the same.
     45During 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.
    4346
    4447CAVEAT: the limit to the number of char on the append line is 255. Use symlinks to reduce the size of your path if needed.
     
    4649Please report any problem around that tool to bruno@mondorescue.org
    4750
     512009-09-09 Changed to netfs for multi protocol support (nfs, sshfs, ...)
    48522009-05-07 nfspath added to allow redeployment from another NFS directory
    49532006-06-10 nfsmount added to allow redeployment from another NFS server
  • branches/2.2.9/mindi/deplist.txt

    r2222 r2380  
    4646/bin/mount
    4747/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
    4950/sbin/mount.cifs /sbin/mount.cifs3
    5051/sbin/mount.smb /sbin/mount.smb3
  • branches/2.2.9/mindi/mindi

    r2344 r2380  
    5757PCMCIA_MODS="pcmcia_core ds yenta_socket"
    5858USB_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"
     59NET_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"
    6060CDROM_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"
    6161# 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"
     62EXTRA_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"
    6363# Replace with that line for HP OCMP e.g.
    6464#DENY_MODS="MPS_Driver_Mapper mps octtldrv tscttl streams kqemu fdomain"
     
    592592        fi
    593593        cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW."
    594         if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    595             LogIt "\nIncorporating NFS-related settings"
    596             for r in NFS-* ISO-PREFIX ; do
     594        if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then
     595            LogIt "\nIncorporating Network-related settings"
     596            for r in NETFS-* ISO-PREFIX ; do
    597597                cp -f $MINDI_TMP/$r $bigdir/tmp 2>> $LOGFILE || Die "Cannot copy $r - did you run out of disk space?"
    598598                echo "Copying $r to ramdisk" >> $LOGFILE
     
    920920    echo "datestamp `date`" >> $outfile
    921921    [ "$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
    930931    AddFileToCfgIfExists $MINDI_TMP/ISO-DEV           iso-dev           $outfile
    931932    AddFileToCfgIfExists $MINDI_TMP/ISO-MNT           iso-mnt           $outfile
     
    15081509    if [ _"$MONDO_SHARE" != _"" ]; then
    15091510        if [ "$CDRECOVERY" != "yes" ] ; then
    1510             if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
     1511            if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then
    15111512                echo -en "Press <enter> to continue.\n"
    15121513            elif [ ! "$MINDI_TMP" ] ; then
     
    15511552    # In case it's mondoarchive
    15521553    elif [ _"$MONDO_SHARE" != _"" ]; then
    1553         if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
     1554        if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then
    15541555            echo -en "default${sep}iso\n"
    15551556        else
     
    23412342    list_of_groovy_mods="$CDROM_MODS $FORCE_MODS"
    23422343
    2343     if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
     2344    if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then
    23442345        # For PXE boot
    23452346        list_of_groovy_mods="$list_of_groovy_mods $NET_MODS"
  • branches/2.2.9/mindi/rootfs/sbin/init

    r2353 r2380  
    719719fi
    720720if [ "`grep -i pxe /proc/cmdline`" ] || [ "`grep -i net /proc/cmdline`" ]; then
    721     # We need to get here exported variables from start-nfs
    722     . /sbin/start-nfs
     721    # We need to get here exported variables from start-netfs
     722    . /sbin/start-netfs
    723723fi
    724724
     
    732732    ExtractDataDisksAndLoadModules
    733733    # 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 nfs/" /tmp/mondo-restore.cfg
     734    sed -i "s/backup-media-type.*/backup-media-type netfs/" /tmp/mondo-restore.cfg
    735735elif [ "`grep -i usb= /proc/cmdline`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg 2>/dev/null | grep media-type`" ]; then
    736736    . /sbin/start-usb
     
    743743    HandleCDROM
    744744    ExtractDataDisksAndLoadModules
    745     # We need to get here exported variables from start-nfs
    746     . /sbin/start-nfs
     745    # We need to get here exported variables from start-netfs
     746    . /sbin/start-netfs
    747747fi
    748748res=$?
     
    843843    LogIt "backup-media-type is specified in config file - great."
    844844    LogIt "Calling post-init"
    845     # start-nfs moved it under /tmp as the NFS share is already unmounted
     845    # start-netfs moved it under /tmp as the NFS share is already unmounted
    846846    if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then
    847847        post=`echo $pre | sed 's|^/tmp/isodir|/tmp|'`
     
    861861        echo $i | grep -qi post= && post=`echo $i | cut -d= -f2`
    862862    done
    863     # start-nfs moved it under /tmp as the NFS share is already unmounted
     863    # start-netfs moved it under /tmp as the NFS share is already unmounted
    864864    if [ "`echo $post | grep -E '^/tmp/isodir'`" ]; then
    865865        post=`echo $post | sed 's|^/tmp/isodir|/tmp|'`
  • branches/2.2.9/mindi/rootfs/sbin/start-netfs

    r2377 r2380  
    33# $Id$
    44#
    5 # This script sets up the network + NFS environment if needed.
     5# This script sets up the network + Network FS environment if needed.
    66#
    77
     
    1111
    1212# 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-`
     13ipdev=`grep netfs-dev /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     14ipaddress=`grep netfs-client-ipaddr /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     15ipnetmask=`grep netfs-client-netmask /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     16ipbroadcast=`grep netfs-client-broadcast /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     17ipgateway=`grep netfs-client-defgw /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     18proto=`grep netfs-proto /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    1819ipconf=""
    1920pre=""
    2021post=""
    21 export nfsmount=`grep nfs-server-mount /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     22export netfsmount=`grep netfs-server-mount /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    2223export imgname=`grep iso-prefix /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    2324if [ "$imgname" = "" ]; then
    2425    export imgname="mondorescue"
    2526fi
    26 export dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     27export dirimg=`grep netfs-server-path /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    2728if [ "$dirimg" = "" ]; then
    2829    export dirimg="/"
     
    3334    echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2`
    3435    echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2`
    35     echo $i | grep -qi nfsmount= && export nfsmount=`echo $i | cut -d= -f2`
     36    echo $i | grep -qi netfsmount= && export netfsmount=`echo $i | cut -d= -f2`
    3637    echo $i | grep -qi prefix= && export imgname=`echo $i | cut -d= -f2`
    37     echo $i | grep -qi nfspath= && export dirimg=`echo $i | cut -d= -f2`
     38    echo $i | grep -qi netfspath= && export dirimg=`echo $i | cut -d= -f2`
    3839    echo $i | grep -qi pre= && pre=`echo $i | cut -d= -f2`
    3940    echo $i | grep -qi post= && post=`echo $i | cut -d= -f2`
     41    echo $i | grep -qi proto= && proto=`echo $i | cut -d= -f2`
    4042done
    4143
     
    6769
    6870    # ping server helps waking interface up
    69     LogIt "Pinging NFS server..."
    70     nfs_server_ipaddr=`echo $nfsmount | cut -d: -f1`
    71     ping -c $ipcount $nfs_server_ipaddr
     71    LogIt "Pinging Remote server..."
     72    netfs_server_ipaddr=`echo $netfsmount | cut -d: -f1 | cut -d@ -f2`
     73    ping -c $ipcount $netfs_server_ipaddr
    7274
    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
    7791   
    78     LogIt "Mounting NFS image ${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"
    7993    mount -o ro,loop -t iso9660 /tmp/isodir/$dirimg/${imgname}-1.iso /mnt/cdrom
    8094
    81     # Save the scripts on the NFS share locally
     95    # Save the scripts on the Network share locally
    8296    if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then
    8397        cp $pre /tmp
  • branches/2.2.9/mondo-doc/mondoarchive.8

    r2342 r2380  
    119119.TP
    120120.BI "-n " mount
    121 Use files residing on NFS partition as backup media.
     121Use files residing on a remote share as backup media.
    122122.I mount
    123 is the remote mount-point, e.g. '192.168.1.3:/home/nfs'
     123is the remote mount-point, e.g. 'nfs://192.168.1.3:/home/nfs'
    124124for my file server. If not mounted, mondoarchive will do it for you. So nice ;-)
    125125If your NFS server only accept write from a backup user, you may specify it with the syntax:
    126 .B user@machine:/mount/path
     126.B nfs://user@machine:/mount/path
    127127and mondoarchive will try to do its best to support it.
     128Other protocols are available such as sshfs for fuse SSH based filesystem
     129mount, with the same syntax e.g. 'sshfs://user@192.168.1.3:/home/nfs'
    128130
    129131.TP
     
    422424Backup to an NFS mount:
    423425.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"
    425427
    426428Verify existing NFS backup:-
    427429.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"
    429431
    430432.BI USB:
  • branches/2.2.9/mondo-doc/mondorescue-howto.sgml

    r2087 r2380  
    560560<row>
    561561<entry>
    562         bash# mount 192.168.1.28:/home/nfs /mnt/nfs
     562        bash# mount nfs://192.168.1.28:/home/nfs /mnt/nfs
    563563        </entry>
    564564</row>
    565565<row>
    566566<entry>
    567 bash# mondoarchive -OVn 192.168.1.28:/home/nfs -gF[...]
     567        bash# mondoarchive -OVn nfs://192.168.1.28:/home/nfs -gF[...]
    568568        </entry>
    569569</row>
     
    15081508<entry>
    15091509
    1510         bash# mount 192.168.1.3:/home/nfs -t nfs /mnt/nfs
     1510        bash# mount nfs://192.168.1.3:/home/nfs -t nfs /mnt/nfs
    15111511</entry>
    15121512</row>
    15131513<row>
    15141514        <entry>
    1515         bash# mondoarchive -OVn 192.168.1.3:/home/nfs -g -s 200m
     1515        bash# mondoarchive -OVn nfs://192.168.1.3:/home/nfs -g -s 200m
    15161516</entry>
    15171517</row>
     
    31193119<entry>
    31203120
    3121 bash# mondoarchive -On 192.168.1.3:/home/nfs
     3121        bash# mondoarchive -On nfs://192.168.1.3:/home/nfs
    31223122
    31233123</entry>
  • branches/2.2.9/mondo-doc/mondorestore.8

    r2294 r2380  
    6262Use files residing on NFS partition as restore media.
    6363.I mount
    64 is the remote mount-point, e.g. '192.168.1.3:/home/nfs'
     64is the remote mount-point, e.g. nfs://192.168.1.3:/home/nfs'
    6565for my file server. Please mount it before restoring/verifying.
    6666
  • branches/2.2.9/mondo/src/common/libmondo-archive.c

    r2309 r2380  
    787787        mr_asprintf(&value, "iso");
    788788        break;
    789     case nfs:
    790         mr_asprintf(&value, "nfs");
     789    case netfs:
     790        mr_asprintf(&value, "netfs");
    791791        break;
    792792    case dvd:
     
    858858    estimated_total_noof_slices =
    859859        size_of_all_biggiefiles_K(bkpinfo) / bkpinfo->optimal_set_size + 1;
    860     /* add nfs stuff here? */
     860    /* add netfs stuff here? */
    861861    mr_asprintf(&command, "mkdir -p %s/images", bkpinfo->scratchdir);
    862862    if (system(command)) {
     
    12621262
    12631263    sprintf(command, "rm -f %s/%s/%s-[1-9]*.iso", bkpinfo->isodir,
    1264             bkpinfo->nfs_remote_dir, bkpinfo->prefix);
     1264            bkpinfo->netfs_remote_dir, bkpinfo->prefix);
    12651265    paranoid_system(command);
    12661266    wipe_archives(bkpinfo->scratchdir);
     
    32863286 * - @c manual_cd_tray
    32873287 * - @c media_size
    3288  * - @c nfs_mount
    3289  * - @c nfs_remote_dir
     3288 * - @c netfs_mount
     3289 * - @c netfs_remote_dir
    32903290 * - @c scratchdir
    32913291 * - @c verify_data
     
    33633363    }
    33643364    sprintf(isofile, "%s/%s/%s-%d.iso", bkpinfo->isodir,
    3365             bkpinfo->nfs_remote_dir, bkpinfo->prefix,
     3365            bkpinfo->netfs_remote_dir, bkpinfo->prefix,
    33663366            g_current_media_number);
    33673367    for (that_one_was_ok = FALSE; !that_one_was_ok;) {
  • branches/2.2.9/mondo/src/common/libmondo-cli.c

    r2309 r2380  
    5555static void free_mounted_fs_list (void);
    5656static int get_dsf_mount_list (const char *dsf, char **included_dsf_list, char **excluded_dsf_list);
    57 static int create_list_of_non_NFS_mounted_file_systems (void);
     57static int create_list_of_non_NETFS_mounted_file_systems (void);
    5858static MOUNTED_FS_STRUCT *find_mount_point_in_list (char *mount_point);
    5959static MOUNTED_FS_STRUCT *find_device_in_list (char *device);
     
    178178/**
    179179 * Frees the memory for all of the structures on the linked list of
    180  * all of the non-NFS mounted file systems.
     180 * all of the non-NETFS mounted file systems.
    181181 */
    182182static void free_mounted_fs_list (void) {
     
    195195
    196196/**
    197  * Creates a singly linked list of all of the non-NFS mounted file systems.
     197 * Creates a singly linked list of all of the non-NETFS mounted file systems.
    198198 * @param DSFptr A pointer  to the structure MOUNTED_FS_STRUCT used to hold
    199199 * the list of mounted file systems.
     
    213213
    214214/**
    215  * Find the structure, in the singly linked list of all of the non-NFS
     215 * Find the structure, in the singly linked list of all of the non-NETFS
    216216 * mounted file systems, that contains the specified device.
    217217 * @param device The device to find
     
    234234
    235235/**
    236  * Find the structure, in the singly linked list of all of the non-NFS
     236 * Find the structure, in the singly linked list of all of the non-NETFS
    237237 * mounted file systems, that contains the specified mount point.
    238238 * @param mount_point The mount point to find
     
    255255
    256256/**
    257  * Creates a linked list of all of the non-NFS mounted file systems.
     257 * Creates a linked list of all of the non-NETFS mounted file systems.
    258258 * We use a linked list because we don't know how many  mounted file
    259259 * there are (and there can be a lot).
    260260 * @return 0 on success and greated than 0 on failure.
    261261 */
    262 static int create_list_of_non_NFS_mounted_file_systems (void)
     262static int create_list_of_non_NETFS_mounted_file_systems (void)
    263263{
    264264    int i = 0;
     
    388388
    389389    /* Get a list of the mounted file systems */
    390     if (create_list_of_non_NFS_mounted_file_systems()) {
     390    if (create_list_of_non_NETFS_mounted_file_systems()) {
    391391        log_to_screen ("Could not get the list of mounted file systems");
    392392        return (1);
     
    992992
    993993    if (flag_set['n']) {
    994         strncpy(bkpinfo->nfs_mount, flag_val['n'], MAX_STR_LEN);
     994        strncpy(bkpinfo->netfs_mount, flag_val['n'], MAX_STR_LEN);
    995995        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, '@');
    10001025        if (p != NULL) {
    10011026            /* User found. Store the 2 values */
    10021027            p++;
    1003             /* new NFS mount */
     1028            /* new netfs mount */
    10041029            strcpy(tmp,p);
    10051030            p--;
    10061031            *p = '\0';
    1007             mr_asprintf(&q,"%s",bkpinfo->nfs_mount);
    1008             bkpinfo->nfs_user = q;
    1009             strcpy(bkpinfo->nfs_mount,tmp);
     1032            mr_asprintf(&q,"%s",bkpinfo->netfs_mount);
     1033            bkpinfo->netfs_user = q;
     1034            strcpy(bkpinfo->netfs_mount,tmp);
    10101035        }
    10111036        sprintf(tmp, "mount | grep -E \"^%s[/]* .*\" | cut -d' ' -f3",
    1012                 bkpinfo->nfs_mount);
     1037                bkpinfo->netfs_mount);
    10131038        strncpy(bkpinfo->isodir,
    10141039                call_program_and_get_last_line_of_output(tmp),
    10151040                MAX_STR_LEN / 4);
    10161041        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            }
    10191048            if (system(tmp)) {
    1020                 log_to_screen("Unable to mount NFS 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);
    10211050                retval++;
    10221051            } else {
    10231052                sprintf(tmp, "mount | grep -E \"^%s[/]* .*\" | cut -d' ' -f3",
    1024                     bkpinfo->nfs_mount);
     1053                    bkpinfo->netfs_mount);
    10251054                strncpy(bkpinfo->isodir,
    10261055                        call_program_and_get_last_line_of_output(tmp),
     
    10281057                if (strlen(bkpinfo->isodir) < 3) {
    10291058                    retval++;
    1030                     log_to_screen("NFS 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);
    10311060                }
    10321061            }
    10331062        }
    1034         log_msg(3, "mount = %s", bkpinfo->nfs_mount);
     1063        log_msg(3, "mount = %s", bkpinfo->netfs_mount);
    10351064        log_msg(3, "isodir= %s", bkpinfo->isodir);
    10361065    }
     
    10461075    }
    10471076    if (flag_set['n']) {
    1048         bkpinfo->backup_media_type = nfs;
    1049         /* Never try to eject a NFS device */
     1077        bkpinfo->backup_media_type = netfs;
     1078        /* Never try to eject a Network device */
    10501079        bkpinfo->please_dont_eject = TRUE;
    10511080    }
     
    11551184    }
    11561185
    1157     if ((flag_set['N']) && (! bkpinfo->restore_data))       // exclude NFS mounts & devices
     1186    if ((flag_set['N']) && (! bkpinfo->restore_data))       // exclude Network mounts & devices
    11581187    {
    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());
    11611189        if (bkpinfo->exclude_paths[0]) {
    11621190            strncat(bkpinfo->exclude_paths, " ", 4*MAX_STR_LEN);
     
    12331261    }
    12341262
    1235     if (flag_set['d']) {        /* backup directory (if ISO/NFS) */
     1263    if (flag_set['d']) {        /* backup directory (if ISO/NETFS) */
    12361264        if (flag_set['i']) {
    12371265            strncpy(bkpinfo->isodir, flag_val['d'], MAX_STR_LEN / 4);
     
    12421270            }
    12431271        } else if (flag_set['n']) {
    1244             strncpy(bkpinfo->nfs_remote_dir, flag_val['d'], MAX_STR_LEN);
     1272            strncpy(bkpinfo->netfs_remote_dir, flag_val['d'], MAX_STR_LEN);
    12451273        } else {                /* backup device (if tape/CD-R/CD-RW) */
    12461274            strncpy(bkpinfo->media_device, flag_val['d'], MAX_STR_LEN / 4);
     
    12491277
    12501278    if ((flag_set['n']) && (! bkpinfo->restore_data)) {
    1251         mr_asprintf(&tmp1,"%s/%s/.dummy.txt", bkpinfo->isodir,bkpinfo->nfs_remote_dir);
    1252         if (bkpinfo->nfs_user) {
    1253             sprintf(tmp, "su - %s -c \"echo hi > %s\"", bkpinfo->nfs_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);
    12541282        } else {
    12551283            sprintf(tmp, "echo hi > %s", tmp1);
     
    12591287            sprintf(tmp,
    12601288                    "Are you sure directory '%s' exists in remote dir '%s'?\nIf so, do you have rights to write to it?\n",
    1261                     bkpinfo->nfs_remote_dir, bkpinfo->nfs_mount);
     1289                    bkpinfo->netfs_remote_dir, bkpinfo->netfs_mount);
    12621290            log_to_screen(tmp);
    12631291        }
  • branches/2.2.9/mondo/src/common/libmondo-devices-EXT.h

    r1647 r2380  
    4646extern int eject_device(char *);
    4747
    48 extern char *list_of_NFS_devices_and_mounts();
    49 extern char *list_of_NFS_mounts_only(void);
     48extern char *list_of_NETFS_devices_and_mounts();
     49extern char *list_of_NETFS_mounts_only(void);
    5050
    5151extern void sensibly_set_tmpdir_and_scratchdir();
  • branches/2.2.9/mondo/src/common/libmondo-devices.c

    r2368 r2380  
    5454 */
    5555bool g_restoring_live_from_cd = FALSE;
    56 bool g_restoring_live_from_nfs = FALSE;
     56bool g_restoring_live_from_netfs = FALSE;
    5757
    5858extern t_bkptype g_backup_media_type;   // set by main()
     
    179179        strcpy(output, "cdstream");
    180180        break;
    181     case nfs:
    182         strcpy(output, "nfs");
     181    case netfs:
     182        strcpy(output, "netfs");
    183183        break;
    184184    case tape:
     
    13761376    run_program_and_log_output(tmp, 5);
    13771377    if (g_ISO_restore_mode || bkpinfo->backup_media_type == iso
    1378         || bkpinfo->backup_media_type == nfs) {
     1378        || bkpinfo->backup_media_type == netfs) {
    13791379        log_msg(3, "Remounting CD");
    13801380        g_ISO_restore_mode = TRUE;
     
    13871387        (void)system(tmp);
    13881388        sprintf(tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir,
    1389                 bkpinfo->nfs_remote_dir, bkpinfo->prefix,
     1389                bkpinfo->netfs_remote_dir, bkpinfo->prefix,
    13901390                cd_number_i_want);
    13911391        if (!does_file_exist(tmp)) {
    13921392            sprintf(tmp, "%s/isodir/%s/%s-%d.iso", bkpinfo->tmpdir,
    1393                     bkpinfo->nfs_remote_dir, bkpinfo->prefix,
     1393                    bkpinfo->netfs_remote_dir, bkpinfo->prefix,
    13941394                    cd_number_i_want);
    13951395            if (does_file_exist(tmp)) {
     
    14861486    bkpinfo->nonbootable_backup = FALSE;
    14871487
    1488     // Tape, CD, NFS, ...?
     1488    // Tape, CD, NETFS, ...?
    14891489    srandom(getpid());
    14901490    bkpinfo->backup_media_type =
     
    17261726
    17271727
    1728     case nfs:
    1729         /* Never try to eject a NFS device */
     1728    case netfs:
     1729        /* Never try to eject a NETFS device */
    17301730        bkpinfo->please_dont_eject = TRUE;
    17311731
    1732         /* Initiate bkpinfo nfs_mount path from running environment if not already done */
    1733         if (!bkpinfo->nfs_mount[0]) {
    1734             strcpy(bkpinfo->nfs_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,
    17351735                   call_program_and_get_last_line_of_output
    17361736                   ("mount | grep \":\" | cut -d' ' -f1 | head -n1"));
     
    17431743        {
    17441744            if (!popup_and_get_string
    1745                 ("NFS dir.",
     1745                ("Network shared dir.",
    17461746                 "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->nfs_mount, MAX_STR_LEN / 4)) {
     1747                 bkpinfo->netfs_mount, MAX_STR_LEN / 4)) {
    17481748                log_to_screen("User has chosen not to backup the PC");
    17491749                finish(1);
     
    17581758            // check whether already mounted - we better remove
    17591759            // surrounding spaces and trailing '/' for this
    1760             strip_spaces(bkpinfo->nfs_mount);
    1761             if (bkpinfo->nfs_mount[strlen(bkpinfo->nfs_mount) - 1] == '/')
    1762                 bkpinfo->nfs_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';
    17631763            sprintf(command, "mount | grep \"%s \" | cut -d' ' -f3",
    1764                     bkpinfo->nfs_mount);
     1764                    bkpinfo->netfs_mount);
    17651765            strcpy(bkpinfo->isodir,
    17661766                   call_program_and_get_last_line_of_output(command));
     
    17881788            (void)system(command);
    17891789            if (!popup_and_get_string
    1790                 ("NFS share", "Which remote NFS share should I mount?",
    1791                  bkpinfo->nfs_mount, MAX_STR_LEN)) {
     1790                ("Network share", "Which remote share should I mount?",
     1791                 bkpinfo->netfs_mount, MAX_STR_LEN)) {
    17921792                log_to_screen("User has chosen not to backup the PC");
    17931793                finish(1);
     
    17951795        }
    17961796        /* Initiate bkpinfo isodir path from running environment if mount already done */
    1797         if (is_this_device_mounted(bkpinfo->nfs_mount)) {
     1797        if (is_this_device_mounted(bkpinfo->netfs_mount)) {
    17981798            strcpy(bkpinfo->isodir,
    17991799                   call_program_and_get_last_line_of_output
    18001800                   ("mount | grep \":\" | cut -d' ' -f3 | head -n1"));
    18011801        } else {
    1802             sprintf(bkpinfo->isodir, "%s/nfsdir", bkpinfo->tmpdir);
     1802            sprintf(bkpinfo->isodir, "%s/netfsdir", bkpinfo->tmpdir);
    18031803            sprintf(command, "mkdir -p %s", bkpinfo->isodir);
    18041804            run_program_and_log_output(command, 5);
    18051805            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                }
    18071811            } 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                }
    18091817            }
    18101818            run_program_and_log_output(tmp, 3);
     
    18141822            strcpy(g_selfmounted_isodir, bkpinfo->isodir);
    18151823        }
    1816         if (!is_this_device_mounted(bkpinfo->nfs_mount)) {
     1824        if (!is_this_device_mounted(bkpinfo->netfs_mount)) {
    18171825            popup_and_OK
    18181826                ("Please mount that partition before you try to backup to or restore from it.");
    18191827            finish(1);
    18201828        }
    1821         strcpy(tmp1, bkpinfo->nfs_remote_dir);
     1829        strcpy(tmp1, bkpinfo->netfs_remote_dir);
    18221830        if (!popup_and_get_string
    18231831            ("Directory", "Which directory within that mountpoint?", tmp1,
     
    18261834            finish(1);
    18271835        }
    1828         strcpy(bkpinfo->nfs_remote_dir, tmp1);
     1836        strcpy(bkpinfo->netfs_remote_dir, tmp1);
    18291837
    18301838        // check whether writable - we better remove surrounding spaces for this
    1831         strip_spaces(bkpinfo->nfs_remote_dir);
     1839        strip_spaces(bkpinfo->netfs_remote_dir);
    18321840
    18331841        if (!popup_and_get_string
     
    18431851            bkpinfo->media_size[i] = 650;
    18441852        }
    1845         log_msg(3, "Just set nfs_remote_dir to %s",
    1846                 bkpinfo->nfs_remote_dir);
     1853        log_msg(3, "Just set netfs_remote_dir to %s",
     1854                bkpinfo->netfs_remote_dir);
    18471855        log_msg(3, "isodir is still %s", bkpinfo->isodir);
    18481856        break;
     
    19611969            finish(1);
    19621970        }
    1963         mr_asprintf(&tmp, "%s", list_of_NFS_mounts_only());
     1971        mr_asprintf(&tmp, "%s", list_of_NETFS_mounts_only());
    19641972        if (strlen(tmp) > 2) {
    19651973            if (bkpinfo->exclude_paths[0]) {
     
    20332041
    20342042    if (bkpinfo->backup_media_type == iso
    2035         || bkpinfo->backup_media_type == nfs) {
     2043        || bkpinfo->backup_media_type == netfs) {
    20362044        g_ISO_restore_mode = TRUE;
    20372045    }
     
    20392047// skip
    20402048#else
    2041     if (bkpinfo->backup_media_type == nfs) {
    2042         log_msg(3, "I think the NFS mount is mounted at %s",
     2049    if (bkpinfo->backup_media_type == netfs) {
     2050        log_msg(3, "I think the Remote mount is mounted at %s",
    20432051                bkpinfo->isodir);
    20442052    }
    20452053    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);
    20492058    }
    20502059#endif
     
    20872096 */
    20882097/**
    2089  * Get a space-separated list of NFS devices and mounts.
     2098 * Get a space-separated list of NETFS devices and mounts.
    20902099 * @return The list created.
    20912100 * @note The return value points to static data that will be overwritten with each call.
    20922101 */
    2093 char *list_of_NFS_devices_and_mounts(void)
     2102char *list_of_NETFS_devices_and_mounts(void)
    20942103{
    20952104    char *exclude_these_devices = NULL;
     
    20972106    static char result_sz[1024];
    20982107
    2099     mr_asprintf(&exclude_these_directories,"%s",list_of_NFS_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;}'"));
    21012110    snprintf(result_sz, 1023, "%s %s", exclude_these_directories, exclude_these_devices);
    21022111    mr_free(exclude_these_devices);
     
    21092118
    21102119/**
    2111  * Get a space-separated list of NFS mounts.
     2120 * Get a space-separated list of NETFS mounts.
    21122121 * @return The list created.
    21132122 * @note The return value points to static data that will be overwritten with each call.
    21142123 * @bug Even though we only want the mounts, the devices are still checked.
    21152124 */
    2116 char *list_of_NFS_mounts_only(void)
     2125char *list_of_NETFS_mounts_only(void)
    21172126{
    21182127    char *exclude_these_directories = NULL;
    21192128    static char result_sz[512];
    21202129
    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;}'"));
    21222131    snprintf(result_sz, 511, "%s", exclude_these_directories);
    21232132    mr_free(exclude_these_directories);
     
    21762185    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;}'"));
    21772186#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;}'"));
    21792188#endif
    21802189
     
    26062615    malloc_string(command);
    26072616    malloc_string(fdisk);
    2608     log_msg(0, "Looking for partition table format type");
    26092617    sprintf(fdisk, "/sbin/parted2fdisk");
    2610     log_msg(1, "Using %s", fdisk);
    26112618    sprintf(command, "%s -l %s | grep 'EFI GPT'", fdisk, drive);
    26122619    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  
    3838int eject_device(char *);
    3939
    40 char *list_of_NFS_devices_and_mounts();
    41 char *list_of_NFS_mounts_only();
     40char *list_of_NETFS_devices_and_mounts();
     41char *list_of_NETFS_mounts_only();
    4242
    4343void sensibly_set_tmpdir_and_scratchdir();
  • branches/2.2.9/mondo/src/common/libmondo-files-EXT.h

    r2053 r2380  
    3333extern long size_of_all_biggiefiles_K();
    3434extern void copy_mondo_and_mindi_stuff_to_scratchdir();
    35 extern void store_nfs_config();
     35extern void store_netfs_config();
    3636
    3737
  • branches/2.2.9/mondo/src/common/libmondo-files.c

    r2242 r2380  
    10911091
    10921092/**
    1093  * Store the client's NFS configuration in files to be restored at restore-time.
    1094  * Assumes that @c bkpinfo->media_type = nfs, 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.
    10951095 * @param bkpinfo The backup information structure. Fields used:
    1096  * - @c nfs_mount
    1097  * - @c nfs_remote_dir
     1096 * - @c netfs_mount
     1097 * - @c netfs_remote_dir
    10981098 * - @c tmpdir
    10991099 */
    1100 void store_nfs_config()
     1100void store_netfs_config()
    11011101{
    11021102
    11031103    /*@ buffers ******** */
    1104     char nfs_dev[MAX_STR_LEN];
     1104    char netfs_dev[MAX_STR_LEN];
    11051105    char mac_addr[MAX_STR_LEN];
    1106     char nfs_mount[MAX_STR_LEN];
    1107     char nfs_client_ipaddr[MAX_STR_LEN];
    1108     char nfs_client_netmask[MAX_STR_LEN];
    1109     char nfs_client_broadcast[MAX_STR_LEN];
    1110     char nfs_client_defgw[MAX_STR_LEN];
    1111     char nfs_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];
    11121112    char tmp[MAX_STR_LEN];
    11131113    char command[MAX_STR_LEN * 2];
     
    11161116    char *p;
    11171117
    1118     log_it("Storing NFS configuration");
    1119     strcpy(tmp, bkpinfo->nfs_mount);
     1118    log_it("Storing Network configuration");
     1119    strcpy(tmp, bkpinfo->netfs_mount);
    11201120    p = strchr(tmp, ':');
    11211121    if (!p) {
    11221122        fatal_error
    1123             ("NFS mount 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");
    11241124    }
    11251125    *(p++) = '\0';
    1126     strcpy(nfs_server_ipaddr, tmp);
    1127     strcpy(nfs_mount, p);
     1126    strcpy(netfs_server_ipaddr, tmp);
     1127    strcpy(netfs_mount, p);
    11281128
    11291129    /* BERLIOS : there is a bug #67 here as it only considers the first NIC */
    11301130    sprintf(command,
    11311131            "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\n' | head -n1 | cut -d' ' -f1");
    1132     strcpy(nfs_dev, call_program_and_get_last_line_of_output(command));
     1132    strcpy(netfs_dev, call_program_and_get_last_line_of_output(command));
    11331133    sprintf(command,
    11341134            "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f7 | cut -d':' -f2");
    1135     strcpy(nfs_client_ipaddr,
     1135    strcpy(netfs_client_ipaddr,
    11361136           call_program_and_get_last_line_of_output(command));
    11371137    sprintf(command,
    11381138            "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f9 | cut -d':' -f2");
    1139     strcpy(nfs_client_netmask,
     1139    strcpy(netfs_client_netmask,
    11401140           call_program_and_get_last_line_of_output(command));
    11411141    sprintf(command,
    11421142            "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f8 | cut -d':' -f2");
    1143     strcpy(nfs_client_broadcast,
     1143    strcpy(netfs_client_broadcast,
    11441144           call_program_and_get_last_line_of_output(command));
    11451145    sprintf(command,
    11461146            "route -n | grep '^0.0.0.0' | awk '{print $2}'");
    1147     strcpy(nfs_client_defgw,
     1147    strcpy(netfs_client_defgw,
    11481148           call_program_and_get_last_line_of_output(command));
    11491149    sprintf(tmp,
    1150             "nfs_client_ipaddr=%s; nfs_server_ipaddr=%s; nfs_mount=%s",
    1151             nfs_client_ipaddr, nfs_server_ipaddr, nfs_mount);
    1152     if (strlen(nfs_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) {
    11531153        fatal_error
    1154             ("Unable to find ethN (eth0, eth1, ...) adapter via NFS mount you specified.");
     1154            ("Unable to find ethN (eth0, eth1, ...) adapter via Network mount you specified.");
    11551155    }
    11561156    /********
    1157     * If the NFS device that found above is a bonded device,
     1157    * If the Network device that found above is a bonded device,
    11581158    * we need to replace it with an ethN device or the
    1159     * networking will not start during an NFS restore.
     1159    * networking will not start during an Network restore.
    11601160    *
    1161     * If the NFS device in nfs_dev begins with the word "bond", or alb or aft
    1162     * look for the corresponding slave ethN device and copy it to nfs_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.
    11631163    * Using the common MAC address
    11641164    ********/
    1165     if (!strncmp(nfs_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", nfs_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);
    11671167        sprintf(command,
    1168                 "ifconfig %s | awk '{print $5}' | head -n1", nfs_dev);
     1168                "ifconfig %s | awk '{print $5}' | head -n1", netfs_dev);
    11691169        strcpy(mac_addr, call_program_and_get_last_line_of_output(command));
    11701170        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);
    11931196    sprintf(tmp, "%s/ISO-PREFIX", bkpinfo->tmpdir);
    11941197    write_one_liner_data_file(tmp, bkpinfo->prefix);
    1195     log_it("Finished storing NFS configuration");
     1198    log_it("Finished storing Network configuration");
    11961199}
    11971200
  • branches/2.2.9/mondo/src/common/libmondo-files.h

    r2053 r2380  
    3333
    3434void copy_mondo_and_mindi_stuff_to_scratchdir();
    35 void store_nfs_config();
     35void store_netfs_config();
    3636void estimate_noof_media_required(long);
    3737bool is_this_file_compressed(char *);
  • branches/2.2.9/mondo/src/common/libmondo-fork.c

    r2226 r2380  
    133133    old_stderr[0] = '\0';
    134134
    135     if (bkpinfo->nfs_user) {
    136         mr_asprintf(&tmp1, "su - %s -c \"%s\"", bkpinfo->nfs_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);
    137137    } else {
    138138        mr_asprintf(&tmp1, "%s", basic_call);
  • branches/2.2.9/mondo/src/common/libmondo-mountlist.c

    r2371 r2380  
    390390            continue;
    391391        }
     392        log_msg(2, "Processing partition %s on %s #%d in mountlist", device, drive, pos);
    392393        /* gap in the partition list? */
    393394        if (curr_part_no - prev_part_no > 1) {
     
    483484    if (res == 0) {
    484485        mr_free(flaws_str);
     486        log_msg(2, "Fine, no error in evaluate_drive_within_mountlist");
    485487        return (NULL);
    486488    } else {
     489        log_msg(2, "Error in evaluate_drive_within_mountlist: %s", flaws_str);
    487490        return (flaws_str);
    488491    }
  • branches/2.2.9/mondo/src/common/libmondo-string.c

    r2355 r2380  
    11191119        mr_asprintf(&type_of_backup, "ISO");
    11201120        break;
    1121     case nfs:
    1122         mr_asprintf(&type_of_backup, "nfs");
     1121    case netfs:
     1122        mr_asprintf(&type_of_backup, "netfs");
    11231123        break;
    11241124    case usb:
  • branches/2.2.9/mondo/src/common/libmondo-tools.c

    r2348 r2380  
    395395 * - Used: @c bkpinfo->make_cd_use_lilo
    396396 * - Used: @c bkpinfo->media_device
    397  * - Used: @c bkpinfo->nfs_mount
     397 * - Used: @c bkpinfo->netfs_mount
    398398 * - Used: @c bkpinfo->nonbootable_backup
    399399 * - Used: @c bkpinfo->scratchdir
     
    668668    }                           // end of iso code
    669669
    670     if (bkpinfo->backup_media_type == nfs) {
    671         strcpy(hostname, bkpinfo->nfs_mount);
     670    if (bkpinfo->backup_media_type == netfs) {
     671        strcpy(hostname, bkpinfo->netfs_mount);
    672672        colon = strchr(hostname, ':');
    673673        if (!colon) {
    674             log_it("nfs mount doesn't have a colon in it");
     674            log_it("netfs mount doesn't have a colon in it");
    675675            retval++;
    676676        } else {
     
    680680            hent = gethostbyname(hostname);
    681681            if (!hent) {
    682                 log_it("Can't resolve NFS mount (%s): %s", hostname,
     682                log_it("Can't resolve Network mount (%s): %s", hostname,
    683683                       hstrerror(h_errno));
    684684                retval++;
    685685            } else {
    686686                mr_asprintf(&ip_address, "%s", inet_ntoa((struct in_addr) *((struct in_addr *) hent->h_addr)));
    687                 mr_strcat(ip_address, strchr(bkpinfo->nfs_mount, ':'));
    688                 strcpy(bkpinfo->nfs_mount, ip_address);
     687                mr_strcat(ip_address, strchr(bkpinfo->netfs_mount, ':'));
     688                strcpy(bkpinfo->netfs_mount, ip_address);
    689689                paranoid_free(ip_address);
    690690            }
    691691        }
    692         store_nfs_config();
     692        store_netfs_config();
    693693    }
    694694
     
    759759    }
    760760    g_current_media_number = 1;
    761     bkpinfo->postnuke_tarball[0] = bkpinfo->nfs_mount[0] = '\0';
     761    bkpinfo->postnuke_tarball[0] = bkpinfo->netfs_mount[0] = '\0';
    762762    return (res);
    763763}
     
    846846    bkpinfo->call_after_iso[0] = '\0';
    847847    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';
    851852    bkpinfo->postnuke_tarball[0] = '\0';
    852853    bkpinfo->wipe_media_first = FALSE;
  • branches/2.2.9/mondo/src/common/libmondo-verify.c

    r2242 r2380  
    10551055 * - @c bkpinfo->manual_cd_tray
    10561056 * - @c bkpinfo->media_device
    1057  * - @c bkpinfo->nfs_remote_dir
     1057 * - @c bkpinfo->netfs_remote_dir
    10581058 * - @c bkpinfo->tmpdir
    10591059 * - @c bkpinfo->verify_data
     
    10901090
    10911091    sprintf(mountpoint, "%s/cdrom", bkpinfo->tmpdir);
    1092     sprintf(fname, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->nfs_remote_dir,
     1092    sprintf(fname, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->netfs_remote_dir,
    10931093            bkpinfo->prefix, g_current_media_number);
    10941094
  • branches/2.2.9/mondo/src/common/mondostructures.h

    r2226 r2380  
    183183    dvd,                        ///< Back up to DVD+R[W] or DVD-R[W] disks.
    184184    cdstream,                   ///< Back up to recordable CDs but treat them like a tape streamer.
    185     nfs,                        ///< Back up to an NFS mount on the local subnet.
     185    netfs,                      ///< Back up to an NETFS mount on the local subnet.
    186186    tape,                       ///< Back up to tapes.
    187187    usb,                        ///< Back up to USB devices.
     
    558558
    559559  /**
    560    * The NFS mount to back up to/restore from.
    561    * If backup_media_type is not @b nfs, 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.
    562562   * It must contain a colon, and the server's address should be in dotted-decimal IP
    563563   * address form. (Domain names will be resolved in post_param_configuration().)
    564564   */
    565     char nfs_mount[MAX_STR_LEN];
    566 
    567   /**
    568    * The directory, relative to the root of @p nfs_mount, to put
     565    char netfs_mount[MAX_STR_LEN];
     566
     567  /**
     568   * The directory, relative to the root of @p netfs_mount, to put
    569569   * the backups in.
    570570   */
    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;
    577582
    578583  /**
  • branches/2.2.9/mondo/src/common/newt-specific.c

    r2374 r2380  
    101101     g_xmondo_stdout[MAX_NEWT_COMMENT_LEN]; ///< .... @bug Unneeded w/current XMondo.
    102102    bool g_called_by_xmondo = FALSE;    ///< @bug Unneeded w/current XMondo.
    103     char *g_selfmounted_isodir; ///< Holds the NFS mountpoint if mounted via mondoarchive.
     103    char *g_selfmounted_isodir; ///< Holds the NETFS mountpoint if mounted via mondoarchive.
    104104
    105105/* @} - end of globalGroup */
     
    445445        }
    446446        /* Free all allocated strings in bkpinfo */
    447         mr_free(bkpinfo->nfs_user);
     447        mr_free(bkpinfo->netfs_user);
     448        mr_free(bkpinfo->netfs_proto);
    448449
    449450        /* Then free the structure */
     
    12521253 * Ask the user which backup media type they would like to use.
    12531254 * 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 nfs,
     1255 * @c tape, @c cdstream, @c udev (only when @p g_text_mode is TRUE), @c netfs,
    12551256 * and @c iso.
    12561257 * @param restoring TRUE if we're restoring, FALSE if we're backing up.
     
    12671268        char *minimsg_sz;
    12681269        static t_bkptype possible_bkptypes[] =
    1269             { none, cdr, cdrw, dvd, tape, cdstream, udev, nfs, iso };
     1270            { none, cdr, cdrw, dvd, tape, cdstream, udev, netfs, iso };
    12701271        static char *possible_responses[] =
    12711272            { "none", "cdr", "cdrw", "dvd", "tape", "cdstream", "udev",
    1272 "nfs", "iso", NULL };
     1273"netfs", "iso", NULL };
    12731274        char *outstr;
    12741275        t_bkptype backup_type;
     
    13281329        b4 = newtButton(17, 5, "USB Key/Disk");
    13291330        b5 = newtButton(1, 5, " DVD disks ");
    1330         b6 = newtButton(17, 9, " NFS mount ");
     1331        b6 = newtButton(17, 9, " Net mount ");
    13311332        b7 = newtButton(1, 13, " Hard disk ");
    13321333        b8 = newtButton(17, 13, "    Exit   ");
     
    13481349            output = dvd;
    13491350        } else if (b_res == b6) {
    1350             output = nfs;
     1351            output = netfs;
    13511352        } else if (b_res == b7) {
    13521353            output = iso;
  • branches/2.2.9/mondo/src/include/my-stuff.h

    r2237 r2380  
    318318#define DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE  "/dev/md"
    319319#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"
    321321#define ALT_TAPE        "/dev/ht0"
    322322#define MKE2FS_OR_NEWFS "mke2fs"
  • branches/2.2.9/mondo/src/mondorestore/mondo-rstr-newt.c

    r2355 r2380  
    22972297        strcpy(isodir_path, "/");
    22982298    }
    2299     if (does_file_exist("/tmp/NFS-SERVER-PATH")) {
    2300         strcpy(isodir_device, last_line_of_file("/tmp/NFS-SERVER-MOUNT"));
    2301         strcpy(isodir_format, "nfs");
    2302         strcpy(isodir_path, last_line_of_file("/tmp/NFS-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"));
    23032303    }
    23042304    if (nuke_me_please) {
  • branches/2.2.9/mondo/src/mondorestore/mondo-rstr-tools.c

    r2242 r2380  
    614614    }
    615615
    616     if (bkpinfo->backup_media_type == nfs) {
    617         log_msg(2, "Mounting for NFS thingy");
     616    if (bkpinfo->backup_media_type == netfs) {
     617        log_msg(2, "Mounting for Network thingy");
    618618        log_msg(2, "isodir = %s", bkpinfo->isodir);
    619619        if ((!bkpinfo->isodir[0] || !strcmp(bkpinfo->isodir, "/"))
     
    624624#ifdef __FreeBSD__
    625625        sprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir,
    626             bkpinfo->nfs_remote_dir, bkpinfo->prefix, g_current_media_number);
     626            bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number);
    627627        mddev = make_vn(mount_cmd);
    628628        sprintf(mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev);
    629629#else
    630630        sprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s",
    631             bkpinfo->isodir, bkpinfo->nfs_remote_dir,
     631            bkpinfo->isodir, bkpinfo->netfs_remote_dir,
    632632            bkpinfo->prefix, g_current_media_number, MNT_CDROM);
    633633#endif
     
    805805            strcpy(bkpinfo->prefix,STD_PREFIX);
    806806    }
    807 } else if (!strcmp(value, "nfs")) {
    808     bkpinfo->backup_media_type = nfs;
     807} else if (!strcmp(value, "netfs")) {
     808    bkpinfo->backup_media_type = netfs;
    809809    bkpinfo->please_dont_eject = TRUE;
    810810    if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) {
     
    816816       ("cat /proc/cmdline"), "pxe")) {
    817817        /* We need to override prefix value in PXE mode as it's
    818         * already done in start-nfs */
     818        * already done in start-netfs */
    819819        envtmp1 = getenv("imgname");
    820820        if (envtmp1 == NULL) {
     
    961961}
    962962
    963 if (bkpinfo->backup_media_type == nfs) {
     963if (bkpinfo->backup_media_type == netfs) {
    964964    if (!cfgf) {
    965         log_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);
    966         log_msg(2, "nfs_remote_dir remains %s",
    967                 bkpinfo->nfs_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);
    968968        log_msg(2,
    969969                "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place");
    970970    } 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);
    977978    }
    978979    if (strstr(call_program_and_get_last_line_of_output
    979980        ("cat /proc/cmdline"), "pxe")) {
    980981        /* We need to override values in PXE mode as it's
    981         * already done in start-nfs */
    982         envtmp1 = getenv("nfsmount");
     982        * already done in start-netfs */
     983        envtmp1 = getenv("netfsmount");
    983984        if (envtmp1 == NULL) {
    984             fatal_error("no nfsmount variable in environment");
     985            fatal_error("no netfsmount variable in environment");
    985986        }
    986987        envtmp2 = getenv("dirimg");
     
    988989            fatal_error("no dirimg variable in environment");
    989990        }
    990         strcpy(bkpinfo->nfs_mount,envtmp1);
    991         strcpy(bkpinfo->nfs_remote_dir,envtmp2);
     991        strcpy(bkpinfo->netfs_mount,envtmp1);
     992        strcpy(bkpinfo->netfs_remote_dir,envtmp2);
    992993    }
    993994} else if (bkpinfo->backup_media_type == iso) {
  • branches/2.2.9/mondo/src/mondorestore/mondorestore.c

    r2373 r2380  
    964964
    965965    strcpy(bkpinfo->restore_path, "/");
    966     if (!g_restoring_live_from_cd && !g_restoring_live_from_nfs) {
     966    if (!g_restoring_live_from_cd && !g_restoring_live_from_netfs) {
    967967        popup_and_OK
    968968            ("Please insert tape/CD/USB Key, then hit 'OK' to continue.");
    969969        sleep(1);
    970970    }
    971     if (!g_restoring_live_from_nfs) {
     971    if (!g_restoring_live_from_netfs) {
    972972        interactively_obtain_media_parameters_from_user(FALSE);
    973973    }
     
    990990    load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    991991
    992     if (!g_restoring_live_from_nfs && (filelist = process_filelist_and_biggielist())) {
     992    if (!g_restoring_live_from_netfs && (filelist = process_filelist_and_biggielist())) {
    993993        save_filelist(filelist, "/tmp/selected-files.txt");
    994994        strcpy(old_restpath, bkpinfo->restore_path);
     
    30963096        mount_boot_if_necessary();  /* for Gentoo users */
    30973097        log_msg(2, "Still here.");
    3098         if (bkpinfo->backup_media_type == nfs) {
    3099             g_restoring_live_from_nfs = TRUE;
     3098        if (bkpinfo->backup_media_type == netfs) {
     3099            g_restoring_live_from_netfs = TRUE;
    31003100        }
    31013101        log_msg(2, "Calling restore_to_live_filesystem()");
     
    31233123        // BCO:To be reviewed
    31243124        if ((bkpinfo->restore_mode == compare) || (bkpinfo->restore_mode == nuke)) {
    3125             if (bkpinfo->backup_media_type == nfs
    3126                 && !is_this_device_mounted(bkpinfo->nfs_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);
    31283128                sprintf(bkpinfo->isodir, "/tmp/isodir");
    31293129                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);
    31323136                run_program_and_log_output(tmp, 1);
    31333137            }
  • branches/2.2.9/mondo/src/mondorestore/mr-externs.h

    r2350 r2380  
    107107extern bool g_text_mode;
    108108extern bool g_restoring_live_from_cd;
    109 extern bool g_restoring_live_from_nfs;
     109extern bool g_restoring_live_from_netfs;
    110110extern int fput_string_one_char_at_a_time(FILE *, char *);
    111111extern char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res);
Note: See TracChangeset for help on using the changeset viewer.