LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 05-01-2011, 11:08 AM   #1
eugeneg
LQ Newbie
 
Registered: May 2011
Posts: 5

Rep: Reputation: 0
How to mount read-only file system


I have a disk that came from an external drive which was dropped and doesn't mount when connected via USB. I removed the drive and connected it to a Windows PC which reports a GPT protected partition that can not be mounted. I therefore assume it was formatted in another OS.

I mounted it on a Linux Mint system and the disk is now readable. Some files/folders can be copied off the disk but most not. Some files can be opened on the original disk but still not copied to another device.

When I open a folder I see a cross in the bottom right corner of the folders I want to copy. I can then right click on and open as administrator and a new windows appears (with a red background). From there I can open a document - to read a .PDF for example, but when I try to drag it to a new location I get the error message "Error while copying. The file <name here> cannot be handled because you do not have permissions to read it".

If I right click on a file and select properties, permissions tab, then try to change 'others' access I get the error message "The permissions could not be changed. Sorry, Could not change the permissions of <file name>: Error setting permissions: read-only file system".

The same thing happens when I try to change ownership: :read-only file system". How can I get to copy files off this disk please ? My knowledge of Linux is very limited.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-01-2011, 11:48 AM   #2
Jinouchi
Member
 
Registered: Jul 2007
Location: WI, USA
Distribution: Debian, Lenny
Posts: 111

Rep: Reputation: 19
If it says you dont have the proper permissions, that means you need to do it as root. I recommend using the command line if you're comfortable with it.

The cp command is the copy command:
Code:
 cp target_file destination_folder
To do it as root, use the sudo command:
Code:
sudo cp target_file destination_folder
Hope this helps. Let me know how it goes.
 
Old 05-01-2011, 11:56 AM   #3
eugeneg
LQ Newbie
 
Registered: May 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for the reply. How do I get to the command line prompt ?
If I want to copy the entire contents of my disk to a folder on the desktop, how would I refer to those locations in the CP command please ?
 
Old 05-01-2011, 12:08 PM   #4
Sjonnie48
Member
 
Registered: Jun 2005
Location: Earth
Distribution: Ubuntu10.04
Posts: 308

Rep: Reputation: 43
You certainly have a program named 'terminal'. That's the command line. For an introduction read http://hacktux.com/bash/function
 
Old 05-01-2011, 12:11 PM   #5
Jinouchi
Member
 
Registered: Jul 2007
Location: WI, USA
Distribution: Debian, Lenny
Posts: 111

Rep: Reputation: 19
Good questions. I'm not familiar with the distro of Linux you're using, but to get to the command prompt you need to find the Terminal or Terminal Emulator program. Once there, you need to know the path of your drive - it might be /media/sdb1 or /mnt/sdc1, for example. Once you know that, just

Code:
sudo cp -r /device/path/* /destination/folder/
-r tells it to copy recursivley - copying all subfolders - and the asterisk is a wildcard, which means, in this case, all files and folders on that device.
 
2 members found this post helpful.
Old 05-01-2011, 12:39 PM   #6
lisle2011
Member
 
Registered: Mar 2011
Location: Surrey B.C. Canada (Metro Vancouver)
Distribution: Slackware 2.6.33.4-smp
Posts: 183
Blog Entries: 1

Rep: Reputation: 25
Copying a disk and changing permissions

If you don't really know how to get to a command line you probably have not added your user name to the /etc/sudoers.

If you know the root password you can also su in terminal window and that will do the same thing only your now very powerful so be careful.

And while you are the superuser edit /etc/sudoers and add your name using the visudo editor. Now you can use the sudo command.

Depending on the distribution you are using the file might be elsewhere such as sudoers.d so don't give up if you don't find it right away.

locate /sudoers
or
find /sudoers
should help

Last edited by lisle2011; 05-01-2011 at 12:43 PM.
 
1 members found this post helpful.
Old 05-01-2011, 12:56 PM   #7
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
If (as the message you reported in your first post suggested) the whole file system is mounted read only, even root will not be able to make any changes to the permissions. If you are in a terminal window, issue the command mount (with no arguments) to get a list of your currently mounted file systems. Look for the problem drive in the list, and verify the mount settings. If it says RO, then the command su -c 'mount -o remount,defaults /dev/sd[xn] /[place]' (where [xn] is the drive letter and partition number of the file system you're mounting, and [place] is the location at which you're mounting it) should remount the file system with read and write permissions.

Note that your drive may have incurred physical damage when it hit the floor which might make it impossible for you to recover some files. Have you tried running fsck on the (unmounted) drive? Warning: You should probably image the drive (use the ddrecover command) before running fsck so you have a "prior to messing" drive copy. In fact, you might be better off imaging the drive and using the image in your recovery efforts instead of the (damaged?) drive. If the drive has incurred physical damage, the damage may get worse every time you apply power to the drive. (For example, a bent drive head could be scraping the drive platter, filling the drive with magnetic "dust.")
 
1 members found this post helpful.
Old 05-01-2011, 01:06 PM   #8
eugeneg
LQ Newbie
 
Registered: May 2011
Posts: 5

Original Poster
Rep: Reputation: 0
I opened the the File Browser, right clicked the drive then mounted it. Then right clicked again and opened it in Terminal. I then entered the command
sudo cp -r * ~/Desktop
That seemed to work - thanks. I now have a copy on a disk I believe to be working properly.

Unfortunately the protections seem to have been copied also. If I open the folder into which the files were copied, many sub-folders have a cross on them. I right clicked one and opened as Administrator (red background). I was seemingly able to change the owner to me and the Access to read-write, but when I try to drag the file to the desktop I get the error "The file <file name> cannot be handled because you do not have permissions to read it". However, if I double click it (a .PDF file) I get to read it. Confusion.

My ultimate aim here is to copy all the files to a CD where they can be read by anyone on any computer.
 
Old 05-01-2011, 01:19 PM   #9
eugeneg
LQ Newbie
 
Registered: May 2011
Posts: 5

Original Poster
Rep: Reputation: 0
PTrenholme, our posts crossed in the ether. I typed Mount and the first line is what I presume relates to the problem disk:
/dev/sda1 on / type ext4 (rw,errors=remount - ro)
When I copied the files there were two that caused errors but I don't care about those two.
 
Old 05-01-2011, 02:19 PM   #10
Jinouchi
Member
 
Registered: Jul 2007
Location: WI, USA
Distribution: Debian, Lenny
Posts: 111

Rep: Reputation: 19
Good. Now that you have a copy on your desktop, you can do
Code:
cd ~/Desktop
sudo chmod -R 755 *
This will make all the files on your desktop readable by any user.
 
2 members found this post helpful.
Old 05-01-2011, 04:34 PM   #11
eugeneg
LQ Newbie
 
Registered: May 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Jinouchi. THANK YOU very much.
 
  


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
Mount XFS file-system disk can't read superblock v1nc3ntlaw Linux - Hardware 7 04-28-2011 12:07 AM
Read Only File System? Can't read superblock! haughjd Linux - Software 4 01-15-2008 09:27 AM
How to read .chm file in fedora, can't mount ntfs file system ishti_du Linux - Newbie 12 03-06-2007 04:27 AM
Can Fedora Core 3 mount and read vmfs file system smkamene Linux - Software 2 01-24-2005 10:24 PM
Change from Read only to Read Write File System? justiceisblind Linux - Newbie 3 03-03-2002 08:23 PM


All times are GMT -5. The time now is 12:57 AM.

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