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 > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-07-2021, 05:19 PM   #1
PaulExordium
Member
 
Registered: Dec 2020
Distribution: Debian, Tails, Kodachi, Mint DE
Posts: 92

Rep: Reputation: Disabled
Sharing a data partion between OS in a multi-boot system


In this computer with Windows 8, Debian 9 and Debian 10, I created a FAT32 data partition with the Gnome Disk utility, set the mount points, set the mount options to "defaults" and mount at startup.

The partition is recognize at startup by all 3 operating systems.
Windows 8 can read and write files correctly.
Both Debian 9 an 10 can read but cannot write files (unable to create file).

What am I missing?
 
Old 01-07-2021, 05:24 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
You are probably missing permissions. FAT doesn't have the notion of file ownership. By default, when you mount a FAT filesystem on Linux, all files are owned by whoever mounted it, which is often root. You can, however, provide mount options that give files a different owner. I believe it's also possible to change files' default permissions by mount options.

As which user are you attempting to write files? What are the precise error messages? What are the filesystem's mount options on Debian?

Last edited by berndbausch; 01-07-2021 at 05:26 PM. Reason: added explanation
 
Old 01-08-2021, 03:41 AM   #3
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by PaulExordium View Post
set the mount options to "defaults"
What am I missing?
If you're the only/first user, chances are your uid and gid are 1000, try the options below in /etc/fstab:
Code:
defaults,windows_names,uid=1000,gid=1000,umask=022
 
Old 01-08-2021, 04:00 PM   #4
PaulExordium
Member
 
Registered: Dec 2020
Distribution: Debian, Tails, Kodachi, Mint DE
Posts: 92

Original Poster
Rep: Reputation: Disabled
berndbausch,
using GNOME Disk utility the ownership of the mounted partition is root:root by default for a FAT32 or NTFS file system, and changing the ownership is not possible:
"chown <user> /mnt/SHDATA" gives the error "chown: changing ownership of 'SHDATA': Operation not permitted"

However if the partition is formatted as ext4, the default ownership is <user>:<user>.
See below the partition layout and the fstab.

What I really would like to have is a partition that behaves like an external USB drive. Is it at all possible?
 
Old 01-08-2021, 04:01 PM   #5
PaulExordium
Member
 
Registered: Dec 2020
Distribution: Debian, Tails, Kodachi, Mint DE
Posts: 92

Original Poster
Rep: Reputation: Disabled
Brains,
the initial user is also the sole user. The options you suggested
"defaults,windows_names,uid=1000,gid=1000,umask=022" don't fix it, and at reboot the system is forced into recovery mode with the error message that the option "windows_names" is not recognized. Typo error?
 
Old 01-08-2021, 04:02 PM   #6
PaulExordium
Member
 
Registered: Dec 2020
Distribution: Debian, Tails, Kodachi, Mint DE
Posts: 92

