Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-28-2015, 10:09 AM
|
#1
|
LQ Newbie
Registered: Sep 2015
Posts: 2
Rep:
|
Not able to delete file on cross mounted nas
This is what happened~ I am trying to cleanup a hidden file generated by a background process running remotely. And the file is on a mounted share (cifs). The ls command output on linux:
I am logging as root and it shows question mark for the file info:
[root@msbg01 FromABC]# cd FromABC_bak/
[root@msbg01 FromABC_bak]# ls -altr
ls: cannot access .rc_lock: No such file or directory
total 8
-?????????? ? ? ? ? ? .rc_lock
I doubted that the file is already corrupted somehow (I am not an expert on various file mount formats). Does anyone have any idea how to delete it from linux box? Thank you in advance.
|
|
|
09-29-2015, 08:23 AM
|
#2
|
Member
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735
Rep:
|
Running
As root should do the trick. Just make sure you are in the folder where it is.
Just make sure that by deleting it you are not going to mess up something runnig elsewhere.
Last edited by ericson007; 09-29-2015 at 08:27 AM.
|
|
|
09-29-2015, 10:54 AM
|
#3
|
LQ Newbie
Registered: Sep 2015
Posts: 2
Original Poster
Rep:
|
Thank you for the response. I've already tried several times and didn't work. It's the file stats on permission concerns me, and I can't even see the info as root:
[root@msbg01 FromABC_bak]# ls -altr
ls: cannot access .rc_lock: No such file or directory
total 8
-?????????? ? ? ? ? ? .rc_lock
drwxr-xr-x. 2 nemedia nasshare 0 Sep 25 15:20 .
drwxr-xr-x. 7 nemedia nasshare 0 Sep 26 09:09 ..
[root@msbg01 FromABC_bak]# rm -rf .rc_lock
[root@msbg01 FromABC_bak]# ls -altr
ls: cannot access .rc_lock: No such file or directory
total 8
-?????????? ? ? ? ? ? .rc_lock
drwxr-xr-x. 2 nemedia nasshare 0 Sep 25 15:20 .
drwxr-xr-x. 7 nemedia nasshare 0 Sep 26 09:09 ..
|
|
|
09-29-2015, 04:37 PM
|
#4
|
Member
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735
Rep:
|
[root@msbg01 FromABC_bak]# rm -rf .rc_lock
Could you double check that this is what you entered? If it is you are trying to delete a hidden file called rc_lock
There will be no such file.
Copy the command i stated above exactly and make sure you are in the directory.
You must pass *.rc_lock without * it will fail.
|
|
|
09-29-2015, 08:28 PM
|
#5
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397
|
1. it sounds like it may have disconnected /unmounted at some point whilst still being used, so its confused now.
Can you try a proper umount/mount (make sure you are not on the mnt when you do that)?
2. I wouldn't use the '-r' option - that's recursive and used for removing recalcitrant dirs, not files.
What you could do is backup one level, backup any other files you need to save, THEN remove the dir, put it back and put back any files.
|
|
|
09-29-2015, 10:30 PM
|
#6
|
Member
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735
Rep:
|
@chrism - good call, i missed that one! Getting into a dangerous routine of using recursive because lots of file system relables going on at the moment.
|
|
|
09-30-2015, 03:00 AM
|
#7
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397
|
Let's be real careful with that - way too easy to wipe out the entire system if run as root....
|
|
|
09-30-2015, 03:02 AM
|
#8
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,767
|
how was that drive mounted? (what are the mount options)
|
|
|
09-30-2015, 03:10 AM
|
#9
|
Member
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735
Rep:
|
Quote:
Originally Posted by chrism01
Let's be real careful with that - way too easy to wipe out the entire system if run as root....
|
If the filename was forgotten, yes.sorry for that slip up guys.
|
|
|
All times are GMT -5. The time now is 01:09 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|