LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   scp claims destination is read only (https://www.linuxquestions.org/questions/linux-newbie-8/scp-claims-destination-is-read-only-4175622873/)

bkelly 02-01-2018 01:24 PM

scp claims destination is read only
 
Need to use scp to copy files from a laptop to an embedded system via an Ethernet connection. Both are running Ubuntu release 14.
From the workstation enter:

Code:

scp config.json.original root@192.168.1.20:/home/root/config.json.original
The response is
Code:

scp: /home/root/config.json.original: read-only file system
Use
Code:

ssh root@192.168.1.20
to log in to the embedded system and go to directory / and issue:
Code:

ls –al
There it shows for /home
Code:

drwxrwsrwx
cd to home, do ls again for root, and it shows
Code:

drwxrwxrwx
This newbie interprets that as stating that the file system where I am trying to write is NOT read only. What might I change to resolve this and be able to write to the embedded system?

scasey 02-01-2018 01:32 PM

That you can read/list files on a drive does not answer the question of whether or not its read-only.
Attempt to touch a new file while ssh'd in and let us know what happens, please.

TB0ne 02-01-2018 01:38 PM

Quote:

Originally Posted by bkelly (Post 5814360)
Need to use scp to copy files from a laptop to an embedded system via an Ethernet connection. Both are running Ubuntu release 14.
From the workstation enter:
Code:

scp config.json.original root@192.168.1.20:/home/root/config.json.original
The response is
Code:

scp: /home/root/config.json.original: read-only file system
Use
Code:

ssh root@192.168.1.20
to log in to the embedded system and go to directory / and issue:
Code:

ls ľal
There it shows for /home
Code:

drwxrwsrwx
cd to home and do ls again and for root it shows
Code:

drwxrwxrwx
This newbie interprets that as stating that the file system where I am trying to write is NOT read only. What might I change to resolve this and be able to write to the embedded system?

You are 50% right; the DIRECTORY tree is read/write....but that is not the filesystem. On the embedded system, type in (as root) "mount", and you should see lines similar to this:
Code:

/dev/sda1 on /home type btrfs (rw,relatime,ssd,space_cache,subvolid=257,subvol=/@)
I have bolded a couple of characters in the line; the "rw" indicates that it is mounted as read/write. Read-only will have "ro" there. Your only choice at that point would be to modify the fstab file in /etc (from maintenance mode) and change the /home partition to mount as read-write. Read the man page on fstab for options.

giis 02-02-2018 05:18 AM

I assume you have separate /home partition. Directory permission is not enough, if you have read-only device permission. Check the device permission with command like
Quote:

mount | grep ro,
It will list read-only fs. Then you can remount it as read-write with command

Quote:

mount -o remount,rw /path/to/mountpt

bkelly 02-02-2018 09:59 AM

As noted, the target device is an embedded system and I now understand that the entire system can be designated as read-only. Now i know how to check such concepts. In this case a reboot resolved the problems.
Thank you to each for the replies.


All times are GMT -5. The time now is 02:35 AM.