How to write and modify files on a former Windows disk ?

New to Debian (Or Linux in general)? Ask your questions here!

How to write and modify files on a former Windows disk ?

Postby lootw » 2017-03-03 07:58

Good morning !

I have a problem that I haven't been able to solve since I installed Debian a few month ago.
I can access every file on my "Data" partition of my Windows but I can't modify or delete any file or folder, while the Gnome permission window of this disk says that I should be able to do so.
And if I try to change the parameter, it blocks.

Thank you in advance for your help.
lootw
 
Posts: 3
Joined: 2017-03-02 16:02

Re: How to write and modify files on a former Windows disk ?

Postby NFT5 » 2017-03-03 08:36

Are you accessing Permissions as root?
User avatar
NFT5
 
Posts: 190
Joined: 2014-10-10 11:38
Location: Canberra, Australia

Re: How to write and modify files on a former Windows disk ?

Postby lootw » 2017-03-03 10:22

NFT5 wrote:Are you accessing Permissions as root?


No I'm not, I don't know how to access it grpahically in root...
lootw
 
Posts: 3
Joined: 2017-03-02 16:02

Re: How to write and modify files on a former Windows disk ?

Postby Segfault » 2017-03-03 14:11

Accessing files as root would be an incorrect solution. Use root account to give your user necessary permissions, this is what root account is for.
Segfault
 
Posts: 412
Joined: 2005-09-24 12:24

Re: How to write and modify files on a former Windows disk ?

Postby NFT5 » 2017-03-03 16:24

Correct, segfault, but I mentioned accessing Permissions, not files.

Lootw, use Synaptic to add the nautilus-admin package. This will give you the ability, from the Nautilus file manager, to right click and open a file or folder as Superuser or root. You can then change the permissions, from Properties, as required. It's not quite as elegant as using the CLI, but will suffice for everyday use. Once you've set the required permissions, close the superuser window and go back to your normal user privileges. Don't forget to check the box that applies the permissions you've chosen to sub-folders and files contained therein.
User avatar
NFT5
 
Posts: 190
Joined: 2014-10-10 11:38
Location: Canberra, Australia

Re: How to write and modify files on a former Windows disk ?

Postby stevepusser » 2017-03-03 17:37

The disk seems to me to be getting mounted as read-only, which could be because the journal for its ntfs is marking it as "dirty". It does this if Window was hibernated instead of being fully shut down, or if there were writes that didn't make it to the disk--as when there was a crash or power failure.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: AzPainter 2.0.4, Pale Moon 27.3.0, Liquorix kernel 4.11-4, mpv 0.25.0, Kodi 17.1, Ksnip 1.3.1, Mesa 13.0.6
User avatar
stevepusser
 
Posts: 8231
Joined: 2009-10-06 05:53

Re: How to write and modify files on a former Windows disk ?

Postby ajhuang » 2017-03-05 21:10

Hi,

I thought I might add my very similar situation to this thread. Thanks for reading and much appreciation for any suggestions.

I've just added a new, out of the box, expansion disk to my Atom server (3.16.0-4-amd64 #1 SMP Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux). The system is intended to be a headless file server so there's no GUI.

I can read the pre-loaded data on the drive, but I can't write to it. Did the obvious of checking permissions, owners, etc. When the physical drive is unmounted, I can write to the mount point. Do I need to format the msftdata partition for use in Debian?

Details below.

I connected the disk via USB, found sdd, sdd1 and sdd2 in /dev, and was able to mount /sdd2 at /BigSeagate:
/dev/sdd2 on /BigSeagate type ntfs (rw,relatime,uid=0,gid=0,fmask=0177,dmask=077,nls=utf8,errors=continue,mft_zone_multiplier=1)

But I can't write to the drive:

root@ch-blackhole:/home/ajh# echo 'foo' > /BigSeagate/foo
bash: /BigSeagate/foo: Permission denied

though permissions should be fine.
root@ch-blackhole:/home/ajh# ls -l /
total 88
drwx------ 1 root root 4096 Nov 3 19:20 BigSeagate

I can see data on the drive:
root@ch-blackhole:/home/ajh# ls /BigSeagate/
Autorun.inf Seagate SeagateExpansion.ico Start_Here_Win.exe Warranty.pdf

and fdisk doesn't seem to have any problem:
Disk /dev/sdd: 4.6 TiB, 5000981077504 bytes, 9767541167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 6B207E65-561C-41E6-801D-DD0ED965CC5A

Device Start End Sectors Size Type
/dev/sdd1 34 262177 262144 128M Microsoft reserved
/dev/sdd2 264192 9767540735 9767276544 4.6T Microsoft basic data

Partition 2 does not start on physical sector boundary.
ajhuang
 
Posts: 2
Joined: 2017-03-05 20:35

Re: How to write and modify files on a former Windows disk ?

Postby ajhuang » 2017-03-06 07:21

1) The default debian NTFS driver is read-only. See https://wiki.debian.org/NTFS
1.5) Add a couple tools to make it work. See http://unix.stackexchange.com/questions ... ian-wheezy
2) install fuse and ntfs-3g:
apt-get update
apt-get install fuse
apt-get install ntfs-3g
3) Mount:
mount -t ntfs-3g /dev/<drive> /<mountpoint>

I might just reformat to ext4.
ajhuang
 
Posts: 2
Joined: 2017-03-05 20:35

Re: How to write and modify files on a former Windows disk ?

Postby lootw » 2017-03-08 21:47

Thank you everyone for your help, in fact as stevepusser suggested it was my Windows that wasn't fully shut down, now it works !
lootw
 
Posts: 3
Joined: 2017-03-02 16:02


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable