Find the answer to your Linux question:
Results 1 to 4 of 4
I need to load some newer files on an Embedded RTLinux SBC that boots into a Flight Instrument program. The manufacturer is out of business so is not of much ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2010
    Posts
    2

    File system to rw -automate fstab change


    I need to load some newer files on an Embedded RTLinux SBC that boots into a Flight Instrument program. The manufacturer is out of business so is not of much help. During the boot process it looks for a USB stick and a *.sh file that is normally used as an update file. Creating a BASH script I can look at and copy files to the USB (I checked whoami = root) but I cannot copy any file from the USB back to the file system. When I try I get a “File System is Read Only” message. I thought it might be permissions but chmod does not work either. Now after some research (hey, I’m only a couple days into Linux) I found what I believe is the culprit sitting in the /etc/fstab file. The first line is
    /dev/hda3 / ext2 ro,noatime 0 1
    and I’m pretty sure the ro needs to become rw. The problem is how can I change this? Remember all I have to work with is a *.sh script on a USB stick which exits for a reboot after the script is finished. I think once I can get the file system to rw I can change permissions, copy and overwrite files, etc. and then reset back to ro when I’m done…but how?

  2. #2
    Just Joined!
    Join Date
    Aug 2007
    Posts
    2

    changing permissions in a filesystem

    As root,

    cp -vp /etc/fstab /etc/fstabOrig

    vi (or any text editor) /etc/fstab
    change ro to rw in the line for the USB stick
    and save the file

  3. #3
    Just Joined!
    Join Date
    Aug 2007
    Posts
    2

    Changing permissions on a filesystem

    Oops, in a file script as root, the command would be:

    sed -e '/\/dev/\/hda3/s/ro/rw/' /etc/fstab

    Normally the USB filesystem does not appear in /etc/fstab , you may also try to remove the entry entirely from /etc/fstab

  4. #4
    Just Joined!
    Join Date
    Jan 2010
    Posts
    2

    Thumbs up [solved]

    Sorry it took so long to respond...been away for the past month+.

    I found the solution to my problem

    mount -n -o remount,rw /

    this allows a remount with write permissions...chmod /etc/fstab to write permissions and copied a new fstab file with rw instead of ro

    after that subsequent reboots allowed me to chmod all required directories and files and copy the new ones I was after.

    when finished...reset directories and files to read only and put the original fstab with ro back.

    Remember this is all done with a usb stick and bash scripting...no keyboard attached to the embedded sbc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •