LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 09-28-2015, 10:09 AM   #1
qwdow
LQ Newbie
 
Registered: Sep 2015
Posts: 2

Rep: Reputation: Disabled
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.
 
Old 09-29-2015, 08:23 AM   #2
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
Running

Code:
rm -rf ./*.rc_lock
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.
 
Old 09-29-2015, 10:54 AM   #3
qwdow
LQ Newbie
 
Registered: Sep 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
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 ..
 
Old 09-29-2015, 04:37 PM   #4
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
[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.
 
Old 09-29-2015, 08:28 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
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.
 
Old 09-29-2015, 10:30 PM   #6
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
@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.
 
Old 09-30-2015, 03:00 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777

Let's be real careful with that - way too easy to wipe out the entire system if run as root....
 
Old 09-30-2015, 03:02 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,767

Rep: Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563
how was that drive mounted? (what are the mount options)
 
Old 09-30-2015, 03:10 AM   #9
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
Quote:
Originally Posted by chrism01 View Post

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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to get my NAS mounted and seen by client PC's GeordieJedi Linux - Newbie 11 01-17-2014 01:55 PM
[SOLVED] User mounted nas? ajohn Linux - Networking 2 06-06-2011 07:41 AM
Only root can chmod on mounted LinkStation NAS - how should I mount? chiefmac Linux - Networking 5 08-07-2008 03:27 PM
How to check if NAS is mounted via shell script? koobi Programming 13 01-12-2008 10:07 AM
Will samba available cross internet ?nas ? my-unix-dream Linux - Newbie 1 04-21-2005 05:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:09 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