<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic how to add fstab entry using script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246894#M330893</link>
    <description>dear hpux gurus,&lt;BR /&gt;would like to seek your advice. ive created few file systems. but sir, how can i create script so that i can add the entry inside fstab using .ksh script. hope to hear from you. appreciate your can share any advice to perform system administration faster. many thanks in advance. Thank You.</description>
    <pubDate>Wed, 06 Aug 2008 05:47:57 GMT</pubDate>
    <dc:creator>apple</dc:creator>
    <dc:date>2008-08-06T05:47:57Z</dc:date>
    <item>
      <title>how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246894#M330893</link>
      <description>dear hpux gurus,&lt;BR /&gt;would like to seek your advice. ive created few file systems. but sir, how can i create script so that i can add the entry inside fstab using .ksh script. hope to hear from you. appreciate your can share any advice to perform system administration faster. many thanks in advance. Thank You.</description>
      <pubDate>Wed, 06 Aug 2008 05:47:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246894#M330893</guid>
      <dc:creator>apple</dc:creator>
      <dc:date>2008-08-06T05:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246895#M330894</link>
      <description>Why wouldn't you just edit fstab manually for the few filesystems?&lt;BR /&gt;Just copy the format of existing lines.</description>
      <pubDate>Wed, 06 Aug 2008 06:15:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246895#M330894</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-08-06T06:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246896#M330895</link>
      <description>Hi Almond,&lt;BR /&gt;&lt;BR /&gt;yest makes sence on what is said because you are not going to create filesystems regularly.&lt;BR /&gt;&lt;BR /&gt;Just edit the /etc/fstab file through vi editor and place the entries required&lt;BR /&gt;&lt;BR /&gt;ie :&lt;BR /&gt;&lt;BR /&gt;/dev/vgname/lvol1 /mountpoint vxfs delaylog 0 3&lt;BR /&gt;/dev/vgname/lvol1 /mountpoint vxfs delaylog 0 2&lt;BR /&gt;/dev/vgclnpdb/lvol1 /mountpoint vxfs delaylog 0 1 .&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Aug 2008 07:46:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246896#M330895</guid>
      <dc:creator>Vijay Dsouza</dc:creator>
      <dc:date>2008-08-06T07:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246897#M330896</link>
      <description>&lt;!--!*#--&gt;Hi almond08&lt;BR /&gt;  Please have the attached file.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Aug 2008 08:23:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246897#M330896</guid>
      <dc:creator>Davis Paul</dc:creator>
      <dc:date>2008-08-06T08:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246898#M330897</link>
      <description>HI:&lt;BR /&gt;&lt;BR /&gt;Learn to use 'vi'.&lt;BR /&gt;&lt;BR /&gt;If you have need to programatically add entries to '/etc/fstab' all that is needed is something like this, at a shell command line:&lt;BR /&gt;&lt;BR /&gt;# echo "/dev/vg02/lvol1 /patches vxfs rw,suid,largefiles,delaylog,datainlog 0 2" &amp;gt;&amp;gt; /etc/fstab&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 06 Aug 2008 10:47:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246898#M330897</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-08-06T10:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246899#M330898</link>
      <description>Only vi is the best option, it will take less time than that of any scripts.&lt;BR /&gt;&lt;BR /&gt;So go for using vi editor only.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;SKR</description>
      <pubDate>Wed, 06 Aug 2008 11:16:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246899#M330898</guid>
      <dc:creator>SKR_1</dc:creator>
      <dc:date>2008-08-06T11:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246900#M330899</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Even through you can use following in script:&lt;BR /&gt;  &lt;BR /&gt;#cp -p /etc/fstab /etc/fstab.bak&lt;BR /&gt;# echo "/dev/vg02/logical volume  /mount point vxfs rw,suid,largefiles,delaylog,datainlog 0 2" &amp;gt;&amp;gt; /etc/fstab&lt;BR /&gt;#diff /etc/fstab /etc/fstab.bak&lt;BR /&gt;&lt;BR /&gt;but using VI directly is always better option.&lt;BR /&gt;&lt;BR /&gt;Cheers!!&lt;BR /&gt;Deepak</description>
      <pubDate>Wed, 06 Aug 2008 12:43:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246900#M330899</guid>
      <dc:creator>Deepak Kr</dc:creator>
      <dc:date>2008-08-06T12:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246901#M330900</link>
      <description>echo "/dev/vgname/lvol1 /mountpoint vxfs delaylog 0 3" &amp;gt;&amp;gt; /etc/fstab&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Aug 2008 17:32:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246901#M330900</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2008-08-06T17:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246902#M330901</link>
      <description>for example to add a entry like the one below&lt;BR /&gt;/dev/fd0 /media/floppy auto rw,noauto,user,sync 0 0&lt;BR /&gt;&lt;BR /&gt;I always prefer vi.. to make life simpler</description>
      <pubDate>Wed, 06 Aug 2008 20:59:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246902#M330901</guid>
      <dc:creator>Grayh</dc:creator>
      <dc:date>2008-08-06T20:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246903#M330902</link>
      <description>Sorry for bringing this up again, but why nobody gives him a simple answer?&lt;BR /&gt;&lt;BR /&gt;When I have to add several equal directories (for example nfs-mounted) to several workstations, I use a script.&lt;BR /&gt;My sh-script contains:&lt;BR /&gt;&lt;BR /&gt;cat &lt;FILE_NAME_ADD_FILE-SYSTEM&gt; &amp;gt;&amp;gt;/etc/fstab&lt;BR /&gt;mkdir &lt;NEEDED directories=""&gt;&lt;BR /&gt;mount -a&lt;BR /&gt;bdf&lt;BR /&gt;&lt;BR /&gt;my &lt;FILE_NAME_ADD_FILE-SYSTEM&gt; contains (nfs-mounted from another server):&lt;BR /&gt;&lt;BR /&gt;&lt;SERVER&gt;:&lt;DIR&gt; &lt;DIR&gt; nfs rw,bg,hard 0 0&lt;BR /&gt;&lt;BR /&gt;You can add several lines without problems.&lt;BR /&gt;&lt;BR /&gt;For an internal dir you should use:&lt;BR /&gt;&lt;BR /&gt;/dev/vg01/lvol6 /archiv vxfs rw,suid,largefiles,delaylog,datainlog 0 2&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Volkmar&lt;/DIR&gt;&lt;/DIR&gt;&lt;/SERVER&gt;&lt;/FILE_NAME_ADD_FILE-SYSTEM&gt;&lt;/NEEDED&gt;&lt;/FILE_NAME_ADD_FILE-SYSTEM&gt;</description>
      <pubDate>Mon, 18 Aug 2008 13:22:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246903#M330902</guid>
      <dc:creator>V. Nyga</dc:creator>
      <dc:date>2008-08-18T13:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246904#M330903</link>
      <description>&amp;gt;cat &lt;FILE_NAME_ADD_FILE-SYSTEM&gt; &amp;gt;&amp;gt;/etc/fstab&lt;BR /&gt;&amp;gt;mkdir &lt;NEEDED directories=""&gt;&lt;BR /&gt;&amp;gt;mount -a&lt;BR /&gt;&amp;gt;bdf&lt;BR /&gt;&lt;BR /&gt;How do these commands help????&lt;BR /&gt;why would somebdy want to do this kind of thing?&lt;BR /&gt;&lt;BR /&gt;Why won't you just vi /etc/fstab and type whatever you typed in &lt;FILE_NAME_ADD_FILE-SYSTEM&gt;. &lt;BR /&gt;&lt;BR /&gt;One scenario I can think where you need a script to append to /etc/fstab is:&lt;BR /&gt;you have a script which creates multiple filesystems. ( I wrote a script while preparing a setup with 1000+ mounted filesystems). &lt;BR /&gt;&lt;BR /&gt;The script will these tasks:&lt;BR /&gt;&lt;BR /&gt;1) create a LV ( append a number after each LV name and go on incrementing the number each time)&lt;BR /&gt;2) mkfs &lt;BR /&gt;3) create mount point ( with the number appended)&lt;BR /&gt;4) mount the newly created FS &lt;BR /&gt;5) add entry in /etc/fstab so that the mounts are done during a reboot.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FILE_NAME_ADD_FILE-SYSTEM&gt;&lt;/NEEDED&gt;&lt;/FILE_NAME_ADD_FILE-SYSTEM&gt;</description>
      <pubDate>Mon, 18 Aug 2008 15:28:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246904#M330903</guid>
      <dc:creator>Srimalik</dc:creator>
      <dc:date>2008-08-18T15:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246905#M330904</link>
      <description>I agree that modifying /etc/fstab with a script is asking for trouble. But when dealing with several entries at once and more than one server it is OK to do it.&lt;BR /&gt;&lt;BR /&gt;I would add that whenever you add lines to /etc/fstab, sanitize them first by using "mount -V". You could also test their syntax by trying to mount the new entries by using the mountpoint only such as "mount /newdir".</description>
      <pubDate>Mon, 18 Aug 2008 15:40:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246905#M330904</guid>
      <dc:creator>TTr</dc:creator>
      <dc:date>2008-08-18T15:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to add fstab entry using script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246906#M330905</link>
      <description>&lt;!--!*#--&gt;Hey;&lt;BR /&gt;&lt;BR /&gt;While editing the fstab file is an option, I'm not sure we can say it's always preferable.  Occasionally, I'm tasked with generating a new system that looks like an old system - migration, update, etc.  Some of these source systems have hundreds of filesystems that are changed by one or two characters from their source counterparts.  This is something that just begs for a script.  &lt;BR /&gt;&lt;BR /&gt;If, however, you're not facing something like this, you probably want to edit the fstab file.  Relying on script will limit an admin's growth potential. &lt;BR /&gt;&lt;BR /&gt;The scripts that I use, generally inline, all use a datafile.  The datafile will look like:&lt;BR /&gt;&lt;BR /&gt;${vg} ${lv} ${mp}|${owner}&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;vgSAP     sapmnt    2048 /sapmnt/INST&lt;BR /&gt;vgsap     oracle    4096 /oracle&lt;BR /&gt;vgsapdata ora_data1 8192 oraINST:dba&lt;BR /&gt;&lt;BR /&gt;The logic is fairly straight forward - which is why this tends to be rewritten on the fly all the time:&lt;BR /&gt;&lt;BR /&gt;cat ${table} | while read vg lv size mp&lt;BR /&gt;do&lt;BR /&gt;echo "############################"&lt;BR /&gt;printf "%-20s %-35s %8d %s\n" ${vg} ${lv} ${size} ${mp}&lt;BR /&gt;lvcreate -L ${size} -n ${lv} ${vg}&lt;BR /&gt;echo ${mp} | grep ":" &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;   [[ ${size} -gt 2048 ]] &amp;amp;&amp;amp; args="-o largefiles" || args=""&lt;BR /&gt;   newfs -F vxfs ${args} /dev/${vg}/r${lv}&lt;BR /&gt;   [[ ! -d ${mp} ]] &amp;amp;&amp;amp; mkdir -p -m 755 ${mp}&lt;BR /&gt;   [[ ${size} -gt 2048 ]] &amp;amp;&amp;amp; args=",largefiles" || args=""&lt;BR /&gt;   echo "/dev/${vg}/${lv} ${mp} vxfs delaylog${args} 0 2" &amp;gt;&amp;gt; /etc/fstab&lt;BR /&gt;   mount ${mp}&lt;BR /&gt;else&lt;BR /&gt;   chown ${owner} /dev/${vg}/r${lv}&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Doing something like this makes a complete filesystem reorg take minutes vs hours if doing by hand or days if doing by sam.&lt;BR /&gt;&lt;BR /&gt;On more than one occasion, scripts like this have made DR exercises succesful where they otherwise would have failed.&lt;BR /&gt;&lt;BR /&gt;Doug</description>
      <pubDate>Mon, 18 Aug 2008 18:02:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-add-fstab-entry-using-script/m-p/4246906#M330905</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2008-08-18T18:02:13Z</dc:date>
    </item>
  </channel>
</rss>

