Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
lootw
Posts: 3
Joined: 2017-03-02 16:02

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

#1 Post by lootw »

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.

User avatar
NFT5
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 598
Joined: 2014-10-10 11:38
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 43 times

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

#2 Post by NFT5 »

Are you accessing Permissions as root?

lootw
Posts: 3
Joined: 2017-03-02 16:02

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

#3 Post by lootw »

NFT5 wrote:Are you accessing Permissions as root?
No I'm not, I don't know how to access it grpahically in root...

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

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

#4 Post by Segfault »

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.

User avatar
NFT5
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 598
Joined: 2014-10-10 11:38
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 43 times

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

#5 Post by NFT5 »

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
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

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

#6 Post by stevepusser »

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.
MX Linux packager and developer

ajhuang
Posts: 2
Joined: 2017-03-05 20:35

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

#7 Post by ajhuang »

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 ?

#8 Post by ajhuang »

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.

lootw
Posts: 3
Joined: 2017-03-02 16:02

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

#9 Post by lootw »

Thank you everyone for your help, in fact as stevepusser suggested it was my Windows that wasn't fully shut down, now it works !

Post Reply