You are not logged in.

#1 2018-05-02 23:39:47

knewyousir
Member
Registered: 2018-02-22
Posts: 20

[SOLVED] Help mounting NTFS drive as 'rw'

Hi all,
I am having trouble getting my NTFS drive to mount as 'rw' at boot.
Can you please help a newb out?

Here is what the entry on my fstab file looks like:

# /dev/sdc1
UUID=28AC9E82AC9E49E8   /run/media/myusername/Files         ntfs-3g         rw,uid=myusername,gid=users,umask=0022      0 0

Last edited by knewyousir (2018-05-03 02:28:22)

Offline

#2 2018-05-02 23:44:36

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Help mounting NTFS drive as 'rw'

What is the issue exactly?

Offline

#3 2018-05-03 00:20:56

knewyousir
Member
Registered: 2018-02-22
Posts: 20

Re: [SOLVED] Help mounting NTFS drive as 'rw'

I'm trying to run a qemu VM from this drive but it can't open the hda.img as the drive is a "read-only file system"

: Could not open '/run/media/knewyousir/Files/archFiles/virtualMachines/winServer2016Test01/hda.img': Read-only file system

basically, i've set what i think should be the correct entry in fstab, but the drive is nevertheless being mounted as read-only.
not really sure where to go with this.

Last edited by knewyousir (2018-05-03 00:21:59)

Offline

#4 2018-05-03 00:32:56

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Help mounting NTFS drive as 'rw'

What is the output of

findmnt /run/media/myusername/Files
mount

Please also post the command you are using that produced the output in post #3 and its full output.
Edit:
Is it /run/media/knewyousir/Files or /run/media/myusername/Files ?  Is one entry obfuscated without you mentioning it?

Last edited by loqs (2018-05-03 00:35:17)

Offline

#5 2018-05-03 01:31:22

NoSuck
Member
Registered: 2015-03-04
Posts: 157
Website

Re: [SOLVED] Help mounting NTFS drive as 'rw'

knewyousir wrote:
,uid=myusername,gid=users,umask=0022

Remove this.  It is unnecessary and potentially misleading.

Please also share output of the following:

ls -ld /run/media/myusername/Files

Offline

#6 2018-05-03 01:49:31

knewyousir
Member
Registered: 2018-02-22
Posts: 20

Re: [SOLVED] Help mounting NTFS drive as 'rw'

loqs wrote:

What is the output of

findmnt /run/media/myusername/Files
mount

output:

TARGET                  SOURCE    FSTYPE  OPTIONS
/run/media/knewyousir/Files /dev/sdd1 fuseblk ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096

Please also post the command you are using that produced the output in post #3 and its full output.
Edit:
Is it /run/media/knewyousir/Files or /run/media/myusername/Files ?  Is one entry obfuscated without you mentioning it?

i replaced my username with 'knewyousir'/'myusername' to hide my username, which is my real name

command that produced the output:

[knewyousir@myserv winServer2016Test01]$ ./launchVM.sh 
qemu-system-x86_64: -drive file=/run/media/knewyousir/Files/archFiles/virtualMachines/winServer2016Test01/hda.img,index=1,media=disk,format=raw: Could not open '/run/media/knewyousir/Files/archFiles/virtualMachines/winServer2016Test01/hda.img': Read-only file system
./launchVM.sh: line 8: -machine: command not found

my script, launchVM.sh:

qemu-system-x86_64 \
        -drive file=/run/media/knewyousir/Files/archFiles/virtualMachines/winServer2016Test01/hda.img,index=1,media=disk,format=raw \
        -drive media=cdrom,index=2,file=/run/media/knewyousir/Files/archFiles/virtualMachines/isos/14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.iso \
        -enable-kvm \
        -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time \
        -m 4G \
#       -smp ,sockets=1,cores=1,threads=1 \
        -machine usb=on \
        -device usb-mouse \
        -device usb-kbd \
        -boot menu=on \
        -rtc base=localtime,clock=host \
        -parallel none \
        -serial none \
        -show-cursor \
        -name "ServTest" \
        -no-acpi \
        -no-hpet \
        -no-reboot \
#       -device amd-iommu \
#       -machine accel=kvm \

this script has worked just fine in the past (when the drive was manually mounted as root), even if the 'usb=on' line is throwing that error message...

-a kind thank you for your help with this-

Last edited by knewyousir (2018-05-03 01:57:28)

Offline

#7 2018-05-03 01:51:58

knewyousir
Member
Registered: 2018-02-22
Posts: 20

Re: [SOLVED] Help mounting NTFS drive as 'rw'

NoSuck wrote:
knewyousir wrote:
,uid=myusername,gid=users,umask=0022

Remove this.  It is unnecessary and potentially misleading.

Please also share output of the following:

ls -ld /run/media/myusername/Files

output:

[knewyousir@myserv winServer2016Test01]$ ls -ld /run/media/knewyousir/Files
drwxr-xr-x 1 knewyousir users 4096 Apr 22 03:32 /run/media/knewyousir/Files

-many thanks for your help with this-

Last edited by knewyousir (2018-05-03 01:52:26)

Offline

#8 2018-05-03 01:57:20

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Help mounting NTFS drive as 'rw'

you do have the ntfs-3g package installed, right?

Offline

#9 2018-05-03 01:58:40

knewyousir
Member
Registered: 2018-02-22
Posts: 20

Re: [SOLVED] Help mounting NTFS drive as 'rw'

Scimmia wrote:

you do have the ntfs-3g package installed, right?

yes, definitely is installed

Offline

#10 2018-05-03 01:59:47

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Help mounting NTFS drive as 'rw'

Alright, had to check. Unmount it and mount it again manually, does it work or does it throw an error?

Offline

#11 2018-05-03 02:09:10

knewyousir
Member
Registered: 2018-02-22
Posts: 20

Re: [SOLVED] Help mounting NTFS drive as 'rw'

Scimmia wrote:

Alright, had to check. Unmount it and mount it again manually, does it work or does it throw an error?

so I ran 'mount' alone and see this towards the bottom of the output:

/dev/sdd1 on /run/media/knewyousir/Files type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096) 

it looks like its being mounted as /dev/sdd1 instead of what i specified? I see 'ro' as well...
when i try to umount this target i get:

[knewyousir@myserv ~]$ sudo umount /dev/sdd1
umount: /run/media/knewyousir/Files: target is busy.

Offline

#12 2018-05-03 02:15:19

knewyousir
Member
Registered: 2018-02-22
Posts: 20

Re: [SOLVED] Help mounting NTFS drive as 'rw'

ok- maybe this is the breakthrough.

closed another terminal window i had open- it was reading a directory on the external which is why i couldn't umount.
umount'ed successfully

mount produced this now:

[knewyousir@myserv ~]$ sudo mount /dev/sdd1 /run/media/
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)

weird because i did do a full shutdown (windows mounts this as well and stores files on this drive from time to time- i have a dual boot setup- windows OS and linux OS are on separate HDDs; /dev/sdd1 is a third external HDD for bulk file storage duties)

i thought there was a way to clear this and force the mount... but not remembering atm...
also, how can I perhaps force that to be done/scripted on boot, or am I approaching this incorrectly?

Last edited by knewyousir (2018-05-03 02:16:53)

Offline

#13 2018-05-03 02:27:20

knewyousir
Member
Registered: 2018-02-22
Posts: 20

Re: [SOLVED] Help mounting NTFS drive as 'rw'

ok solved-

ran this command on the external drive

sudo ntfsfix /dev/sdd1

rebooted and the drive was mounted as rw successfully!

drive still mounting as sdd1 and not as sdc1 as specified in fstab though...

Offline

#14 2018-05-03 02:46:03

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [SOLVED] Help mounting NTFS drive as 'rw'

You can use UUID's instead of direct device paths for a more consistant approach. https://wiki.archlinux.org/index.php/Fs … stem_UUIDs

Sometimes the /dev device path can change when booting your system, but UUID's never change, so if you use them in fstab instead of /dev/ devices, you will not have the trouble of them changing names.

Offline

#15 2018-05-03 03:10:08

knewyousir
Member
Registered: 2018-02-22
Posts: 20

Re: [SOLVED] Help mounting NTFS drive as 'rw'

circleface wrote:

You can use UUID's instead of direct device paths for a more consistant approach. https://wiki.archlinux.org/index.php/Fs … stem_UUIDs

Sometimes the /dev device path can change when booting your system, but UUID's never change, so if you use them in fstab instead of /dev/ devices, you will not have the trouble of them changing names.

ah thank you- i see- i think i am doing that already.
upon closer inspection, my fstab file does not specify the name (sdc1) anywhere, only in commented text.
is there anyway to force it to be mounted with that particular name (/sdc1) in fstab?

Offline

#16 2018-05-03 03:11:04

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Help mounting NTFS drive as 'rw'

I think you missed the point, that name is unreliable. sdc can be come sdd on the next boot totally at random.

Offline

#17 2018-05-03 04:09:16

knewyousir
Member
Registered: 2018-02-22
Posts: 20

Re: [SOLVED] Help mounting NTFS drive as 'rw'

Scimmia wrote:

I think you missed the point, that name is unreliable. sdc can be come sdd on the next boot totally at random.

I see now- they are talking about specifying by UUID rather than path.
I was mostly concerned with how to call this drive consistently in scripts and such.
I will take a look at the link and figure out how to make adjustments as needed...

Many thanks to you all!

Last edited by knewyousir (2018-05-03 04:09:33)

Offline

Board footer

Powered by FluxBB