Ext3, ReiserFS & XFS in Windows thanks to coLinux
[ Saturday, 2 August 2008, MAcks ]
If you ever: needed to access your ext3, reiserfs or XFS partitions from Windows, wanted to use one of your favorite file systems via FUSE, or had an idea to mount an image of your hard drive, then this article is for you. This is a how-to, describing what to do, if you want Windows to handle file systems in a similar way as Linux does.
For our task we will use coLinux. coLinux is a modified linux kernel that can be executed as an application or a service in the Windows environment. The web page of the project is http://www.colinux.org/.
The installation procedure was tested on the stable version of the coLinux project (as of 28.06.2008). Installation was performed on the Windows 32-bit architecture. As far as other operating systems are concerned, there might be some modifications needed.
In short, we install coLinux on a windows machine, assure access to disk partions, and export all the mounted file systems using Samba.
Windows Vista users have to run the commands (e.g., cmd.exe, setup) via the context menu “run as …”. It is important, that while doing that, they are in the administrators mode.
Get ready for the installation
- Download the program from the projects website (v0.7.3), and
install it in theC:\coLinuxdirectory - Edit the connection settings of the virtual ethernet card installed by the coLinux (TAP Win32 Adapter V8 (coLinux)).
In the TCP/IP settings, set: IP address: 192.168.37.10 Subnet Mask: 255.255.255.0 - Download Ubuntu-7.10.ext3.2GB.7z image from the the project’s webpage, and extract it to
C:\coLinux - The swap file comes together with the image so the next step can be omitted
- (Optional) If really needed, this command will create a 128MB swap:
fsutil file createnew c:\coLinux\swapp128.fs 134217728(one also has to runmkswapin Linux, and make sure that there is a corresponding line infstab) - Change of filenames:
Ubuntu-7.10.ext3.2gb.fs->ubuntu.fsswap128.fs->ubuntu-swap.fs - Copy example.conf to ubuntu.conf
- Edit of
ubuntu.conf, by inserting these in proper places:cobd0="c:\coLinux\ubuntu.fs"cobd1="c:\coLinux\ubuntu-swap.fs"mem=32eth0=slirpeth1=tuntap - Create
ubuntu-start.cmdwith the following content:colinux-daemon.exe -t nt @ubuntu.conf - Runs
ubuntu-start.cmd - Login as root with the default “root” password
- Change the root password (
passwd) - Run:
editor /etc/network/interfacesand add:auto eth1iface eth1 inet staticaddress 192.168.37.20network 192.168.37.0netmask 255.255.255.0broadcast 192.168.37.255 ifup eth1ping 192.168.37.10(from Linux to Windows) it should work noweditor /etc/apt/sources.list(replace gutsy with hardy in all the paths)aptitude updateaptitude safe-upgradeaptitude install samba openssh-server mc fuse-utilsapt-get cleaneditor /etc/fuse.confremove#at the beginning of the lineuser_allow_othereditor /etc/ssh/sshd_configchangePermitRootLoginto “no”- Add a new user:
adduser user1(from now on, you can ssh to this account) adduser user1 fuse(this allows the user to use FUSE)/etc/init.d/ssh reload- Check if you are able to establish a ssh connection with 192.168.37.20 in Windows
- Halt Linux:
halt
How to mount the file system?
- Search for the partition you want to mount.http://colinux.wikia.com/wiki/Partitions.In my case, it is
\Device\Harddisk2\Partition2. - Edit
ubuntu.confagain, and insert the following# partition to be mountedcobd2="\Device\Harddisk2\Partition2" - Run
ubuntu-start.cmd - Login as root
mkdir /media/codb2- Add:
/dev/cobd2 /media/cobd2 ext3 defaults 0 0tofstab(it is an ext3 partition in my case). mount /media/cobd2
How to share file systems via Samba?
- Should you want to share a whole file system with user1, you must give him read and write permissions.(
chown,chmod…). - After setting the permissions, add at the following, at very end of
/etc/samba/smb.conf:[my data]path = /media/cobd2valid users = user1read only = no - Add the user to the password’s database of samba:
smbpasswd -a user1(samba does not use the system accounts by default) /etc/init.d/samba reload- Type the address in Windows
\\192.168.37.20, and login as user1 using the password generated bysmbpasswd. You can map this file system to a “letter” in your OS
FUSE-based file systems
To use the FUSE file systems (e.g., sshfs, encfs, …), you have to mount them using the allow_other option (which should be enabled in /etc/fuse.conf).How to mount:encfs $WHAT $WHERE -- -o allow_othersshfs $SERVER:$PATH $WHERE -o allow_other
More details
- To make, connecting to coLinux, easier add the IP address to
WINDOWS\system32\drivers\etc\hostsby adding:192.168.37.20 colinux - If you don’t want to start coLinux manually, it can be installed as a service:
colinux-daemon.exe --install-service colinux @ubuntu.conf When running coLinux as a service, you can use the following commands to control it:net start colinuxnet stop colinux- You can also set this service to start automatically. By doing so, you will get access to the mounted file systems immediately after the OS starts (provided that the disk was was mapped to be automatically mounted). One can access coLinux via a console (all of them are installed in
C:\coLinux) or via ssh. - If you want to have the same data under Windows and Linux, you have to sync the UID numbers (in
/etc/passwd) of the user, who handles the files under Linux and coLinux.
Performance
This solution does not provide an outstanding performance, but the benefits compensate for it. I’ve obtained transfers of up to 5 MB/s on an Athlon XP 2000+, SATA disk and an ext3 file system. Any ideas, on how to improve these results, are welcome.
Subscribe to RSS feed for this article!
9 Comments
- A hyperlink: <a href="polishlinux.org">GNU/Linux for everyone!</a>,
- Strong text: <strong>Strong text</strong>,
- Italic text: <em>italic text</em>,
- Strike: <strike>
strike</strike>, - Code: <code>
printf("hello world");</code>, - Block quote: <blockquote>Block quote</blockquote>

















Dude I just love that little penguin. He is so cute!
JT
Actually, it’s very easy to improve that 5MB/s. Here — http://ext2fsd.sourceforge.net/
This is only for ext2. Ext3 is supported as ext2 (without journalling).
So… or you could install either of the two stable ext2/3fs drivers for Win2k-Vista. I mean, I’m all for coLinux, but it is the roundabout way to do this for ext2 or ext3.
Still the only way (AFAIK) for Reiser.
This all very nice. Folks who wish to forgo installing coLinux can opt to install Cygwin into Windows, which supports openssh, secure shell.
ssh, thus allows you to log into any Linux host and scp, sftp transparently and visa versa.
Thanks
Ext2 IFS 1.11 is much easier. - http://www.fs-driver.org/
Bump!
“Ext2 IFS 1.11 is much easier. - http://www.fs-driver.org”
This is by far the best solution for accessing Ext2/3 partitions under win32.
There is also a program called Explore2fs which provides read-only access to ext2/3 partitions.
Explore2fs homepage - http://uranus.it.swin.edu.au/~jn/linux/explore2fs-old.htm
There are win32 drivers available for ReiserFS3 but not ReiserFS4. However, as Hans Reiser (the inventor of ReiserFS) is currently awaiting sentencing for murdering his wife and has sold his company “Namesys” (which develops ReiserFS) the future of ReiserFS looks shaky.
maybe a doublepost? didn’t seem to work the first time.
Bump!
“Ext2 IFS 1.11 is much easier. - http://www.fs-driver.org”
This is by far the best solution for accessing Ext2/3 partitions under win32.
There is also a program called Explore2fs which provides read-only access to ext2/3 partitions.
Explore2fs homepage - http://uranus.it.swin.edu.au/~jn/linux/explore2fs-old.htm
There are win32 drivers available for ReiserFS3 but not ReiserFS4. However, as Hans Reiser (the inventor of ReiserFS) is currently awaiting sentencing for murdering his wife and has sold his company “Namesys” (which develops ReiserFS) the future of ReiserFS looks shaky.
Your formatting of the instructions above just plain sucks. Makes following this how-to about 10 times harder.