Original Poster
Rep: Reputation: Disabled
Code:
Model: ATA WDC WD10EZEX-21M (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name                          Flags
 1      1049kB  630MB   629MB   ntfs            Basic data partition          hidden, diag
 2      630MB   945MB   315MB   fat32           EFI system partition          boot, esp
 3      945MB   1079MB  134MB                   Microsoft reserved partition  msftres
 4      1079MB  492GB   491GB   ntfs            Basic data partition          msftdata
 6      492GB   642GB   150GB   ext4            Debian9
 7      642GB   646GB   4000MB  linux-swap(v1)  Swap1
 8      646GB   650GB   4000MB  linux-swap(v1)  Swap2
 9      650GB   654GB   4000MB  linux-swap(v1)  Swap3
10      654GB   658GB   4000MB  linux-swap(v1)  Swap4
11      658GB   808GB   150GB   ext4            Debian10
12      808GB   818GB   10.0GB  fat32           Shared Data                   msftdata
13      818GB   983GB   165GB   ext4            Future Use
 5      983GB   1000GB  17.4GB  ntfs            Basic data partition          hidden, diag
 
Old 01-08-2021, 04:03 PM   #7
PaulExordium
Member
 
Registered: Dec 2020
Distribution: Debian, Tails, Kodachi, Mint DE
Posts: 92

Original Poster
Rep: Reputation: Disabled
Code:
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda6 during installation
UUID=ab2227b8-08e3-4c89-a7d2-282cb4844fd1 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=083D-5279  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda7 during installation
  UUID=88a7957c-beb9-403e-8ec8-d6aa4f0f78b9 none            swap    sw              0       0
  UUID=168aa4e9-2a64-4a1b-bf1e-8ce3d3846d4c none            swap    sw              0       0
  UUID=e6a243d4-5224-497d-b4b6-77b625be13e2 none            swap    sw              0       0
  UUID=9f0408b5-3081-49d1-afc8-35863598a44b none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
#
LABEL=FUTUSE /mnt/FUTUSE auto nosuid,nodev,nofail 0 0
#
# All attempts below have failed:
  LABEL=SHDATA /mnt/SHDATA auto defaults 0 0
# LABEL=SHDATA /mnt/SHDATA auto defaults,x-gvfs-show 0 0
# LABEL=SHDATA /mnt/SHDATA auto nosuid,nodev,nofail,x-gvfs-show 0 0
# LABEL=SHDATA /mnt/SHDATA auto defaults,windows_names,uid=1000,gid=1000,umask=022 0 0
 
Old 01-08-2021, 06:24 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
windows_names is a ntfs-3g (NTFS) mount option and does not work for FAT32. What happens when you try to manually mount the filesystem. Must be root or use sudo if enabled.
Code:
mount -o uid=1000,gid=1000,umask=022 /dev/sda12 /mnt/SHDATA
 
Old 01-08-2021, 08:02 PM   #9
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
I have an ntfs partition I use for data so I don't run into the file size limit of fat32.
This is what is in my fstab and the user writes to it with out any issues from linux and windows
Code:
UUID=4A080DEC667A53DC       /data    ntfs-3g     defaults  0  0
It may be because you don't have the file sysem type in the fstab.

Last edited by colorpurple21859; 01-08-2021 at 08:10 PM.
 
Old 01-09-2021, 06:48 PM   #10
PaulExordium
Member
 
Registered: Dec 2020
Distribution: Debian, Tails, Kodachi, Mint DE
Posts: 92

Original Poster
Rep: Reputation: Disabled
michaelk #8,
your "mount" suggestion does change the ownership and the files can be read and written, but at restart the ownership return automatically to root. All the various attempts at changing the mount options with the disk utility have been unsuccessful. Could it be that the utility forces the ownership to root because the size of the partition (10GB) is larger that the maximum allowed file size (4GB) for a FAT32 format?
 
Old 01-09-2021, 06:49 PM   #11
PaulExordium
Member
 
Registered: Dec 2020
Distribution: Debian, Tails, Kodachi, Mint DE
Posts: 92

Original Poster
Rep: Reputation: Disabled
colorpurple21859 #9,
similarily to what you suggested I've tried:
Code:
LABEL=SHDATA /mnt/SHDATA vfat defaults 0 0
but that did not solve the problem.
 
Old 01-09-2021, 06:52 PM   #12
PaulExordium
Member
 
Registered: Dec 2020
Distribution: Debian, Tails, Kodachi, Mint DE
Posts: 92

Original Poster
Rep: Reputation: Disabled
I ended up reformatting the partition as NTFS and using the mount options suggested by Brains #3. The easy way is to use the disk utility. Below are the screenshots for the mount options, Debian 9 and Debian 10 respectively.
Attached Thumbnails
Click image for larger version

Name:	Debian9_Mount_Options.png
Views:	10
Size:	38.8 KB
ID:	35196   Click image for larger version

Name:	Debian10_Mount_Options.png
Views:	13
Size:	41.3 KB
ID:	35197  
 
Old 01-09-2021, 07:11 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
FYI manually mounting does not change the fstab file nor automatically mount it at startup.
 
  


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] what's the difference between a multi-cpu , multi-core and a multi-thread system ? entz Linux - Hardware 11 12-20-2011 04:49 PM
ext3 partion add in 8eLVM partion jitenderana Red Hat 4 10-12-2011 06:47 AM
problem mounting a linux partion from another ext3 partion fkeith Linux - Hardware 1 10-14-2007 07:33 PM
how do i move files from my windows partion to my linux partion awesome_man Linux - Newbie 2 01-30-2004 12:51 PM
Must "/boot" partion be installed in the primary partion? domeili Linux - Newbie 9 11-01-2003 08:27 AM

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

All times are GMT -5. The time now is 12:04 PM.

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