home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / hp / 9332 < prev    next >
Encoding:
Text File  |  1992-08-16  |  4.0 KB  |  156 lines

  1. Newsgroups: comp.sys.hp
  2. Path: sparky!uunet!mcsun!sun4nl!alchemy!prisma!fred
  3. From: fred@cv.ruu.nl (Fred Appelman)
  4. Subject: Re: backup of NFS partitions: acces denied
  5. Sender: usenet@cv.ruu.nl (Usenet Network)
  6. Message-ID: <1992Aug17.070544.24728@cv.ruu.nl>
  7. Date: Mon, 17 Aug 1992 07:05:44 GMT
  8. References: <kirchhof.3.713982347@ph1.physik.uni-konstanz.de>
  9. Nntp-Posting-Host: triton.cv.ruu.nl
  10. Organization: University of Utrecht, 3D Computer Vision Research Group
  11. Lines: 143
  12.  
  13. In <kirchhof.3.713982347@ph1.physik.uni-konstanz.de> kirchhof@ph1.physik.uni-konstanz.de (Thomas Kirchhoff) writes:
  14.  
  15. >I want to do backups using GNU-tar on a Hp720/HPUX8.05 of NFS 
  16. >mounted partitions. This doesn't work. GNU-tar is saying 'bad filenumber' 
  17. >whenit is told to read read-protected files. I created on both HP's a userid
  18. >'backup' with uid=0 and primary groupid=3. So this should mean that i can 
  19. >read any file on the NFS-mounted partition, shouldn't it ?
  20. >The rest of the user and group id's are not the same on both machines.
  21. >So how am I supposed to do backups via NFS ?
  22. >
  23. >thomas.
  24.  
  25. The userid '0' is automatically mapped to userID NOBODY which has standard
  26. the value of -2. There are two methods to fix this. You should first ask 
  27. yourselve if you really want to backup over NFS. If you care about 
  28. performance you shouldn't. 
  29.  
  30. Solution 1 (using NFS):
  31.     You have to change the userid of the user 'nobody'  from -2 to 0.
  32.     The script below will do this for you. There are some security
  33.     riscs (so I have been told) when you map the user nobody 
  34.     from -2 to 0, but I don't know which.
  35. #! /bin/sh
  36. #---------------------------------------------------------------------------
  37. #    PATCHKERNEL    ??-???-??    Fred Appelman    <fred@cv.ruu.nl>
  38. #    rootnfs-1.0    18-Jan-90    Edwin Kremer    <edwin@cs.ruu.nl>
  39. #
  40. #    rootnfs        - enable/disable root permission over NFS by
  41. #              setting the kernel variable "_nobody" to
  42. #              0 or -2 respectively.
  43. #
  44. #---------------------------------------------------------------------------
  45. PATH='/bin:/usr/bin:/etc:/usr/etc'            ; export PATH
  46. PROG=`basename $0`
  47. #---------------------------------------------------------------------------
  48. UNIX='/hp-ux'                # specify where your UNIX kernel is
  49. ADB_OPT='-w'                # open kernel for writing
  50. ADB_CMD='W'                # write a four-byte value in decimal
  51. #---------------------------------------------------------------------------
  52.  
  53. DoMemory()
  54. {
  55.     echo "nobody/${ADB_CMD}${NOBODY}" |
  56.     adb ${ADB_OPT} ${UNIX} /dev/kmem |
  57.     Display 'MEMORY'
  58. }
  59.  
  60. DoDisk()
  61. {
  62.     echo "nobody?${ADB_CMD}${NOBODY}" |
  63.     adb ${ADB_OPT} ${UNIX} - |
  64.     Display 'DISK'
  65. }
  66.  
  67. Display()
  68. {
  69.     while read line
  70.     do
  71.         echo "$1-> $line"
  72.     done
  73. }
  74. Usage()
  75. {
  76.     echo "Usage: ${PROG}  deny|allow|inspect  memory|disk|both"
  77.     exit 1
  78. }
  79.  
  80. if [ $# -ne 2 ]
  81. then
  82.     Usage
  83. fi
  84.  
  85. case $1 in
  86.     deny)
  87.         NOBODY='-2'
  88.         ;;
  89.     allow)
  90.         NOBODY='0'
  91.         ;;
  92.     inspect)
  93.         NOBODY=''        # no need to assign a value
  94.         ADB_OPT=''        # no need to open kernel for writing
  95.         ADB_CMD='D'        # print a four-byte value in decimal
  96.         ;;
  97.     *)
  98.         Usage
  99.         ;;
  100. esac
  101.  
  102. case $2 in
  103.     memory)
  104.         DoMemory
  105.         ;;
  106.     disk)
  107.         DoDisk
  108.         ;;
  109.     both)
  110.         DoMemory
  111.         DoDisk
  112.         ;;
  113.     *)
  114.         Usage
  115.         ;;
  116. esac
  117.  
  118. exit 0
  119.  
  120. Solution 2 (not using NFS):
  121.     Run a remote backup on the NFS exporting host. Start this from
  122.     the host that has the tapeunit. The following script is what
  123.     I use myself. It runs on a host called 'odin', and backups
  124.     disks from three other hosts. You have to setup .rhosts file
  125.     to use this. This script is ofcourse just an example and
  126.     needs editing.
  127.  
  128. #!/bin/sh
  129. #
  130. #    datbackup - start backup on prisma, triton and wodan from 
  131. #                   odin.
  132.  
  133. HOST=`hostname`
  134. if [ $HOST != odin ]
  135. then
  136.     echo Must be run on odin
  137.     exit 1;
  138. fi
  139.  
  140. echo `date` Start triton
  141. remsh triton gnutar cblfz 100 odin:/dev/rmt/0mn /Userspace1
  142. echo `date` Start wodan
  143. remsh wodan gnutar cblfz 100 odin:/dev/rmt/0mn /Userspace1
  144. echo `date` Start prisma
  145. remsh prisma gnutar cblfz 100 odin:/dev/rmt/0m /Userspace1
  146. echo `date` Done
  147.  
  148.  
  149.  
  150. -- 
  151. Fred J.R. Appelman, 3D Computer Vision, Utrecht University
  152. AZU, Heidelberglaan 100, 3584 CX Utrecht, The Netherlands.
  153. Telephone: +31-30-506710 Fax: +31-30-513399
  154. e-mail: fred@cv.ruu.nl or appelman@cs.unc.edu
  155.  
  156.