> Date: Fri, 11 Nov 2016 09:09:02 +0000
> From: [email protected] (akhiezer)
> Subject: Re: [lfs-support] how to test rw/ro/&c of a file [Was: "I don't
>  need to know"]
>
> > From: Paul Rogers <[email protected]>
> > Date: Thu, 10 Nov 2016 17:29:56 -0800
> > Subject: [lfs-support] how to test rw/ro/&c of a file [Was: "I don't need to
> >     know"]
> >
> > > $ help test
> > >   .
> > >   .
> > >  -w [...]
> > >   .       # &usw.
> > >   .
> > >$
> > >
> > > ?
> >
> > Didn't work for me.  Tried it first, and apparently all the bash test
> > uses is the permissions.  
> >
>
>
> Does 'mount -l [...]' give you accurate info?
>


Or, you might just try a write, to see if the fs is read-only or read-write:
====
Slackware 13.37
sl1337:/etc/rc.d/rc.S
==
Early in boot, & prior to any remount rw:
==
        .
        .
# Test to see if the root partition is read-only, like it ought to be.
READWRITE=no                                                                    
                                                                    
if touch /fsrwtestfile 2>/dev/null; then                                        
                                                                    
  rm -f /fsrwtestfile                                                           
                                                                    
  READWRITE=yes                                                                 
                                                                    
else                                                                            
                                                                    
  echo "Testing root filesystem status:  read-only filesystem"                  
                                                                    
fi                                                                              
                                                                    
        .
        .
====



akh





--
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to