January 25, 2010 · General · Email This Post
Share

If you're new here, you may want to subscribe to my RSS feed and if you have questions related to your ubuntu system post question to our forums. Thanks for visiting!

This tutorial will allow you to access your ext3 partition under Windows, using Sun VirtualBox and Ubuntu.
The tutorial is pretty long due to the images, but they explain things easier sometimes (they are not just meaningless screenshots) (forgive me for your scroll button :P )
I tested this on Windows Xp, using my Ubuntu Linux’s root partition for test purposes and everything went ok, but be aware:

Warning
Raw hard disk access is for expert users only. Incorrect use or use of an outdated configuration can lead to total loss of data on the physical disk. Most importantly, do not attempt to boot the partition with the currently running host operating system in a guest. This will lead to severe data corruption.

as stated in the VirtualBox manual!

download and install sun virtualbox for windows
(http://www.virtualbox.org/wiki/Downloads)

download the 32-bit ubuntu server edition
(http://www.ubuntu.com/getubuntu/download-server)

open up a windows command prompt (Start Menu > All programs > Accessories)
change into to the sun virtualbox folder:

cd “C:\Program Files\Sun\VirtualBox”

(tailor this if you have a non-standard Windows or VirtualBox installation)

find your ext3 partition:

VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDriveX

(where X should be 0,1,… depending on which hdd you want to use)
(tip: ext3 partition type is 0×83)

create a special image which points to your partition:

VBoxManage internalcommands createrawvmdk -filename \path\to\file.vmdk -rawdisk \\.\PhysicalDriveX -partitions Y,Z

(where Y, Z should be the partition number(s) you found out before, and filename is self-explanatory, but should end with .vmdk)

set up a virtual machine in virtualbox:




select your virtual machine and click on settings:
set up networking:

“insert” your ubuntu server install cd into the virtual machine:


start up your virtual machine and install ubuntu server:


select your keymap, and select the install mode:
the install is pretty self explanatory, you shouldn’t have problems with it
choose samba file server and openssh server when asked

unmount the install medium and boot into your new system

update your system (optional), install some additional stuff(required):

sudo apt-get update (optional)
sudo apt-get dist-upgrade (optional)
sudo apt-get install screen nano mc htop

screen > allows multiple terminals to be opened easily
nano > easier to use than vim in my opinion
mc > just like norton commander or total commander
htop > easy process management

stop your virtualmachine and add the physical patrtition’s image to the virtual machine
(image should be added to available images in virtual device manager first)

boot up your server again

make a new directory for the shared partition

cd /
mkdir sharedpartition
chmod 777 sharedpartition

edit your fstab to auto-mount the partition at every startup:

sudo nano /etc/fstab

add the following

/dev/sdXY /sharedpartition ext3 relatime,errors=remount-ro 0 1

(where X should be a,b,… depending on hdd number, and Y should 1,2,… depending on partition number)

edit samba configuration:

sudo nano /etc/samba/smb.conf

change your workgroup to be the same as your windows one, and uncomment the security line:

workgroup = yourworkgroup
security = user

add this to the end:

[SharedPartition]
comment = The shared physical partition
path = /sharedpartition
browseable = yes
writeable = yes
valid users = tutorial

now add and enable this user to samba

sudo smbpasswd -a tutorial
sudo smbpasswd -e tutorial

restart samba with

sudo /etc/init.d/samba restart

Enjoy!

P.s:
You can share multiple partitions and/or different filesystems too.

  • Share/Bookmark

Related Articles

20 Comments to “Howto access ext3 partition from Windows”

  1. Xendon says:

    Or use ext2fsd ! works fine whit ext3 !

  2. david says:

    Aren’t there drivers for this?

  3. heysep says:

    Seriously?
    Isn’t that just a little bit like taking a sledgehammer to crack a nut?
    Alternatives:
    http://www.diskinternals.com/linux-reader/
    http://www.fs-driver.org/

  4. isecore says:

    Or, instead of this overtly long and complicated solution, you could simply use the Ext2 IFS for Windows, which works just fine with EXT3 partitions as well.

    Much, much simpler.

    http://www.fs-driver.org/

  5. Vladicon says:

    Usually ext2fsd is enough if i need to connect my hdd to another PC with Windows. Ubuntu is my main OS and Windows runs under VirtualBox. So this article is very interesting for sharing many other file systems except ext2/3, IMHO.

  6. Buzz says:

    Or just install ifs drives in Windows. Seems a whole lot easier.

    http://www.fs-driver.org/

  7. ackondro says:

    I agree also, the above method is long, dangerous and not aligned with what a user wants, try below for a better option
    http://www.ext2fsd.com/

  8. Arkadi says:

    If it only could support ex4….

  9. Buzz says:

    @Arkadi, not sure which software/method you are referring to, but ext[3,4] are backwards compatible with ext2, so they should work fine. I have had no problems with ext3 and ext4 using ifsdrives in XP.

  10. mamelouk says:

    I think this is a good idea. I am sick and tired of loosing data with ext2fs, and having to reboot to linux to checkdisk each time the system crash.

  11. Alessandro says:

    To me, not the smarter way to access my data from an ext* partition.
    Actually, since the amount of free space on the hard drive is no longer an issue, I’d rather prefer to sync everything on a NTFS partition, with native r/w support in win.

  12. Gerriet says:

    Hi ,)

    How I can access from Windows to a ext4 partion ? Or must are have the partion ext3 ?

  13. aw says:

    If you are running VirtualBox and have 64 bit capable CPU then you can run a 64 bit client on a 32 bit OS like Windows.

  14. Chris Demwell says:

    I would like to point out that this method may be long and difficult, but has the advantage that one can also mount filesystems that are stored in LVM, mdraid or dmraid, or through compression or encryption layers like encfs or cryptoloop. This is very helpful for people who dual-boot their systems, but does have the disadvantage of being more brittle. Here’s where a link to articles about the importance and facility of reasonable backup procedures would come in handy - but you already do backups from any platform you use, right? Me too!

  15. friend of satam says:

    heei, guys, any software suitable for windauz7?

  16. ATOzTOA says:

    What about ext4?

  17. Buzz says:

    All:

    You can mount ext4 ext3 and ext2 drives in windows with ifsdrive. It is THAT easy.

    http://www.fs-driver.org/

  18. Martin Bajer says:

    Hi,
    first of all thanks for interesting articke. It makes me to think about sharing seriously - Now I see Ubuntu files from Windows VirtualBox guest.

    BTW, who is this tutorial for? Is it meant for people with dual boot? Why to have dual boot anyway, or why to install Windows directly to your hardware if you have Ubuntu installed already? It is far better to install Windows inside VirtualBox. VirtualBox supports “Shared Folders” - from manual: “allow you to access files of your host system (Ubuntu) from within the guest system (Windows)”.

    In my case I am running Ubuntu 9.10 as main system, and Windows XP in VirtualBox just for must have windows only apps like CorelDraw (We are using Inscape as much as possible, but our customers are hooked).

    This is my tutorial how to access Ubuntu user files (located on Ext4 partition) from Windows running in Virtual box on top of Ubuntu.

    1) Install “VirtualBox Guest Additions” into Windows guest
    2) Create dir called for example “Shared” in Nautilus
    3) Right click on that folder and select “Sharing options”, check all options
    4) Start Virtual Box manager, open settings for Windows virtual host (which has be powered off), go to Shared Folders and create one for your “Shared” dir.
    5) Start Windows machine. Go do Explorer and add network drive.

    Hope it helps somebody. Cheers :)

  19. Gavin C says:

    My first reaction was “there’s a driver for this” then I realised, “wait, you were looking specifically for a way to let a windows install see a 4TB linux software raid5 array. There’s no driver for *that*.”

    This is a cunning workaround - thank you!

    G

Leave a Reply