6

I have an encfs-encrypted folder and just cut the content of a subfolder of it and pasted it into another folder outside the encfs-encrypted one. While doing that, I got an error message, saying that one subfolder couldn't be deleted because it is not empty.

The thing is, every file was pasted into the new folder and no file was left in the old one, which I checked with ls -ll -a in the subfolder:

total 8
drwxrwx--- 1 root plugdev 4096 Nov  9 16:19 .
drwxrwx--- 1 root plugdev 4096 Nov  9 16:19 ..

I don't know which information total 8 is supposed to give me here. If I try sudo ls -ll -a it says I don't have permission to do that.

Basically the same goes for rm. If I do rm -rf foldername, it says the folder is not empty. If I do sudo rm -rf foldername, it says I don't have permission to do that.

UPDATE (19th Nov):

The output of sudo smartctl --all /dev/sda is

smartctl 6.4 2014-10-07 r4002 [x86_64-linux-4.2.0-040200-generic] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     LITEONIT LMT-256M6M mSATA 256GB
Serial Number:    TW0XXM30550853571923
Firmware Version: DM8110C
User Capacity:    256.060.514.304 bytes [256 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ATA8-ACS, ATA/ATAPI-7 T13/1532D revision 4a
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Thu Nov 19 10:20:30 2015 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:        (   10) seconds.
Offline data collection
capabilities:            (0x15) SMART execute Offline immediate.
                    No Auto Offline data collection support.
                    Abort Offline collection upon new
                    command.
                    No Offline surface scan supported.
                    Self-test supported.
                    No Conveyance Self-test supported.
                    No Selective Self-test supported.
SMART capabilities:            (0x0002) Does not save SMART data before
                    entering power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x00) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   1) minutes.
Extended self-test routine
recommended polling time:    (  10) minutes.
SCT capabilities:          (0x003d) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0003   100   100   000    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0003   100   100   000    Pre-fail  Always       -       3655
175 Program_Fail_Count_Chip 0x0003   100   100   000    Pre-fail  Always       -       0
176 Erase_Fail_Count_Chip   0x0003   100   100   000    Pre-fail  Always       -       0
177 Wear_Leveling_Count     0x0003   100   100   000    Pre-fail  Always       -       222113
178 Used_Rsvd_Blk_Cnt_Chip  0x0003   100   100   000    Pre-fail  Always       -       0
179 Used_Rsvd_Blk_Cnt_Tot   0x0003   100   100   000    Pre-fail  Always       -       0
180 Unused_Rsvd_Blk_Cnt_Tot 0x0003   100   100   005    Pre-fail  Always       -       1664
181 Program_Fail_Cnt_Total  0x0003   100   100   000    Pre-fail  Always       -       0
182 Erase_Fail_Count_Total  0x0003   100   100   000    Pre-fail  Always       -       0
187 Reported_Uncorrect      0x0003   100   100   000    Pre-fail  Always       -       0
195 Hardware_ECC_Recovered  0x0003   100   100   000    Pre-fail  Always       -       0
241 Total_LBAs_Written      0x0003   100   100   000    Pre-fail  Always       -       286617
242 Total_LBAs_Read         0x0003   100   100   000    Pre-fail  Always       -       414678

SMART Error Log Version: 0
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%     44292         -
# 2  Short offline       Completed without error       00%     56577         -
# 3  Short offline       Completed without error       00%     56321         -
# 4  Short offline       Completed without error       00%     56321         -
# 5  Short offline       Completed without error       00%      1024         -
# 6  Short offline       Completed without error       00%      1024         -
# 7  Short offline       Completed without error       00%       256         -
# 8  Extended offline    Completed without error       00%         0         -

