Partition - how to access files from both OS?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
User avatar
darjeeling
Level 2
Level 2
Posts: 63
Joined: Tue Feb 24, 2015 10:21 pm
Location: China

Partition - how to access files from both OS?

Post by darjeeling »

Hello :P ,

I was wondering if in a Dual Boot there is a method to format a partition in Gparted in this way that files can be accessed by both Windows and Linux?

Thanks in advance,
Darjeeling

User avatar
Flemur
Level 17
Level 17
Posts: 7529
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Partition - how to access files from both OS?

Post by Flemur »

- Linux can read any windows formats - fat, ntfs.
- Windows can't read any linux formats - ext4, etc. - unless you install some software; then it's usable, but a bit goofy.

So if the files are non-linux-OS files, use ntfs or fat-something. And create the partition in windows.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

srs5694
Level 6
Level 6
Posts: 1391
Joined: Mon Feb 27, 2012 1:42 pm

Re: Partition - how to access files from both OS?

Post by srs5694 »

You need a shared filesystem. Natively, both the Linux kernel and Windows understand FAT, so from a compatibility point of view, FAT is the safest choice. Unfortunately, FAT is also limited. Most importantly, file sizes top out at 4GiB, which isn't big enough for some purposes. If you can live within that limit, though, I recommend using a shared FAT partition for this purpose.

The Linux kernel can also read, but not write, NTFS, which Windows uses natively. Most Linux distributions, including Mint, provide an out-of-kernel driver called NTFS-3g that can read and write NTFS. Thus, you could use a separate NTFS partition for this purpose. In fact, you could even use the main Windows partition for this purpose. There are problems with this approach, though. I definitely recommend against using the Windows boot partition as a shared-data partition because the NTFS-3g driver was reverse-engineered and so probably contains bugs. As a practical matter, we haven't exactly been flooded with reports of NTFS corruption caused by the driver, so it appears to be mostly safe; but any increased risk to a boot partition is troubling. Furthermore, Linux doesn't understand Windows' security controls (and vice-versa), so keeping the Windows boot partition mounted in Linux poses a security risk; a mistyped command could easily damage the Windows installation. A separate NTFS partition is safer, but as NTFS-3g is an out-of-kernel driver, it's slow compared to using FAT. Furthermore, Linux provides no significant NTFS repair tools. (There is ntfsfix, but it mostly just sets a flag that forces Windows to check the filesystem when it's next booted.) Thus, if the filesystem is damaged, you have no choice but to repair it in Windows. This is a minor hassle in a dual-boot system, unless of course you decide to move away from Windows and the Windows partition falls into disrepair or is deleted.

Other possibilities require that you install a filesystem driver in Windows. There are various ext2/3fs drivers floating around for Windows, and I believe that ext4fs may be supported by now, too. It's been years since I've used any of these tools, and I don't follow them very closely, so I'm not sure of their current state. The last I heard they weren't very reliable. If you decide to try one, I strongly recommend setting up a dedicated data-transfer partition rather than give Windows direct access to your Mint root (/) partition, for the same reasons I recommend against accessing the Windows boot partition from Linux.

You might also look into an HFS+ driver for Windows. I don't know if such a thing exists, but there's a good chance that it does. If so, you could use HFS+ as your file-transfer filesystem. Linux's HFS+ support is pretty good, with one caveat: Using a journal forces the driver into read-only mode, and overriding that is claimed (in the documentation) to be dangerous.

Overall, then, my recommendation is to use FAT if that's at all practical. If not, a dedicated NTFS data-exchange partition is probably your best bet

srs5694
Level 6
Level 6
Posts: 1391
Joined: Mon Feb 27, 2012 1:42 pm

Re: Partition - how to access files from both OS?

Post by srs5694 »

Flemur wrote:And create the partition in windows.
NO! Sorry for shouting, but using the standard Windows partitioning tools to create partitions is DANGEROUS! On an MBR disk, these tools will convert a disk from using standard partitions to using the Windows-specific Logical Disk Manager (LDM) if you increase the number of partitions beyond four. If this happens, Linux will become unbootable and you'll need to jump through awkward hoops to fix everything. That said, you could use the Windows tools to shrink an existing NTFS volume to make room for a new partition; but be careful to not create any new partition(s) in the resulting space; leave it unallocated!

If the partition doesn't already exist, GParted is the safest way to create it. GParted can also shrink NTFS partitions, and is the safest way to shrink Linux partitions, if you need to do so. The risk with GParted is that shrinking or moving an NTFS partitions might make it unbootable, particularly if you move its start point. Thus, using Windows to shrink or move Windows partitions and GParted to create new partitions is the safest course of action, provided you're very careful to not create anything new with the Windows tools.

User avatar
gold_finger
Level 9
Level 9
Posts: 2886
Joined: Mon Mar 11, 2013 11:39 pm

Re: Partition - how to access files from both OS?

Post by gold_finger »

Adding to what others have already said, here is a tutorial showing you how to mount the newly created data partition in Mint, create entries in the fstab file for auto-mounting it on boot, and linking to various folders on that partition if so desired.

Not sure about Windows, but believe it will just show up as another drive letter in explorer (eg. "E: drive", or "F: drive", etc.).
Please add [SOLVED] to your thread if a solution is found. Go to your first post in the thread, hit "Edit" button and add [SOLVED] to the title of the post.

How To Format Your Forum Posts.

Try Linux Beginner Search Engine for Linux questions.

User avatar
Ginsu543
Level 4
Level 4
Posts: 450
Joined: Thu Nov 24, 2011 3:15 am
Location: Los Angeles, CA, USA

Re: Partition - how to access files from both OS?

Post by Ginsu543 »

On my main rig, I use 7 separate 1 TB drives formatted in NTFS as data drives because I need to share files (mostly my media files such as video, audio, ebooks, etc.) among three different OSes (Mint, OS X, and Windows via VirtualBox) as well as my in-home network media server. I've found that for such versatility, NTFS is a pretty good choice. It's not perfect, of course, but it serves my needs just fine.

Here is my fstab configuration to give you an idea how to automount NTFS partitions so you can access them in Mint upon boot-up:

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system>					<mount point>	<type>	<options>				<dump>	<pass>
# / was on /dev/sdf1 during installation
UUID=f85a0500-ee7d-4d6e-a28c-59194b5bae6c	/		ext4	errors=remount-ro,noatime		0	1
# /home was on /dev/sdf2 during installation
UUID=040ac885-fa10-49ea-8cad-d6e5ca9b7179	/home		ext4	defaults,noatime			0	2
# swap was on /dev/sdf3 during installation
UUID=af5dbed8-04ae-4cce-974c-601d894692fd	none		swap	sw					0	0
# mount /tmp in RAM
tmpfs						/tmp		tmpfs	defaults,noatime,mode=1777		0	0
# mount NTFS partitions
UUID=4897C7A2201D6AD1				/media/Tsunami	ntfs-3g	defaults,noatime,locale=en_US.utf8	0	0
UUID=3FDD275E27FC5FEB				/media/Torrent	ntfs-3g	defaults,noatime,locale=en_US.utf8	0	0
UUID=0BC3134E1C4DDC06				/media/Tempest	ntfs-3g	defaults,noatime,locale=en_US.utf8	0	0
UUID=3EA1BCCC32B9C631				/media/Typhoon	ntfs-3g	defaults,noatime,locale=en_US.utf8	0	0
UUID=4849EC4836496E3E				/media/Tornado	ntfs-3g	defaults,noatime,locale=en_US.utf8	0	0
UUID=7A575BE5175F3A83				/media/Twister	ntfs-3g	defaults,noatime,locale=en_US.utf8	0	0
UUID=0784148B00044221				/media/Hydride	ntfs-3g	defaults,noatime,locale=en_US.utf8	0	0
Main: Intel Core i7 920 D0 @ 4.0 GHz | Asus P6X58D Premium | 12 GB Mushkin Redline PC3-12800 7-8-7-24 | EVGA GeForce GTX 560 Ti | Mint 17.2 Cinnamon 64 / OS X 10.7.3
Portables: Toshiba Portege R200 | Mint 17.2 Cinnamon 32 / Dell Mini 9 | OS X 10.6.7

User avatar
Flemur
Level 17
Level 17
Posts: 7529
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Partition - how to access files from both OS?

Post by Flemur »

On an MBR disk, these tools will convert a disk from using standard partitions to using the Windows-specific Logical Disk Manager (LDM) if you

No it won't. Just let it format some free space. Or use the "Minitool Partition Wizard".

As far as that goes, I use NTFS - IIRC created with gparted - to access files on both systems (tho never use windows anymore), and have never had any file-system/partition or data problems.

Here's the /etc/fstab line:

Code: Select all

LABEL=NTFS    /mnt/NTFS    ntfs-3g noauto,user,windows_names  0 0
"noauto": means don't mount at boot (I use it as a backup partition, so mount it by hand when needed); remove 'noauto' to auto-mount.
"windows_names": linux can create file-names that'll confuse windows (IIRC, a ":" will do it). This prevents that.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

srs5694
Level 6
Level 6
Posts: 1391
Joined: Mon Feb 27, 2012 1:42 pm

Re: Partition - how to access files from both OS?

Post by srs5694 »

Flemur wrote:On an MBR disk, these tools will convert a disk from using standard partitions to using the Windows-specific Logical Disk Manager (LDM) if you

No it won't.
In my experience, it will; however, I suspect that we may be running into linguistic misunderstanding....
Just let it format some free space.
This is an oxymoron. When discussing partition tables, free space is by definition unpartitioned; it is space that is not contained in any partition. Such space cannot be used in the normal manner. (There are tools, including GRUB under MBR, that use such space for their own purposes, but such uses are basically unsafe and to be avoided. Boot loaders get away with it becausethere's been a long history of negotiations and workarounds by the few tool authors who try to use the space in that way.) The point is that if space is "free" in a partition table sense, it does not count against the four-partition limit because it is not partitioned. It's as if you have four bookshelves and a wall much longer than all the bookshelves put end-to-end. You can put the bookshelves (partitions) wherever you want along that wall, and there'll be gaps between them. Those gaps are not bookshelves, though.

The partitioning tools that come with recent versions of Windows enable you to put in more than four partitions, but the moment you do, the partition table is converted from a standard MBR layout to MBR with LDM layered atop it. This LDM layer wreaks havoc from a Linux point of view. Although the Linux kernel includes LDM support, I don't know of any distribution that enables easy installation to a disk that uses LDM. Thus, if you wind up with an LDM disk, you'll need to use third-party tools to revert back to a standard MBR-only layout. This is possible, but it's an extra hassle and there's always a small chance that such a conversion will create new problems.
Or use the "Minitool Partition Wizard".
This isn't the standard Windows tool. I have very limited experience with it, but I'm sure it's safer than the standard Windows tools. Those are the tools against which I was warning, not third-party tools, most of which exist because the standard tools are deficient.

That said, I still wouldn't recommend using such tools to create Linux partitions. The reason is that a Linux installer (like Mint's) knows Linux's requirements and can create partitions of the right size, in the right locations, etc. A Windows tool doesn't know these things. Of course, if you're an expert, you know these details and can direct the Windows tool appropriately; but in that case, you can direct the Mint installer to do the same thing just as well. Thus, at best there's no advantage to using third-party Windows tools, and at worst you'll dig yourself into a hole by creating a sub-optimal partition layout.

Note that I'm talking about creating Linux partitions here; there is an argument to be made for using the standard Windows partitioner to shrink its partition(s) to make room for Linux, leaving unpartitioned space behind. If you do so, though, do not create new partitions in the resulting free space, for the reasons I've described!

mzs112000
Level 1
Level 1
Posts: 35
Joined: Mon Jan 27, 2014 3:37 am
Location: Earth(until the SpaceX Mars colony is ready)

Re: Partition - how to access files from both OS?

Post by mzs112000 »

Linux can access files on your Windows partition by default.
Windows, you need a driver to access the files on your Linux partition. Ext2Fsd is a decent driver, it is available here: http://www.ext2fsd.com/
Ext2Fsd is compatible with Ext2/3/4 and runs on Windows 2000, XP, 7, and 8.
IF I have helped you/solved a problem, please add [SOLVED] to your post title, it helps other users looking for help, and keeps the forum clean.
http://www.worldcommunitygrid.org/reg/v ... rId=943129
https://www.lds.org

Mark Phelps
Level 7
Level 7
Posts: 1859
Joined: Mon Jun 10, 2013 4:39 pm

Re: Partition - how to access files from both OS?

Post by Mark Phelps »

If you have an MBR-formatted drive that already contains 4 top-level partitions (i.e., 4 primary or 3 primary and one extended), Windows Disk Management WILL allow you to create more -- but -- it will put up a warning about then converting ALL the partitions to Dynamic Disks -- a warning that is, all too often, simply ignored. And, after that happens, Linux can no longer work with the partitions.

So, the warning about NOT using Disk Management is valid -- seeing how often folks just simply ignore warning messages and charge ahead.

Post Reply

Return to “Installation & Boot”