LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 06-29-2017, 02:46 AM   #1
EdN
Member
 
Registered: Jun 2009
Location: Temecula, CA
Distribution: Fedora 19
Posts: 38

Rep: Reputation: 0
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 ?
 
Old 06-29-2017, 07:30 AM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
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.
 
Old 06-29-2017, 07:32 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
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.
 
Old 06-29-2017, 04:28 PM   #4
EdN
Member
 
Registered: Jun 2009
Location: Temecula, CA
Distribution: Fedora 19
Posts: 38

Original Poster
Rep: Reputation: 0
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 View Post
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.
 
Old 06-29-2017, 05:12 PM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by EdN View Post
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.

Last edited by rknichols; 06-29-2017 at 05:26 PM. Reason: Add "BTW ..."
 
Old 06-30-2017, 12:31 AM   #6
EdN
Member
 
Registered: Jun 2009
Location: Temecula, CA
Distribution: Fedora 19
Posts: 38

Original Poster
Rep: Reputation: 0
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 View Post
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.
 
Old 06-30-2017, 03:45 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
probably this: https://www.linuxquestions.org/quest...-write-676485/
 
Old 06-30-2017, 06:11 AM   #8
EdN
Member
 
Registered: Jun 2009
Location: Temecula, CA
Distribution: Fedora 19
Posts: 38

Original Poster
Rep: Reputation: 0
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 View Post
 
Old 06-30-2017, 06:20 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
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?
 
Old 06-30-2017, 09:27 AM   #10
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
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?
 
Old 06-30-2017, 12:11 PM   #11
EdN
Member
 
Registered: Jun 2009
Location: Temecula, CA
Distribution: Fedora 19
Posts: 38

Original Poster
Rep: Reputation: 0
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 View Post
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?

Last edited by EdN; 06-30-2017 at 12:41 PM.
 
Old 06-30-2017, 01:19 PM   #12
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by EdN View Post
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.).
 
Old 07-01-2017, 03:25 AM   #13
EdN
Member
 
Registered: Jun 2009
Location: Temecula, CA
Distribution: Fedora 19
Posts: 38

Original Poster
Rep: Reputation: 0
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 View Post
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.).
 
Old 07-01-2017, 07:23 AM   #14
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
ever think maybe run SMART on it?
man smartctl
 
Old 07-01-2017, 07:38 AM   #15
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by EdN View Post
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.
 
  


Reply



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
[SOLVED] how to create directory in an existing directory with single command Tauatioti Linux - Newbie 21 08-05-2014 10:15 PM
how to create directory in an existing directory with single command Tauatioti Linux - Newbie 2 11-30-2013 02:17 AM
Create a directory named like his Parent Directory sina_saeedi82 Linux - Newbie 8 05-26-2011 11:36 AM
mkdir : cannot create directory : no such file or directory patcheezy Linux - Newbie 6 05-13-2009 11:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 01:05 AM.

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
Open Source Consulting | Domain Registration