Selective Self-tests/Logging not supported
Yanick Nedderhoff
  • 1,501
  • 1
  • 12
  • 20
  • Try running `ls -laF` rather than `ls -ll -a`. It may show some hidden folders/files left over. –  Nov 09 '15 at 15:56
  • Nope, basically the same output. – Yanick Nedderhoff Nov 09 '15 at 15:58
  • do you have write permissions in the parent directory? – Wayne_Yux Nov 09 '15 at 16:02
  • I can create a file with ``touch foo.txt``, but it says something that translates to ``Set the time for "foo.txt": Operation not permitted``. ``foo.txt`` still appears, though. That error didn't pop up before this whole cut&paste thing! – Yanick Nedderhoff Nov 09 '15 at 16:09
  • Ok, I just switched the system language to make this easier. It says: ``touch: setting times of ‘foo.txt’: Operation not permitted`` – Yanick Nedderhoff Nov 09 '15 at 16:17
  • What are the permissions of the encrypted files (`man encfs` seems to call it the "rootdir")? Does your user have read/write/delete access to all of them? I think encfs doesn't seem to transfer permission from the mounted/decrypted file down to the encrypted file, so changing the encrypted files permissions might work. – Xen2050 Nov 11 '15 at 09:40
  • If I do ``ls -ll -a`` on the encrypted files, the output looks basically like the one in my question. If I am right, this means that root and the group ``plugdev`` have r, w, and x rights, correct? My user is part of the group ``plugdev``, so I assume it should work. And it should also work with ``sudo``, right? – Yanick Nedderhoff Nov 11 '15 at 10:37
  • You are an admin user that has the right to use `sudo` to become root? – Byte Commander Nov 16 '15 at 10:44
  • Yes. And I write a little more, since "Yes." is not enough for a comment ... – Yanick Nedderhoff Nov 16 '15 at 12:15
  • I just tried to create a new encfs folder with root folder and mount folder being at the same place as the ones of the question. When I want to mount the new folder, I get the following error ``fusermount: failed to open /etc/fuse.conf: Permission denied fusermount: failed to access mountpoint /home/ynedderhoff/encfs/test: Permission denied``. But apart from that error message, mounting worked fine, and I could create and delete folders and files. – Yanick Nedderhoff Nov 16 '15 at 15:11
  • Just asking, does your user and root are in `fuse` group? just to make sure, because encfs will works for user in the group `fuse`. – adadion Nov 17 '15 at 04:10
  • then unmount first before deleting that encrypted folder `fusermount -u ~/encfs/clear` – adadion Nov 17 '15 at 04:13
  • My user is not in a group called ``fuse``. Can root be in groups? And what do you mean with unmounting before deleting, how would I be able to delete sth in an unmounted folder? – Yanick Nedderhoff Nov 17 '15 at 09:12
  • I just tried to mount a backup of the encrypted folder and it worked just fine. I could delete and create files without warnings. But it still doesn't work on the actual folders, not even on freshly generated encfs-encrypted folders. Could there be any relation to the 15.10 upgrade? The backup is from before the upgrade. What might be different on the backup files compared to newer ones. – Yanick Nedderhoff Nov 18 '15 at 10:58
  • what's the output of `smartctl --all /dev/XdY` where `X` and `Y` denote your actual HD? – Fabby Nov 18 '15 at 23:08
  • I added that output to the question, since it's way to long for the comment section. – Yanick Nedderhoff Nov 19 '15 at 09:22
  • I just ran it in the folder I want to delete, if that's what you meant. I get tons of this: ``stat: cannot stat ‘.’: Permission denied sh: 1: cd: can't cd to ..``. Seems to be looping. – Yanick Nedderhoff Nov 20 '15 at 22:06
  • Can you copy the said files? – George Udosen Nov 27 '17 at 10:01

1 Answers1

1

The folder is probably the mountpoint for you encrypted volume. Type mount in a terminal, and see if the cryptodrive (although empty) is still mounted into this folder. You can use sudo umount /path/to/folder to unmount it ("switch off the encryption system" in a manner of speaking). You should be able to remove the folder once it is not an active mountpoint anymore.

Paul Hänsch
  • 3,157
  • 20
  • 15