A
A
antoshka_basenko2021-10-03 15:13:38
linux
antoshka_basenko, 2021-10-03 15:13:38

Put ubuntu next to windows. How to write files from Ubuntu to Drive D?

Delivered about a week ago Unbuntu in a separate section of the hard drive. She finds drive D and I can connect it (it recognizes it as a separate device like a flash drive, but you have to do this every time you turn it on). The other day I created a project in InteliJIDEA on drive D and everything worked fine, I could write files, but today for some reason when I went into InteliJIDEA when I tried to create a project on drive D, I got an error that I could not write files there. I went into the file manager and tried to create a folder on drive D, but this button is not active (I can view the files that are there).
How to make drive D possible to write information from ubuntu? And extra. the question is whether it is possible to do something so that ubuntu automatically finds drive d and it does not need to be "connected" every time after it is turned on?

PS do not offer to write information to the partition with ubuntu) before that, I can guess myself, but I need to write information to disk d

PSS booted from Windows. Then I booted again from Ubuntu and everything worked. hmm how does it work

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
veryoriginalnickname, 2021-10-03
@antoshka_basenko

And extra. the question is whether it is possible to do something so that ubuntu automatically finds drive d and does not have to be "connected" every time after turning it on?

I need to write a .mount file and add it to systemd
here is an example of my config:
mountDrives.sh
#!/bin/bash
rights=$(id -u)
if ; then
  echo "Run with sudo."
  exit 1
fi

echo "!!! DONT FORGET ADD DRIVE UUID TO THE .MOUNT FILE (IN WHAT=)"
read -p "Continue? (Y/N)" yesNo
if  || ; then
  exit 1
fi

mkdir -p /drives
cp drives-d.mount /etc/systemd/system/drives-d.mount
systemctl daemon-reload
systemctl start drives-d.mount
systemctl status drives-d.mount
systemctl enable drives-d.mount
exit 1

drives-d.mount
[Unit]
Description=Mount Second Drive (/drives/d)

[Mount]
What=/dev/disk/by-uuid/7A003D2D003CF22D
Where=/drives/d
#Type=ntfs
#Options=defaults

[Install]
WantedBy=multi-user.target

S
SagePtr, 2021-10-03
@SagePtr

PSS booted from Windows. Then I booted again from Ubuntu and everything worked. hmm how does it work
Very simply, ntfs-3g (or whatever driver is used in Ubuntu to access NTFS) does not mount an NTFS volume for writing if it is marked dirty. This is done to avoid possible data corruption on the volume, as The NTFS file system is proprietary and not officially documented. A "dirty" volume is marked if the system shutdown was unexpected. So booting into Windows (and possibly running chkdsk afterwards if the system requires it at startup) solves this problem.

M
meDveD_spb, 2021-10-03
@meDveD_spb

And extra. the question is whether it is possible to somehow make ubuntu automatically find the disk d

yes, put it in /etc/fstab and it will automatically mount
booted from windows. Then booted again from ubuntu and everything worked.

Depends on how Windows was turned off.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question