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 02-19-2011, 08:42 AM   #1
mnb007
LQ Newbie
 
Registered: Feb 2011
Posts: 8

Rep: Reputation: 0
How to write to a read-only filesystem


Hi guys, First to thank you before hand for any reply.
I have been given a headless linux system running from a SD card. I get into it by putty, directly to root, not other user and even /home dir.
Whatever I copy or write will dissapear because is ro.
my etc/fstab file is:
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda1 /boot vfat noauto,rw 0 0
I am new to linux, so any help will be much appreciated :-)
Thanks,
 
Old 02-19-2011, 09:04 AM   #2
mnb007
LQ Newbie
 
Registered: Feb 2011
Posts: 8

Original Poster
Rep: Reputation: 0
If I
# cat /proc/mounts then

rootfs / rootfs rw 0 0 tmpfs /.tmpfs tmpfs rw,relatime 0 0
/dev/mmcblk0p1 /boot vfat ro,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/mmcblk0p1 /.tmpfs/.zoot vfat ro,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/loop0 /.tmpfs/.root ext2 ro,relatime 0 0
unionfs / unionfs rw,relatime,dirs=/.tmpfs/.overlay=rw:/.tmpfs/.root=ro 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /dev/pts devpts rw,relatime,gid=5,mode=620 0 0
none /dev/shm tmpfs rw,relatime 0 0
none /dev/shm tmpfs rw,relatime 0 0

ANd then I
# mount -o remount,rw /dev/mmcblk0p1/

and still same. (Just in case this info give you some hints)
Thanks,
 
Old 02-19-2011, 07:33 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,175

Rep: Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562
Does sd card have a read switch on the side of it? There is also some line I think on the sd that if open prevents writes.
 
Old 02-20-2011, 07:10 AM   #4
mnb007
LQ Newbie
 
Registered: Feb 2011
Posts: 8

Original Poster
Rep: Reputation: 0
No, it is a micro SD card, and doesn't have any switch at all. I guess I will have to remove it and open it with different system and change some scripts. Any idea which script and line should I look for and update?
Thanks,
 
Old 03-01-2011, 03:11 PM   #5
mnb007
LQ Newbie
 
Registered: Feb 2011
Posts: 8

Original Poster
Rep: Reputation: 0
SORTED:
.-remove the SD card and put into another linux system.
.-create a temporary folder /mnt/tmp
.- find out the card device details: cat /proc/mounts and mount as need
.- mount the card as "sudo mount -t ext2 -o loop /media/mymedia/rootfs.ext2 /mnt/tmp
and then you can go to /mnt/tmp and find all your files where you can change rwx as you need.
I told you I am new to linux...
 
Old 03-01-2011, 04:17 PM   #6
zWaR
Member
 
Registered: Dec 2003
Distribution: Slackware, Alpine Linux, Ubuntu, Debian
Posts: 219

Rep: Reputation: 35
Modify /etc/fstab on line beginning with /dev/hda1 like this (you have to do this as root):

Code:
/dev/hda1 /boot vfat auto,rw,user,dmask=007,fmask=117 0 0
Save this and reboot.

If that doesn't work try the following:
Code:
/dev/hda1 /boot vfat auto,rw,dmask=007,fmask=117,uid=<user>,gid=<group> 0 0
Replace <user> with your username, you can get that by issuing the following command:
Code:
whoami
and replace <group> with your group name (or group id), you can get that by issuing the following:
Code:
id
(see http://linux.die.net/man/1/id for more info on id)

Again save /etc/fstab and reboot.

Check please if /dev/mmcblk0p1 is not only a link for /dev/hda1.

Here are some additional resources about /etc/fstab:
http://www.tuxfiles.org/linuxhelp/fstab.html
http://ubuntuforums.org/showthread.php?t=283131
 
  


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
Read Write access to a iso9660 filesystem..mount a .iso image as read write ceazar123 Linux - Newbie 16 09-01-2010 10:07 AM
Read Write access to a iso9660 filesystem..mount a .iso image as read write ceazar123 Linux - General 2 08-26-2010 04:32 PM
How can I have: Root has Read-Write, user has read only for the boot filesystem? xmrkite Linux - Software 6 10-16-2008 05:31 AM
how do I change the filesystem from read-only to read-write? les_chow Linux - Newbie 5 05-26-2004 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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