LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-02-2007, 12:01 PM   #1
cooknet
LQ Newbie
 
Registered: Jun 2007
Posts: 8

Rep: Reputation: 0
Cannot delete files from hard drive "read only" help!


Hi all, I'm relatively new to Linux, I have Mandriva installed on an older 500mhz system, which everything seems to be running fine until I suddenly could not manipulate any files on a secondary drive.

I have a regular desktop hard drive with the Linux distro installed on it as my primary drive, and as a slave I have an IBM travelstar laptop 2.5" 80gb drive installed via a 2.5 to 3.5" adapter on the IDE. I've been downloading stuff, and also backing up stuff onto this secondary drive, and now it's almost full. In the past I've been able to delete files just fine, but suddenly, I cannot move files off the drive to another drive or network lcation, nor can I delete files from this drive. I get an error saying file system is "read only", or it cannot read the file.I can however move them from place to place "within" the drive, and I can rename files. I cannot even burn a CD of anything on this drive, I get burning errors. It's really weird. I've gone into the configuration (system/configuration/control center) and looked at the mounting options (I guess thats called harddrake) and it is not marked as read only. When I use konquerer to explore the drives, and right click the storage drive to see the permissions, it says owner, group, and others all have "can view and modify content".

What can I do to be able to get my important backed up files "off" this drive now so I can back them up? And also delete the unwanted large files just sitting there?
Please help!

Thanks
 
Old 06-02-2007, 04:06 PM   #2
rch1231
Member
 
Registered: Mar 2007
Location: Bedford, Texas
Posts: 31

Rep: Reputation: 15
The first thing that comes to my mind is that the problem is not on your secondary but on the primary drive you are trying to copy to. The read only message usually is telling you about the location you are trying to copy to and the fact that you can write to other places on the secondary makes me believe this even more. The other question is what user are you using to attempt to copy the files? Some directories can only be written to by root.
 
Old 06-02-2007, 05:31 PM   #3
cooknet
LQ Newbie
 
Registered: Jun 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rch1231
The first thing that comes to my mind is that the problem is not on your secondary but on the primary drive you are trying to copy to. The read only message usually is telling you about the location you are trying to copy to and the fact that you can write to other places on the secondary makes me believe this even more. The other question is what user are you using to attempt to copy the files? Some directories can only be written to by root.
It can't be the other drives, as I cannot even delete a file from this secondary drive.
I have had another problem in the past where if the primary drive is full, and the file I'm trying to delete from the secondary drive (back when I was able to delete files from that drive) is bigger than the remaining space left on the primary drive I cannot delete it because it's too big to go into the trash on the primary drive.

But that's not the problem now, I cannot even delete a file that is 32kb on the secondary drive. I can't delete anything at all, I would be happy to at least be able to free some space on the drive, but the problem is, it's like a one way revolving door, I can copy files to the secondary drive, but once they are there on that secondary drive, they're stuck there, cant delete them, move them, nothing.

What can I do about this?? I'm desperate to back up the important data on this disk and delete the stuff I want off there!
 
Old 06-04-2007, 12:18 PM   #4
cooknet
LQ Newbie
 
Registered: Jun 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Help with my drive

Quote:
Originally Posted by cooknet
It can't be the other drives, as I cannot even delete a file from this secondary drive.
I have had another problem in the past where if the primary drive is full, and the file I'm trying to delete from the secondary drive (back when I was able to delete files from that drive) is bigger than the remaining space left on the primary drive I cannot delete it because it's too big to go into the trash on the primary drive.

But that's not the problem now, I cannot even delete a file that is 32kb on the secondary drive. I can't delete anything at all, I would be happy to at least be able to free some space on the drive, but the problem is, it's like a one way revolving door, I can copy files to the secondary drive, but once they are there on that secondary drive, they're stuck there, cant delete them, move them, nothing.

What can I do about this?? I'm desperate to back up the important data on this disk and delete the stuff I want off there!
I really had hoped that someone out there would read this and give me a hand.
Guess not. ;(
 
Old 06-04-2007, 03:15 PM   #5
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,899

Rep: Reputation: 68
Did you at least run fsck? Give an ordinary users right to read partition, but not to write and run fsck from a non-root account on a LiveCD. Maybe it will tell you how bad (or good) is situation.

By the way, does catting files work? If yes, try cat-ting or dd-ing important files with redirection to a reliable drive.
 
Old 06-04-2007, 03:24 PM   #6
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Speaking of which, you could try moving the files from a liveCD. Mount the partitions from the liveCD and then try moving some files from one to the other - if it works, then it's not likely a hardware but a configuration issue.
 
Old 06-04-2007, 07:19 PM   #7
cooknet
LQ Newbie
 
Registered: Jun 2007
Posts: 8

Original Poster
Rep: Reputation: 0
cannot delete from drive

Quote:
Originally Posted by raskin
Did you at least run fsck? Give an ordinary users right to read partition, but not to write and run fsck from a non-root account on a LiveCD. Maybe it will tell you how bad (or good) is situation.

By the way, does catting files work? If yes, try cat-ting or dd-ing important files with redirection to a reliable drive.
Hello, thanks fr your reply.
As I mentioned, I'm really new to Linux, and trying to learn all this stuff.
I'm muddling through most of it, and trying to learn as I go. You guys are a bit over my head.
What I can tell you is this, periodically, when I reboot the PC, it fails, and asks if I want to run fsck, I say "Y", then it says, "are you sure running efsck on a mounted file system can cause serious damage" or something along those lines, so I say "N".
It then scans the disk and asks me when it finds something to ignore or not, I say "Y" (otherwise if I say "N" the scan just stops), then it finds an error and asks me to fix or overwrite, and I answer "Y", until finished, then it reboots properly.
So to answer your question about running fsck, the answer is "yes" I think?

Anyhow, I thought it might be something in my fstab, so I'll paste it below and you can tell me if you see anything wrong, it's the 52gb drive partition that has the issue, the rest are all fine:

//dev/hda1 / ext3 defaults 1 1
/dev/hdc6 /13gb ext3 defaults 1 2
/dev/hdc1 /52gb ext3 defaults 1 2
/dev/hdc5 /8gb ext3 defaults 1 2
/dev/hda6 /home ext3 defaults 1 2
none /mnt/floppy supermount dev=/dev/fd0,fs=ext2:vfat,--,umask=0,iocharset=utf8,sync 0 0
none /proc proc defaults 0 0
/dev/hdb1 /usr ext3 defaults 1 2
/dev/hda5 swap swap defaults 0 0


Is there anything wrong with this?
When I try to delete a file, it just says "cannot read file"...whatever".

Hope you ca help, please be patient as I barely understand the things you are suggesting, please post in more simple point form, thanks!
I'm very confused.
 
Old 06-04-2007, 07:38 PM   #8
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Hmm, that whole fsck thing is hardly reasssuring. That shouldn't happen - if it does, it usually means something is (seriously) wrong with the filesystem. I have been running 9 distributions for only a year and only once did I run into something like that problem you are describing.

Can you post the output of

ls -al /52GB ?
Just to make sure your permissions aren't mixed up.

Have you got a liveCD around?
 
Old 06-04-2007, 11:11 PM   #9
cooknet
LQ Newbie
 
Registered: Jun 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jay73
Hmm, that whole fsck thing is hardly reasssuring. That shouldn't happen - if it does, it usually means something is (seriously) wrong with the filesystem. I have been running 9 distributions for only a year and only once did I run into something like that problem you are describing.

Can you post the output of

ls -al /52GB ?
Just to make sure your permissions aren't mixed up.

Have you got a liveCD around?
\Hi Jay, does this help?
What's a liveCD do?

brw-rw---- 1 root root 3, 0 Jun 4 11:34 hda
brw-rw---- 1 root root 3, 1 Jun 4 06:26 hda1
brw-rw---- 1 root root 3, 2 Jun 4 06:26 hda2
brw-rw---- 1 root root 3, 5 Jun 4 06:26 hda5
brw-rw---- 1 root root 3, 6 Jun 4 06:26 hda6
brw-rw---- 1 root root 3, 64 Jun 4 11:34 hdb
brw-rw---- 1 root root 3, 65 Jun 4 06:26 hdb1
brw-rw---- 1 root root 22, 0 Jun 4 11:34 hdc
brw-rw---- 1 root root 22, 1 Jun 4 06:26 hdc1
brw-rw---- 1 root root 22, 2 Jun 4 06:26 hdc2
brw-rw---- 1 root root 22, 5 Jun 4 06:26 hdc5
brw-rw---- 1 root root 22, 6 Jun 4 06:26 hdc6
brw-rw---- 1 cdwriter 22, 64 Jun 4 06:26 hdd
 
Old 06-04-2007, 11:45 PM   #10
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
A liveCD is an operating system that runs from your cd instead of from a hard drive. You put the cd in the drive, you go into bios and set the computer to boot off cd, reboot and then the OS starts running from the cd - no hard disk used. The advantage is that you can access data on your hard drives this way without starting up your installed OS. So if that OS is doing something "wrong", like preventing you from moving or deleting files, it can't do so anymore because it's not running.

Now for a little experiment:

can you use these commands:
su -
root password
chown -R username /52GB

Does that make a difference?

If not, try
chmod 777 /52GB
 
Old 06-05-2007, 12:14 AM   #11
cooknet
LQ Newbie
 
Registered: Jun 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jay73
A liveCD is an operating system that runs from your cd instead of from a hard drive. You put the cd in the drive, you go into bios and set the computer to boot off cd, reboot and then the OS starts running from the cd - no hard disk used. The advantage is that you can access data on your hard drives this way without starting up your installed OS. So if that OS is doing something "wrong", like preventing you from moving or deleting files, it can't do so anymore because it's not running.

Now for a little experiment:

can you use these commands:
su -
root password
chown -R username /52GB

Does that make a difference?

If not, try
chmod 777 /52GB

I'm afraid not, I get the below errors:

[doggy@localhost ~]$ su
Password:
[root@localhost doggy]# chown -R username /52GB
chown: `username': invalid user
[root@localhost doggy]# chmod 777 /52GB
chmod: cannot access `/52GB': No such file or directory
[root@localhost doggy]#
[root@localhost doggy]#


[doggy@localhost ~]$ su
Password:doggy]# chown -R doggy /52GB
chown: cannot access `/52GB': No such file or directory


What am I doing wrong??
 
Old 06-05-2007, 02:04 AM   #12
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Ok, first of all, when I said 'username', you were supposed to replace it with your actual username. But I see you already figures that out.

Next: the partition in question is not called "52GB" - what is its real name? I mean, what is the name of the directory that it is "in"? You should use that instead of "52GB".

If 52GB really is its name - or it hasn't got any - then you should try it like this (I have included some comments so you know what is going on):
su - (=become super user)
root password (=prove you are really super user by submitting root password)
umount /dev/hdc1 (=make the partition inaccessible)
mkdir /mnt/mydata (=create a mydata directory)
mount /dev/hdc1 /mnt/mydata (=place the partition inside this directory)

Have a look in /mnt/mydata and see whether you can move/delete files yet.

If not:
chown -R username /mnt/mydata (=make yourself the owner of everything in the partition)

or:
chmod 777 /mnt/mydata (=make all the files accessible to anyone)

When your work is done, you should unmount it again:
umount /mnt/mydata
 
Old 06-05-2007, 02:03 PM   #13
cooknet
LQ Newbie
 
Registered: Jun 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Still doesn't work

Quote:
Originally Posted by jay73
Ok, first of all, when I said 'username', you were supposed to replace it with your actual username. But I see you already figures that out.

Next: the partition in question is not called "52GB" - what is its real name? I mean, what is the name of the directory that it is "in"? You should use that instead of "52GB".

If 52GB really is its name - or it hasn't got any - then you should try it like this (I have included some comments so you know what is going on):
su - (=become super user)
root password (=prove you are really super user by submitting root password)
umount /dev/hdc1 (=make the partition inaccessible)
mkdir /mnt/mydata (=create a mydata directory)
mount /dev/hdc1 /mnt/mydata (=place the partition inside this directory)

Have a look in /mnt/mydata and see whether you can move/delete files yet.

If not:
chown -R username /mnt/mydata (=make yourself the owner of everything in the partition)

or:
chmod 777 /mnt/mydata (=make all the files accessible to anyone)

When your work is done, you should unmount it again:
umount /mnt/mydata

Hi,
I tried all that, no change, still cannot delete the files. I'm trying to delete them in konquerer, it says "cannot read file", but also tried it in the linux file manager and when I use that it says "read only file system" error.

Also, now I cannot unmount the mydata, it says the following:

[root@localhost mydata]# umount /mnt/mydata
umount: /mnt/mydata: device is busy
umount: /mnt/mydata: device is busy
[root@localhost mydata]#

I tried it several times and again after 10 minutes, and verified nothing is reading or writing from the drive, weird.

I started with the fstab as a point of reference as a local computer store guy told me that was the reason why I couldn't delete files from that drive. The other partitions on that drive are fine.
I'm still confused.
 
Old 06-05-2007, 04:21 PM   #14
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
Run the command
Code:
df -h
and post the output.
 
Old 06-06-2007, 12:20 AM   #15
cooknet
LQ Newbie
 
Registered: Jun 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by forrestt
Run the command
Code:
df -h
and post the output.
Well, the circumstances have changed, the PC froze, upon rebooting it could not be restarted, it totally crapped out! System could not be started, tons of errors about all the partitions.

I reinstalled linux, but everything is lost...grrr...
During the reinstall, I removed the secondary 80gb drive which was having the problem, and after a successful reinstall, I installed the drive again, but it was not mounted.
I tried mounting it in the gui configuration (harddrake) but it just said cannot be mounted. I did not realize it was saving info to the fstab file.
Upon rebooting I got errors, and the system was halted, I could not start the PC.
I then used the installation cd to boot to a command prompt console and used the vi command to edit out the 3 partition entried in fstab that were placed there by harddrake, thus preventing the reboot of the PC.
Now it reboots fine, but my storage drive is sitting on the table looking at me asking me why I wont install him..lol.

What can I do to mount this drive again and recover all my data??

 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Can't Read Superblock" when mounting a second hard drive Maeltor Linux - Software 7 01-18-2007 02:13 PM
delete all files starting with "new" adnanm Linux - Newbie 2 01-18-2007 07:01 AM
USB jump drive "read-only" in ubuntu 6.06 Piccolo_Pete Linux - Hardware 1 11-26-2006 08:24 AM
Delete a bunch of files with "find" chess Slackware 3 01-28-2006 01:08 PM
USB drive keeps mounting as "read only" I need to write to it. Lossenelin Linux - Hardware 1 02-12-2004 07:49 PM


All times are GMT -5. The time now is 10:20 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration