LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   I can't create a directory (https://www.linuxquestions.org/questions/fedora-35/i-cant-create-a-directory-4175608824/)

EdN 06-29-2017 02:46 AM

I can't create a directory
 
The following are commands I entered as root at the command line, and their outputs.
Seagate_2TB-1 is a mounted data hard drive.

# cd /run/media/enowak
# ls -ld Seagate_2TB-1

drwxrwxrwx. 1 enowak enowak 40960 Jun 27 23:29 Seagate_2TB-1

# cd Seagate_2TB-1
# mkdir Utilities

mkdir: cannot create directory ‘Utilities’: Read-only file system

Why am I not allowed to create a directory in Seagate_2TB-1 ?

hydrurga 06-29-2017 07:30 AM

What is the mount command (including parameters) or fstab line that you used to mount that drive?

Please also run the mount command and paste here only the line that refers to that drive so that we can see which mount parameters are being used.

rknichols 06-29-2017 07:32 AM

The filesystem on that drive has been mounted read-only. What filesystem is it? If it's NTFS, you need to install the ntfs-3g package and use that to mount the filesystem. The kernel's built-in NTFS driver has only very limited write support and defaults to a read-only mount.

Other reasons for a filesystem to be read-only include detected errors, filesystems that are inherently read-only (e.g., ISO9660), or physical write protection of the drive or media.

EdN 06-29-2017 04:28 PM

Thanks for the reply.
After I boot up I click on Nautilus(Files) and it lists Seagate_2TB-1 as one of my drives. When I click on Seagate_2TB-1 it asks me to enter the root password before mounting it, which I do. Apparently it must be mounting it as read-only. It is an NTFS file that was created in Windows 10. I have a dual boot system (Windows 10/Fedora 25). I have ntfs-3g installed. How can I make nautilus mount the Seagate_2TB-1 drive as read-write? What I also don't understand is that I have Linux programs that read/write files from/to Seagate_2TB-1 and they work fine. How can that be if Seagate_2TB-1 is mounted read-only?

Quote:

Originally Posted by rknichols (Post 5728667)
The filesystem on that drive has been mounted read-only. What filesystem is it? If it's NTFS, you need to install the ntfs-3g package and use that to mount the filesystem. The kernel's built-in NTFS driver has only very limited write support and defaults to a read-only mount.

Other reasons for a filesystem to be read-only include detected errors, filesystems that are inherently read-only (e.g., ISO9660), or physical write protection of the drive or media.


rknichols 06-29-2017 05:12 PM

Quote:

Originally Posted by EdN (Post 5728893)
How can I make nautilus mount the Seagate_2TB-1 drive as read-write? What I also don't understand is that I have Linux programs that read/write files from/to Seagate_2TB-1 and they work fine. How can that be if Seagate_2TB-1 is mounted read-only?

The error you reported from mkdir was quite clear, "Read-only filesystem". What does the mount command (with no arguments) report for that partition? If it's using ntfs-3g, it should say, "type fuseblk" and "rw". Perhaps the system log has some information on why the filesystem became read-only.

BTW, if that filesystem was previously mounted by Windows, then it might not have been completely unmounted. NTFS filesystems in that state will be mounted read-only by Linux. You need to disable the "fast boot" option in Windows. That of course would not explain why other Linux programs have read/write access.

EdN 06-30-2017 12:31 AM

Thanks for your help. You're right. When I issue the mount command one of the lines displayed is:
/dev/sda3 on /run/media/enowak/Seagate_2TB-1 type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper= udisks2)

I also found out that actually any programs that I run in Linux can only read existing files. I can't create new ones. Which is what you would expect if the filesystem Seagate_2TB-1 is mounted ro.
As I explained before this filesystem is mounted by Nautilus.If I unmount it using Nautilus(or do a umount /dev/sda3 at the command line) could I then mount it at the command line using the mount command? If so, I'm not sure what options I would use there are so many. For example, would the following command be sufficient?

# mount -rw /dev/sda3 /run/media/enowak/Seagate_2TB-1

Is there some way I could make Nautilus mount it with rw instead of ro?
I'm not an experienced Linux user so I hope the above makes at least some sense.
Again, thank you for your assistance.

Quote:

Originally Posted by rknichols (Post 5728911)
The error you reported from mkdir was quite clear, "Read-only filesystem". What does the mount command (with no arguments) report for that partition? If it's using ntfs-3g, it should say, "type fuseblk" and "rw". Perhaps the system log has some information on why the filesystem became read-only.

BTW, if that filesystem was previously mounted by Windows, then it might not have been completely unmounted. NTFS filesystems in that state will be mounted read-only by Linux. You need to disable the "fast boot" option in Windows. That of course would not explain why other Linux programs have read/write access.


pan64 06-30-2017 03:45 AM

probably this: https://www.linuxquestions.org/quest...-write-676485/

EdN 06-30-2017 06:11 AM

pan64:
Currently my filesystem is mounted as indicated in the following output from the mount command:

/dev/sda3 on /run/media/enowak/Seagate_2TB-1 type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper= udisks2)

I did as was suggested in your reference by issuing the following command:

sudo mount -o remount,rw /dev/sda3

I then issued the mount command and got:

/dev/sda3 on /run/media/enowak/Seagate_2TB-1 type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper= udisks2)

ro got changed to rw. I thought this would do the trick.
Unfortunately I still can't create a new file in the filesystem Seagate_2TB-1.
For example I created a file with LibreOffice Writer and tried to save it in Seagate_2TB-1.
I got the following error message:

Error saving the document Untitled 1:
/run/media/enowak/Seagate_2TB-1/Miscellaneous/Untitled 1.odt does not exist.

