I am wondering, is there any way to easily share a folder between Linux and Windows?
-
6Can you explain in depth your requirements? Otherwise, I'd have to flag as not a real question.jrg– jrg2011-11-28 01:40:49 +00:00Commented Nov 28, 2011 at 1:40
-
3Do you mean sharing between machines or on the same machine?Roman Byshko– Roman Byshko2011-11-28 04:02:44 +00:00Commented Nov 28, 2011 at 4:02
3 Answers
Samba
If you want to share files stored on Linux Linux, install a Samba server on the Linux machine. Follow the documentation (Red Hat 6, CentOS 5, Ubuntu).
If you want to share files from Windows, your file manager on Linux can probably connect to a Windows share with no extra effort on your part. Try browsing smb:///. If you want access from the command line, run
mkdir /media/somedir
sudo mount -t cifs //servername/sharename /media/somedir
(If you need help on the Windows side, ask on a Windows site.)
-
2Or use an NFS client on the MSWindows boxsymcbean– symcbean2011-11-28 09:26:58 +00:00Commented Nov 28, 2011 at 9:26
-
this command works perfect but when I restarted the computer I had to do it again. Is there a way to do it permanently?Tak– Tak2018-03-15 11:58:08 +00:00Commented Mar 15, 2018 at 11:58
-
@Tak You can add an entry in
/etc/fstab, but this is usually a bad idea with Samba, because it means your computer will get stuck while booting if the server is down. You can also set up an automounter, so that the mount is done when you try to access the directory. I don't have any pointers, search on the web or on this site and ask a new question if you can't find enough information to set it up.Gilles 'SO- stop being evil'– Gilles 'SO- stop being evil'2018-03-15 13:01:15 +00:00Commented Mar 15, 2018 at 13:01 -
@Gilles thanks, I've posted a question here lets hope someone has a solution unix.stackexchange.com/questions/430414/…Tak– Tak2018-03-15 15:10:16 +00:00Commented Mar 15, 2018 at 15:10
The answer is going to depend very much on which of two questions you are actually asking.
If you want to share files and directories over a network between a PC running windows and a computer running linux that are on at the same time, Gilles' answer regarding Samba is definitely the way to go.
If you're asking how to create a partition/drive on a single dual-booting system that both your windows and linux setups can read, the easiest way is to format a partition as NTFS and use ntfs-3g to mount it in read/write mode in linux.
-
2Or use an ext2/3/4 driver for WIndows. When I explored the question of the existence of drivers for modern Linux filesystems under Windows, I discovered that there was no drivers for XFS or btrfs. But there was for one for ext.imz -- Ivan Zakharyaschev– imz -- Ivan Zakharyaschev2011-11-28 15:05:33 +00:00Commented Nov 28, 2011 at 15:05
-
3The
ntfs-3gdriver for linux seems to be significantly more mature and reliable than theext2/3/4drivers for windows.Shadur-don't-feed-the-AI– Shadur-don't-feed-the-AI2011-11-28 16:08:15 +00:00Commented Nov 28, 2011 at 16:08 -
Ok, as for me personally, I had no experience with the ext2/3/4 driver for Windows. @Shadur - thanks for your impression (that it's not mature)!imz -- Ivan Zakharyaschev– imz -- Ivan Zakharyaschev2011-11-28 18:15:16 +00:00Commented Nov 28, 2011 at 18:15
-
See also: unix.stackexchange.com/questions/5238/… , unix.stackexchange.com/questions/5244/… .imz -- Ivan Zakharyaschev– imz -- Ivan Zakharyaschev2012-01-30 08:14:04 +00:00Commented Jan 30, 2012 at 8:14
For the Linux -> Windows part, the following is my favorite:
python2 -m SimpleHTTPServerpython3 -m http.server
This opens a HTTP-Server on Port 8000 for the current directory. You can access it from Windows by typing your IP-Adress in a browser - eg. http://192.0.2.91:8000/
If you want to share a directory, you have to zip it.
-
Python is available for Windows too, so it should work the other way as well.Oskar Skog– Oskar Skog2017-07-19 22:02:22 +00:00Commented Jul 19, 2017 at 22:02