Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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

    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

    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. $spacer_open
  5. #4

    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 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