unable delete directory in home folder. unable create new file in home folder

Hello,

I am running,

lsb_release -a 
LSB Version:    n/a 
Distributor ID:    openSUSE project 
Description:    openSUSE 13.1 (Bottle) (x86_64) 
Release:    13.1 
Codename:    
Bottle

A few days ago I was unable to run ** YaST **as my user named *brian. *I didn’t have time to reboot so I ignored it. I rebooted today but then was unable to login to my KDE session. So, I logged in to another Desktop environment, XFCE.

I have other users on this system so I tried logging in to a KDE session with another user and was successful. I also ran YaST as that user. So, I figure my home directory is corrupted.

So, I quickly decided to trash the following directories, .kde, .kde4, .config, and .cache. I was able to delete the files in those folders but not the directories.

I have the pictures of me trying to delete the .miro directory because I never was able to get that program to work so deleting that directory was my next stop.

Pictures below of the .miro directory:
http://brianzad.freeshell.org/questions/miroDirectory.jpg

And, picture below shows unable to delete:
http://brianzad.freeshell.org/questions/rmfrUnable.jpg

Looks like I messed up my home directory. I don’t know how to fix this. If someone could suggest steps to take to fix this I would appreciate it. I thought it was a simple permission problem so I ran (not at the computer so the code may be inaccurately typed),

#chown --recursive brian: /home/brian/

but I still have the issue.

Thank you for any suggestions and for your help and time.

If you can log into KDE as another user it is most likely a hiccup in your KDE configuration files. These files all live in your home directory under ~/.kde4 Not the period it is a hidden directory. rename the directory and try logging again this will bring you back to default settings.


mv ~/.kde4 ~/.kde4.bak


You can not run yast as a user ever. you must have root access. Starting yast from a GUI will prompt you for the root password.

Also you can’t delete a running config file so you have to do it when you are NOT logged as the user in question. I log into a terminal as root and do that sort of thing without haveing the GUI running as myself…

On 2014-08-28 01:26, reedbob wrote:

> A few days ago I was unable to run * YaST *as my user named -brian. -I
> didn’t have time to reboot so I ignored it. I rebooted today but then
> was unable to login to my KDE session. So, I logged in to another
> Desktop environment, XFCE.

But you have to run YaST as root. It makes no sense as user. You use
some variation of su or sudo, which can be automatically called from the
menu.

> I have the pictures of me trying to delete the .miro directory because
> I never was able to get that program to work so deleting that directory
> was my next stop.
>
> Pictures below of the .miro directory:
> [image: http://brianzad.freeshell.org/questions/miroDirectory.jpg]

Why not just paste the text here?


cer@Telcontar:~/test_for_forum> mkdir test
cer@Telcontar:~/test_for_forum> l
total 52
drwxr-xr-x   3 cer users    17 Aug 28 01:47 ./
drwxr-xr-x 248 cer users 32768 Aug 28 01:47 ../
drwxr-xr-x   2 cer users     6 Aug 28 01:47 test/
cer@Telcontar:~/test_for_forum> rm test/
rm: cannot remove ‘test/’: Is a directory
cer@Telcontar:~/test_for_forum>

> And, picture below shows unable to delete:

Did you check the ACLs?


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Hi,

sorry! I meant to write that I was logged in as myself (username brian) and ran YaST and entered the root password when YaST requested it.

Unfortunately, the last few days YaST didn’t work. After entering root password YaST quit.

So, today I rebooted and then was unable to login to KDE. I was able to log in to XFCE. Then, I figured it was corrupt files so thought I’d delete some configuration files. I logged out of the desktop and in the terminal I ran the program mc and tried to delete those files and directories.

But, didn’t have proper permissions as shown below:

brian@linux-4gj0:~> mkdir test
mkdir: cannot create directory ‘test’: Permission denied

I don’t know what ACLs are so will have to do a little research.

Thank you!

On 2014-08-28 02:36, reedbob wrote:
>
> Hi,
>
> sorry! I meant to write that I was logged in as myself
> (username brian) and ran YaST and entered the root password when
> YaST requested it.
>
> Unfortunately, the last few days YaST didn’t work. After entering
> root password YaST quit.
>
> So, today I rebooted and then was unable to login to KDE. I was able
> to log in to XFCE. Then, I figured it was corrupt files so thought I’d
> delete some configuration files. I logged out of the desktop and in
> the terminal I ran the program mc and tried to delete those files and
> directories.
>
> But, didn’t have proper permissions as shown below:
>
> Code:
> --------------------
> brian@linux-4gj0:~> mkdir test
> mkdir: cannot create directory ‘test’: Permission denied
>
> --------------------

Not normal. What are the permissions of the “.” entry in “ls -l”?


cer@Telcontar:~> l
total 3529520
-rw-r--r--   1 cer  users       1268 May 15  2013 #newfile3.lyx#
....
-rw-r--r--   1 cer  users          0 Jan 29  2013 --
-rw-r--r--   1 cer  users          0 Apr 24 03:42 -dnh
drwxr-xr-x 247 cer  users      32768 Aug 28 03:23 ./    <=======
drwxr-xr-x  24 root root        4096 Jul  4 03:50 ../
drwx------   2 cer  users         72 Aug  9 23:27 .AbiSuite/
....

I don’t know what ACLs are so will have to do a little research.

Access Control Lists

“man acl” :slight_smile:

Try “lsattr somefile” and “getfacl somefile”. For example, on this listing:


Telcontar:/mnt/Ext/Moria2/lost+found # lsattr \#*
--SDi-d-c---T--- #4049402
--S-ia--c---T--- #4066597
---Di---cj-tT--- #4079810
-----adAcj--T--- #4083190

the ‘i’ stands for “inmutable”, so you get a permission denied on trying
to delete those files. “chattr = filename” deletes all the attributes.
It happened to me…

(those permissions on my files above were not intentional, but
“accidental”, after a power failure, corruption and fsck).


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Hi,

The permissions of the “.” entry shown below,

brian@linux-4gj0:~> l
total 26036
dr-xr--r-- 64 brian users     4096 Aug 27 18:27 ./
drwxr-xr-x  5 root  root      4096 Aug  6 17:17 ../
drwx------  2 brian users     4096 Aug  4 00:44 .AbiSuite/
-rw-rw-r--  1 brian users     5436 Mar 10  2012 About.cpp
-rw-rw-r--  1 brian users     1312 Feb 18  2012 About.h
drwx------  3 brian users     4096 Jul 25 20:49 .adobe/

Ran on the files below,


brian@linux-4gj0:~> lsattr About.cpp 
-------------e-- About.cpp

brian@linux-4gj0:~> getfacl About.cpp 
# file: About.cpp
# owner: brian
# group: users
user::rw-
group::rw-
other::r--

brian@linux-4gj0:~> 


Ran on the directory below,


brian@linux-4gj0:~> lsattr .AbiSuite/
-------------e-- .AbiSuite/AbiWord.Profile
-------------e-- .AbiSuite/AbiCollab.Profile

brian@linux-4gj0:~> getfacl .AbiSuite/
# file: .AbiSuite/
# owner: brian
# group: users
user::rwx
group::---
other::---



Thank you.

You don’t have write permissions in your home folder, that’s why you cannot create or delete files/folders.

This should fix it:

chmod u+w ~

thank you. I ran the code as my regular user and now YaST is working (with root password) and KDE is working again.

And for that you need permission to write to the … directory (which is /home)

drwxr-xr-x  5 root  root      4096 Aug  6 17:17 ../

So you need to be root and do

chmod u+w /home/brian

(Or am I completely wrong?)

BTW, I think it is worthwhile that the OP tries to find out how this happened. Only repairing it does solve the incident, but not the underlying problem.

No, you don’t. I just tried it. :wink:

It’s sufficient that you are the owner of /home/xxx/ to change the permissions for /home/xxx/.

You would need to be root (i.e. have write permissions in /home/) to create/remove entries in /home/ though of course.

Hi,

I’m not sure how this happened. All I can say is that my hard disk failed containing my home directory and it was replaced a couple of weeks ago. See thread, https://forums.opensuse.org/showthread.php/500124-disk-with-Home-died-Unable-to-login-emergency-mode.

I re-ran the commands again and provide them below:

brian@linux-4gj0:/home> l
total 32
drwxr-xr-x  5 root  root   4096 Aug  6 17:17 ./
drwxr-xr-x 26 root  root   4096 Aug 28 14:52 ../
drwxr--r-- 68 brian users  4096 Aug 28 15:01 brian/

brian@linux-4gj0:~> l
total 26040
drwxr--r-- 68 brian users     4096 Aug 28 15:01 ./
drwxr-xr-x  5 root  root      4096 Aug  6 17:17 ../
drwx------  2 brian users     4096 Aug  4 00:44 .AbiSuite/
-rw-rw-r--  1 brian users     5436 Mar 10  2012 About.cpp

brian@linux-4gj0:~> lsattr About.cpp 
-------------e-- About.cpp

brian@linux-4gj0:~> getfacl About.cpp 
# file: About.cpp
# owner: brian
# group: users
user::rw-
group::rw-
other::r--

brian@linux-4gj0:~> lsattr .AbiSuite/
-------------e-- .AbiSuite/AbiWord.Profile
-------------e-- .AbiSuite/AbiCollab.Profile

brian@linux-4gj0:~> getfacl .AbiSuite/
# file: .AbiSuite/
# owner: brian
# group: users
user::rwx
group::---
other::---

Thank you.

You are right, you need inode access and the x-bit for others for /home is set.