<?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 Re: one-liner to add mount options to two mount points in fstab in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238195#M52065</link>
    <description>&lt;!--!*#--&gt;&amp;gt; [...] I only want to do it for the tmp and&lt;BR /&gt;&amp;gt; var mount point [...]&lt;BR /&gt;&lt;BR /&gt;My regular expression skill is near-minimal,&lt;BR /&gt;but you might try something like:&lt;BR /&gt;&lt;BR /&gt;sed -e '/\/tmp\|\/var/s/,acl/,acl,nodev,nosuid/'&lt;BR /&gt;&lt;BR /&gt;$ cat fstab&lt;BR /&gt;LABEL=/tmp1 /tmp ext3 defaults,acl 1 2&lt;BR /&gt;LABEL=/usr1 /usr ext3 defaults,acl 1 2&lt;BR /&gt;LABEL=/var1 /var ext3 defaults,acl 1 2&lt;BR /&gt;LABEL=SW-cciss/c0d0p2 swap swap defaults,acl 0 0&lt;BR /&gt;&lt;BR /&gt;$ sed -e '/\/tmp\|\/var/s/,acl/,acl,nodev,nosuid/' &amp;lt; fstab&lt;BR /&gt;LABEL=/tmp1 /tmp ext3 defaults,acl,nodev,nosuid 1 2&lt;BR /&gt;LABEL=/usr1 /usr ext3 defaults,acl 1 2&lt;BR /&gt;LABEL=/var1 /var ext3 defaults,acl,nodev,nosuid 1 2&lt;BR /&gt;LABEL=SW-cciss/c0d0p2 swap swap defaults,acl 0 0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;      man sed&lt;BR /&gt;&lt;BR /&gt;Adding some white space around those names&lt;BR /&gt;might be wise, especially if you expect plain&lt;BR /&gt;"/tmp" or "/var" to match too many things.</description>
    <pubDate>Tue, 04 May 2010 15:16:26 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2010-05-04T15:16:26Z</dc:date>
    <item>
      <title>one-liner to add mount options to two mount points in fstab</title>
      <link>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238191#M52061</link>
      <description>I'm trying to add nodev and nosuid mount options for temporary mount points in /etc/fstab.  Is there a one-liner that could be used to do the following?:&lt;BR /&gt;&lt;BR /&gt;Before:&lt;BR /&gt;&lt;BR /&gt;LABEL=/tmp1             /tmp                   ext3    defaults,acl        1 2&lt;BR /&gt;&lt;BR /&gt;LABEL=/tmp1             /tmp                    ext3    defaults,acl,nodev,nosuid        1 2&lt;BR /&gt;&lt;BR /&gt;I'm trying to do it using sed -i, but I am unable to get it give me desired output.  Sorry if this is a duplicate, but I couldn't find a thread for exactly what I'm trying to do.</description>
      <pubDate>Tue, 04 May 2010 13:21:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238191#M52061</guid>
      <dc:creator>Sean M.</dc:creator>
      <dc:date>2010-05-04T13:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: one-liner to add mount options to two mount points in fstab</title>
      <link>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238192#M52062</link>
      <description>It might make a difference on the command, so:&lt;BR /&gt;&lt;BR /&gt;there is 1 tab between label and mount, and 2 tabs between mount point and file system type.</description>
      <pubDate>Tue, 04 May 2010 13:24:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238192#M52062</guid>
      <dc:creator>Sean M.</dc:creator>
      <dc:date>2010-05-04T13:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: one-liner to add mount options to two mount points in fstab</title>
      <link>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238193#M52063</link>
      <description>&lt;!--!*#--&gt;Any reason not to use a simple substitution?&lt;BR /&gt;&lt;BR /&gt;$ echo 'LABEL=/tmp1 /tmp ext3 defaults,acl 1 2' | \&lt;BR /&gt;&amp;gt; sed -e 's/,acl/,acl,nodev,nosuid/'&lt;BR /&gt;LABEL=/tmp1 /tmp ext3 defaults,acl,nodev,nosuid 1 2&lt;BR /&gt;&lt;BR /&gt;With my weak psychic powers, I can't see the&lt;BR /&gt;file.  Are there any instances of ",acl"&lt;BR /&gt;which you don't wish to change?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; It might make a difference [...]&lt;BR /&gt;&lt;BR /&gt;Not here, I believe.</description>
      <pubDate>Tue, 04 May 2010 14:12:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238193#M52063</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-05-04T14:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: one-liner to add mount options to two mount points in fstab</title>
      <link>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238194#M52064</link>
      <description>Below is my current fstab.  I only want to do it for the tmp and var mount point to fix an audit finding.&lt;BR /&gt;&lt;BR /&gt;LABEL=/1                /                       ext3    defaults,acl        1 1&lt;BR /&gt;/dev/cciss/c0d1p5       /backup                 ext3    defaults        1 2&lt;BR /&gt;LABEL=/boot1            /boot                   ext3    defaults,acl        1 2&lt;BR /&gt;none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;BR /&gt;none                    /dev/shm                tmpfs   defaults        0 0&lt;BR /&gt;LABEL=/home1            /home                   ext3    defaults,acl        1 2&lt;BR /&gt;LABEL=/opt1             /opt                    ext3    defaults,acl        1 2&lt;BR /&gt;none                    /proc                   proc    defaults        0 0&lt;BR /&gt;none                    /sys                    sysfs   defaults        0 0&lt;BR /&gt;LABEL=/tmp1             /tmp                    ext3    defaults,acl        1 2&lt;BR /&gt;LABEL=/usr1             /usr                    ext3    defaults,acl        1 2&lt;BR /&gt;LABEL=/var1             /var                    ext3    defaults,acl        1 2&lt;BR /&gt;LABEL=SW-cciss/c0d0p2   swap                    swap    defaults,acl        0 0&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Tue, 04 May 2010 14:17:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238194#M52064</guid>
      <dc:creator>Sean M.</dc:creator>
      <dc:date>2010-05-04T14:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: one-liner to add mount options to two mount points in fstab</title>
      <link>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238195#M52065</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] I only want to do it for the tmp and&lt;BR /&gt;&amp;gt; var mount point [...]&lt;BR /&gt;&lt;BR /&gt;My regular expression skill is near-minimal,&lt;BR /&gt;but you might try something like:&lt;BR /&gt;&lt;BR /&gt;sed -e '/\/tmp\|\/var/s/,acl/,acl,nodev,nosuid/'&lt;BR /&gt;&lt;BR /&gt;$ cat fstab&lt;BR /&gt;LABEL=/tmp1 /tmp ext3 defaults,acl 1 2&lt;BR /&gt;LABEL=/usr1 /usr ext3 defaults,acl 1 2&lt;BR /&gt;LABEL=/var1 /var ext3 defaults,acl 1 2&lt;BR /&gt;LABEL=SW-cciss/c0d0p2 swap swap defaults,acl 0 0&lt;BR /&gt;&lt;BR /&gt;$ sed -e '/\/tmp\|\/var/s/,acl/,acl,nodev,nosuid/' &amp;lt; fstab&lt;BR /&gt;LABEL=/tmp1 /tmp ext3 defaults,acl,nodev,nosuid 1 2&lt;BR /&gt;LABEL=/usr1 /usr ext3 defaults,acl 1 2&lt;BR /&gt;LABEL=/var1 /var ext3 defaults,acl,nodev,nosuid 1 2&lt;BR /&gt;LABEL=SW-cciss/c0d0p2 swap swap defaults,acl 0 0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;      man sed&lt;BR /&gt;&lt;BR /&gt;Adding some white space around those names&lt;BR /&gt;might be wise, especially if you expect plain&lt;BR /&gt;"/tmp" or "/var" to match too many things.</description>
      <pubDate>Tue, 04 May 2010 15:16:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238195#M52065</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-05-04T15:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: one-liner to add mount options to two mount points in fstab</title>
      <link>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238196#M52066</link>
      <description>Thanks!&lt;BR /&gt;&lt;BR /&gt;I don't have to worry about multiple tmp\var mount points so your sed line will work perfectly.</description>
      <pubDate>Tue, 04 May 2010 15:24:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238196#M52066</guid>
      <dc:creator>Sean M.</dc:creator>
      <dc:date>2010-05-04T15:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: one-liner to add mount options to two mount points in fstab</title>
      <link>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238197#M52067</link>
      <description>closed</description>
      <pubDate>Tue, 04 May 2010 15:25:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/one-liner-to-add-mount-options-to-two-mount-points-in-fstab/m-p/5238197#M52067</guid>
      <dc:creator>Sean M.</dc:creator>
      <dc:date>2010-05-04T15:25:28Z</dc:date>
    </item>
  </channel>
</rss>