There must be some other options besides ro that have to be changed.


Quote:

Originally Posted by pan64 (Post 5729057)


pan64 06-30-2017 06:20 AM

would be nice to show the command you tried to execute.
Does the directory /run/media/enowak/Seagate_2TB-1/Miscellaneous exist? How are the permissions set?

BW-userx 06-30-2017 09:27 AM

are you sure that ntfs-3g is installed?

it is a usb plug in external?

automount if ntfs-3g should just work.

/run/media/enowak/Seagate_2TB-1

permissions should be ok if auto mounted because it is showing /run/media and not something else. Unless you're using that systems path to manually mount it.

if it is automounting ro - click that arrow in your file-manager to unmount it before using command line.

does it have any information/data on it? can you just open gParted and format it ext4 then change owner:group to see if that will get you something, or does it need to be windows formatted?

EdN 06-30-2017 12:11 PM

pan64:

I did the following:
(Miscellaneous is a directory under the directory Seagate_2TB-1 and Seagate_2TB-1 is rw)

[enowak@localhost Seagate_2TB-1]$ ls -ld .
drwxrwxrwx. 1 enowak enowak 40960 Jun 27 23:29 .
[enowak@localhost Seagate_2TB-1]$ cd Miscellaneous
[enowak@localhost Miscellaneous]$ ls -ld .
drwxrwxrwx. 1 enowak enowak 16384 Mar 1 2016 .
[enowak@localhost Miscellaneous]$ echo This is a test >dummyfile
bash: dummyfile: Read-only file system
[enowak@localhost Miscellaneous]$

If I try the same thing in, say, my HOME directory I get a file named dummyfile that contains the line "This is a test"

Quote:

Originally Posted by pan64 (Post 5729098)
would be nice to show the command you tried to execute.
Does the directory /run/media/enowak/Seagate_2TB-1/Miscellaneous exist? How are the permissions set?


rknichols 06-30-2017 01:19 PM

Quote:

Originally Posted by EdN (Post 5729221)
I did the following:
(Miscellaneous is a directory under the directory Seagate_2TB-1 and Seagate_2TB-1 is rw)

[enowak@localhost Seagate_2TB-1]$ ls -ld .
drwxrwxrwx. 1 enowak enowak 40960 Jun 27 23:29 .
[enowak@localhost Seagate_2TB-1]$ cd Miscellaneous
[enowak@localhost Miscellaneous]$ ls -ld .
drwxrwxrwx. 1 enowak enowak 16384 Mar 1 2016 .
[enowak@localhost Miscellaneous]$ echo This is a test >dummyfile
bash: dummyfile: Read-only file system
[enowak@localhost Miscellaneous]$

You have not (a) shown that the filesystem is still mounted read/write after the error occurs, or (b) shown that the directory you are in is actually part of that filesystem (Running "df ." while in that directory would do that.).

EdN 07-01-2017 03:25 AM

I did the following (revised):
(Miscellaneous is a directory under the directory Seagate_2TB-1 and Seagate_2TB-1 is rw)

[enowak@localhost Seagate_2TB-1]$ ls -ld .
drwxrwxrwx. 1 enowak enowak 40960 Jun 27 23:29 .
[enowak@localhost Seagate_2TB-1]$ cd Miscellaneous
[enowak@localhost Miscellaneous]$ ls -ld .
drwxrwxrwx. 1 enowak enowak 16384 Mar 1 2016 .
[enowak@localhost Miscellaneous]$ echo This is a test >dummyfile
bash: dummyfile: No such file or directory
[enowak@localhost Miscellaneous]$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=16300912k,nr_inodes=4075228,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
...
...
...
/dev/sda3 on /run/media/enowak/Seagate_2TB-1 type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper= udisks2)
[enowak@localhost Miscellaneous]$ df .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 1953279996 1756982632 196297364 90% /run/media/enowak/Seagate_2TB-1
[enowak@localhost Miscellaneous]$

Quote:

Originally Posted by rknichols (Post 5729248)
You have not (a) shown that the filesystem is still mounted read/write after the error occurs, or (b) shown that the directory you are in is actually part of that filesystem (Running "df ." while in that directory would do that.).


BW-userx 07-01-2017 07:23 AM

ever think maybe run SMART on it?
man smartctl

rknichols 07-01-2017 07:38 AM

Quote:

Originally Posted by EdN (Post 5729414)
I did the following (revised):
(Miscellaneous is a directory under the directory Seagate_2TB-1 and Seagate_2TB-1 is rw)

[enowak@localhost Seagate_2TB-1]$ ls -ld .
drwxrwxrwx. 1 enowak enowak 40960 Jun 27 23:29 .
[enowak@localhost Seagate_2TB-1]$ cd Miscellaneous
[enowak@localhost Miscellaneous]$ ls -ld .
drwxrwxrwx. 1 enowak enowak 16384 Mar 1 2016 .
[enowak@localhost Miscellaneous]$ echo This is a test >dummyfile
bash: dummyfile: No such file or directory
[enowak@localhost Miscellaneous]$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=16300912k,nr_inodes=4075228,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
...
...
...
/dev/sda3 on /run/media/enowak/Seagate_2TB-1 type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper= udisks2)

Well, this time you did not get the "Read-only filesystem" message, but something else seems to have prevented creating the file. This smells like a damaged NTFS filesystem. Have you connected it to a Windows system and run chkdsk on it? You could try the Linux ntfsfix utility (part of the ntfsprogs package), but it has only very limited repair capability.


All times are GMT -5. The time now is 09:01 PM.