LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-13-2019, 08:58 PM   #1
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
encfs filesystem is mounting as read only instead of read write


I created an encrypted file system a couple years ago on a NFS share on my NAS drive. I mount and unmount the filesystem the same way every time. For some reason it's now coming up as read only. I do not know what might have changed to cause this. What might I look at to get this to mount as writeable again.


mount the nfs share
Code:
sudo mount -t nfs 192.168.0.99:SecureMedia /media/securemedia
mount the encrypted file system
Code:
encfs /media/securemedia/enc ~/decrypted
UnMount
Code:
fusermount -u ~/decrypted
Some permissions
/media
Code:
drwxrwxrwx   4 root root 4096 Oct  2  2016 securemedia
/media/securemedia/
Code:
drwxr-xr-x 5 farslayer farslayer 4096 Apr  1  2017 enc
/home/farslayer
Code:
drwxr-xr-x  5 farslayer farslayer      4096 Apr  1  2017 decrypted
/home/farslayer/decrypted
Code:
drwxr-xr-x 22 farslayer farslayer  4096 Feb 14 18:49 MyFiles
cat /etc/mtab
Code:
192.168.0.99:SecureMedia /media/securemedia nfs rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255, hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.0.99,mountvers=3,mountport=30000,mountproto=udp,local_lock=none,addr=192.168.0.99 0 0

encfs /home/farslayer/decrypted fuse.encfs rw,nosuid,nodev,relatime,user_id=1000, group_id=1000,default_permissions 0 0

If I try to create a document or folder on the drive I get the following error.
Code:
:~/decrypted$ touch test.txt
touch: cannot touch 'test.txt': Read-only file system
I can read everything on the volume, I can just no longer write to it. There is plenty of free space on the drive.

I have not updated my system between when this last worked and when it stopped working, so there are no changes I am aware of.

Possibly a power outtage at some point.

Thoughts ?

Thanks
 
Old 08-14-2019, 05:17 PM   #2
permaroot
Member
 
Registered: Aug 2019
Location: Arden, NC
Distribution: Arch Linux
Posts: 129

Rep: Reputation: 48
Do you get an error when trying to delete a file or modify one?
 
Old 08-14-2019, 06:22 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
A filesystem goes read-only usually you need to fsck it. ssh into the NAS and check the logs.
 
Old 08-14-2019, 09:05 PM   #4
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249

Original Poster
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
I did log into the NAS and run the file system check before originally posting here. I was hoping that would resolve the issue but it did not.

Yes I get the same error if trying to modify or delete a file

"cannot <function> '<filename>': Read-only File system"

Did not see anything in the NAS logs other than the notice to run the file check which I did.
I used the file manager in the NAS to create a new folder withint he same share on the NAS then tried to access it from Linux

Code:
root@debhome:/media/securemedia# ls -al 
total 20
drwxrwxrwx 5 root    root    4096 Aug 14 21:57 .
drwxr-xr-x 8 root    root    4096 Sep 10  2018 ..
drwxr-xr-x 5 farslayer farslayer 4096 Apr  1  2017 enc
drwxrwxrwx 2 root    root    4096 Mar 22 15:10 @Recycle
drwxrwxrwx 2 root    root    4096 Aug 14 21:57 trial

 
root@debhome:/media/securemedia# cd trial 
root@debhome:/media/securemedia/trial# touch test.txt
touch: cannot touch 'test.txt': Read-only file system
Even as root I can not write to that drive
 
Old 08-15-2019, 12:22 PM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by farslayer View Post
I did log into the NAS and run the file system check before originally posting here. I was hoping that would resolve the issue but it did not.
That is not exactly what syg00 requested.
Also are you sure that fsck actually repaired something? I believe the fs in question must not be mounted for that to succeed.
Give us some (much) more output to work with.
 
Old 08-16-2019, 11:21 PM   #6
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249

Original Poster
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
was hoping someone could tell me where to look for that more output you are requesting, as I am at a loss, which is why I posted here.


Code:
[~] # /etc/init.d/services.sh stop

[~] # df -h
Filesystem                Size      Used Available Use% Mounted on
none                     60.0M     46.3M     13.7M  77% /
devtmpfs                233.0M     12.0k    233.0M   0% /dev
tmpfs                    64.0M    596.0k     63.4M   1% /tmp
tmpfs                   239.6M     28.0k    239.6M   0% /dev/shm
tmpfs                    16.0M      1.1M     14.9M   7% /share
/dev/md9                515.5M    283.8M    231.7M  55% /mnt/HDA_ROOT
cgroup_root             239.6M         0    239.6M   0% /sys/fs/cgroup
/dev/mapper/ce_cachedev1     2.6T      1.4T      1.3T  52% /share/CE_CACHEDEV1_DATA
/dev/md13               433.0M    326.5M    106.5M  75% /mnt/ext
tmpfs                    16.0M     60.0k     15.9M   0% /share/CE_CACHEDEV1_DATA/.samba/lock/msg.lock
tmpfs                    16.0M         0     16.0M   0% /mnt/ext/opt/samba/private/msg.sock
tmpfs                     1.0M         0      1.0M   0% /mnt/rf/nd

[~] # umount /dev/mapper/ce_cachedev1

[~] # e2fsck -f -v -C 0 /dev/mapper/ce_cachedev1   
e2fsck 1.42.13 (17-May-2015)
Pass 1: Checking inodes, blocks, and sizes   
Inode 170786825 has INDEX_FL flag set on filesystem without htree support.     
Inode 170789530 has INDEX_FL flag set on filesystem without htree support.
.
.
.
Pass 2: Checking directory structure                                           
Pass 3: Checking directory connectivity                                        
Pass 4: Checking reference counts                                              
Pass 5: Checking group summary information                                     
                                                                               
       30543 inodes used (0.02%, out of 180699136)
        7487 non-contiguous files (24.5%)
          47 non-contiguous directories (0.2%)
             # of inodes with ind/dind/tind blocks: 0/0/0
             Extent depth histogram: 21860/8439
   376907002 blocks used (52.15%, out of 722776576)
           0 bad blocks
           2 large files

       27798 regular files
        2414 directories
           0 character device files
           0 block device files
           0 fifos
           0 links
         317 symbolic links (231 fast symbolic links)
           5 sockets
------------
       30534 files

[~] # mount -t ext4 /dev/mapper/ce_cachedev1 /share/CE_CACHEDEV1_DATA
[~] # reboot
Only thing popping up is a number of lines about htree support.

still mounting as read only
 
Old 08-22-2019, 05:15 PM   #7
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249

Original Poster
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
To wrap this up... the snafu was caused by DHCP and an IP restriction on the NFS share.
for whatever reason my PC got a different IP address recently from the router, and I did not recall setting an IP restriction on the share, so.....

Tech support requested the contents of the following file

[/mnt/HDA_ROOT/.config] # cat nfssetting


[Global]
Version = 4.2.1

[Access]
/share/CE_CACHEDEV1_DATA/Public = TRUE
/share/CE_CACHEDEV1_DATA/SecureMedia = TRUE

[AllowIP]
/share/CE_CACHEDEV1_DATA/Public = *
/share/CE_CACHEDEV1_DATA/SecureMedia = *,192.168.0.102

[Permission]
/share/CE_CACHEDEV1_DATA/Public = rw
/share/CE_CACHEDEV1_DATA/SecureMedia = ro,rw

[SquashOption]
/share/CE_CACHEDEV1_DATA/Public = no_root_squash
/share/CE_CACHEDEV1_DATA/SecureMedia = no_root_squash,no_root_squash

[AnonUID]
/share/CE_CACHEDEV1_DATA/Public = 65534
/share/CE_CACHEDEV1_DATA/SecureMedia = 65534,65534

[AnonGID]
/share/CE_CACHEDEV1_DATA/Public = 65534
/share/CE_CACHEDEV1_DATA/SecureMedia = 65534,65534



I did not recall setting the IP address restriction on the NFS share, and the page to configure the setting is not obvious in the web interface.
Once tech support requested the contents of the nfssetting file from the NAS the issue became apparent.

Updated the host IP and remounted, access is now Read / Write again.

I must say Qnap Tech support is pretty responsive, even willing to do a remote team viewer session to work on an issue for a home NAS without any charge or support contract. I wasn't expecting that so I did not go to them right away. I've dealt with some paid enterprise support that was less responsive.

Anyway, Thanks to those who replied for taking a look at my issue, maybe this will help someone else with a Qnap NAS in the future.
 
1 members found this post helpful.
  


Reply

Tags
encfs, ro



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] EncFS failure (NFS export of a reverse encfs mount) Skaperen Linux - Software 2 04-29-2011 01:51 PM
Read Write access to a iso9660 filesystem..mount a .iso image as read write ceazar123 Linux - Newbie 16 09-01-2010 09:07 AM
Read Write access to a iso9660 filesystem..mount a .iso image as read write ceazar123 Linux - General 2 08-26-2010 03:32 PM
How can I have: Root has Read-Write, user has read only for the boot filesystem? xmrkite Linux - Software 6 10-16-2008 04:31 AM
how do I change the filesystem from read-only to read-write? les_chow Linux - Newbie 5 05-26-2004 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration