Permission, etc.

I run openSUSE 12.2, and I am both root and the only user. I bought a Kingston flash memory stick and have used it to do backups with rsync. I would like to do things differently now, and remove the existing directories that are there or at least create some new directories but the system will not let, keeps saying “read-only”, whether I try as the user and owner or as root. How can I accomplish what I would like to do?

pe1800@linux-gkd7:/media/KINGSTON> ls -al
total 128
drwx------ 5 pe1800 users 32768 Dec 31 1969 .
drwxr-xr-x 4 root root 80 Aug 19 11:25 …

drwx------ 36 pe1800 users 32768 Aug 11 13:36 pe1800
drwx------ 3 pe1800 users 32768 May 30 17:34 pe1800-deletes
drwx------ 4 pe1800 users 32768 Aug 19 11:27 .Trash-1000

pe1800@linux-gkd7:/media/KINGSTON> rm -r pe1800
rm: cannot remove ‘pe1800’: Read-only file system

pe1800@linux-gkd7:/media/KINGSTON> mkdir BACKUP-SUSE-A
mkdir: cannot create directory ‘BACKUP-SUSE-A’: Read-only file system

pe1800@linux-gkd7:/media/KINGSTON>

Thank you,
pe1800

Is the flash memory formatted as NTFS?

If it is, then I suggest that you plug it into a Windows box, and run


CHKDSK /F letter:

(with the appropriate letter for the disk). This is to check whether there is file system corruption (and to fix it).

Although you <say> your account is also root, it’s unlikely. Maybe <maybe!> your User account is a member of the root group, maybe not.

Recommend

  1. You’ve posted your output using your regular User account. Re-post output running the same commands after <properly> changing to root.

Speculation: Your User account is mostly only a regular non-root account and not a member of the root group, which would be inadvisable in any case. More likely I’m guessing that your system mail is being delivered to your User account and you may be confusing that to mean your User account has root permissions.

Regardless how your User account permissions are setup, your rsync may have set permissions restrictively on its own… eg if running with root permissions (likely) it could have created or updated files which might only be accessible with the root account and might not even permit root group permissions. In fact, as I’m re-reading your post now, “drwx” permissions is exactly that… Only the owner has access, everyone else is locked out.

So, IMO you should be able to do anything you want with those directories on your flash drive after running “su”.

TSU

When it says that the file system is read only, it probably means just that. Thus you have to see if it is mounted read only

mount | grep media

And when it is, you have to find out why. Is there an fstab entry for it?

And, as said, off course it might not be a Linux file system at all, which will complicate things because then all permissions and ownership is faked.

PS, please do not use QUOTE tags, but CODE tags around computer copy/pastes. It is the # button in the tool bar of the post editor.

> Kingston flash memory stick

i believe some Kingston sticks have a little slider switch to
prevent accidental erasures…if yours does that switch will change
the stick from “read only” to “read and write”…


dd
http://tinyurl.com/DD-Complaints

I also thought of something like that (where are the times that we removed “write rings” from open tape reels?), but he says he does use rsync to backup to the drive.
:question:

That worked. Thank you.

Thank you. The root account and my user account are not related. It’s only that I am the only user and that I have also, after entering the root password, , root access. I had already tried to do the same deletes and directory creation also as root - using su or sudo - with identical negative results.

No, my Kingston is one of those that attaches to my keyring, just a piece of smooth steel, no flashing, no switches. Yes, I remember about the tapes…dates us, doesn’t it?

Could you post the output of

cat /proc/mounts | grep media

Also, upon inserting the usb stick, check dmesg and see if there are any error reported.

On 08/19/2013 05:46 PM, pe1800 pecked at the keyboard and wrote:
> hcvv;2580255 Wrote:
>> I also thought of something like that (where are the times that we
>> removed “write rings” from open tape reels?), but he says he does use
>> rsync to backup to the drive.
>> :question:
> No, my Kingston is one of those that attaches to my keyring, just a
> piece of smooth steel, no flashing, no switches. Yes, I remember about
> the tapes…dates us, doesn’t it?
>
>

Ah yes, the write rings, brings back memories from the not to distant past.

My best guess would be it mounted write only.

On 2013-08-20 01:29, Ken Schneider wrote:

> My best guess would be it mounted write only.

He already solved the problem and said what it was :wink:


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

He indeed said he solved the problem, but he did not tell what the root problem was.

On 08/20/2013 10:26 AM, hcvv wrote:
> He indeed said he solved the problem, but he did not tell what the root
> problem was.

he answered “That worked.” in response to post #2, i therefore assume
his/her NTFS formatted stick needed some love from the MS program
named chkdsk…

HTH, thank you.


dd

I am afraid this leads to nothing, but what was the root cause then? It seems that you (and Carlos) point to the fact that something was repaired on the file system. But that is not “solving it”. That is getting the thing functioning again, but probably destroyed all evidence about what was wrong. Thus it can go wrong sooner or later because the root cause is not understood.

In ITIL parlance: the Incident is closed, but the Problem???

Who can tell?

As far as I know, prematurely unplugging a USB drive, before it is completely unmounted, can cause file system corruption.

On 08/20/2013 01:56 PM, hcvv wrote:

> It seems that you (and Carlos)
> point to the fact that something was
> repaired on the file system. But that is not “solving it”.

the symptom was solved but not the cause.

the OP didn’t seem interested in your hint

it might not be a
Linux file system at all, which will complicate things because then
all permissions and ownership is faked.

that might have been noticed and then discussed with the OP had the
hint gone on to include something like:

do not" use NTFS to
hold your backups, instead you must use a Linux file system or . .

i know it is your style to hint and not guess about the facts until
you have seen the concrete proof (inside code tags)…

while some others here are often willing to guess, strain to read
non-code tag protected formatting, and offer help that goes past the
hints that go unnoticed by many new folks…

this sub-thread about treating the symptom rather than the problem
highlights a simple a difference of opinion on how to best help
this OP and this non-working stick…

in my opinion that discussion is better held in a non-technical help
forum…

you might consider moving it to an appropriate spot where it might
produce a productive discussion.

> That is
> getting the thing functioning again, but probably destroyed all evidence
> about what was wrong. Thus it can go wrong sooner or later because the
> root cause is not understood.

yes you are correct…if it happens again, and s/he asks again how
to solve it we can just not tell how until s/he is willing to find
out what caused the NTFS corruption and prevent it from reoccurring…


dd
http://tinyurl.com/DD-Complaints

On 2013-08-20 13:56, hcvv wrote:
>
> DenverD;2580395 Wrote:
>> On 08/20/2013 10:26 AM, hcvv wrote:
>>> He indeed said he solved the problem, but he did not tell what the
>> root
>>> problem was.
>>
>> he answered “That worked.” in response to post #2, i therefore assume
>> his/her NTFS formatted stick needed some love from the MS program
>> named chkdsk…
>>
>> HTH, thank you.

> I am afraid this leads to nothing, but what was the root cause then? It
> seems that you (and Carlos) point to the fact that something was
> repaired on the file system. But that is not “solving it”. That is
> getting the thing functioning again, but probably destroyed all evidence
> about what was wrong. Thus it can go wrong sooner or later because the
> root cause is not understood.
>
> In ITIL parlance: the Incident is closed, but the Problem???

:slight_smile:

Even if my memory is not as good as it was, I happen to remember that
when an NTFS filesystem needs a repair, Linux simply mounts it read only
if it can (as it can not repair it). It is possible that there is a
message in syslog to that effect, that I do not remember. It can be
something so simple as that the “clean” flag is not set, ie, that there
are still things in the log to be applied (ie, a premature removal of
the unit).

Linux can be forced to mount it r/w, though - it is in the man.

The solution is just to plug it in Windows, run the checkdisk utility
(gui or cli), and plug it back in Linux.

And Presto! R/W again :wink:

It was shrewd guessing by nrickert. Dunno how he thought it might be an
NTFS stick.

By the way, pe1800: reformat as ext4 without journal for use with rsync.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

IMO if factory-formatted, it would most likely have been FAT, not NTFS.
Someone reformatted “after market.”

TSU

It was only a guess. From what I could tell, it looked as if the file system had been silently mounted read-only, even though on previous occasions it had mounted read-write. That looked like what linux does when mounting a corrupted NTFS file system.