# Accessing Vista file system through Ubuntu



## DaveSS (Jun 18, 2002)

Hi folks,

I have a dual boot ubuntu 8 and vista ultimate on separate partitions.

I have sharing activated on Vista.

I can see the filesystem on Ubuntu, when I access it and enter in vista password nothing. With ubuntu password it tells me it is unable to mount the volume. 

Any ideas on this one?


----------



## lotuseclat79 (Sep 12, 2003)

Hi DaveSS,

From the Linux OS, issue the following command (as a regular user):
[email protected]:~$ sudo fdisk -l
and confirm that the Vista system partition is (which it should be) an NTFS partition.

Then, issue the following command (again as a regular user):
[email protected]:~$ sudo mkdir /tmp/vista

The sudo command executes the following commands as the root account (sysadmin) user in each of the above examples.

Next, you will have to mount the NTFS partition as follows:
[email protected]:~$ sudo mount -v -t ntfs /dev/xxxx /tmp/vista
where the xxxx in /dev/xxxx is replaced by the device name associated with the NTFS partition (output from the fdisk -l command example above).

Then, in ubuntu, you would (as root):
[email protected]:~$ sudo cd /tmp/vista
which would take you to the C:\ directory on the Vista partition, and then you could issue the command:
[email protected]:~$ sudo ls
to get a Linux directory listing of C:\.

You can get into the root account on Ubuntu by issuing the command:
[email protected]:~$ sudo -i
which will give you a root account prompt:
[email protected]:~#
and then you do not have to issue sudo on every command because you are root.

Issue the command:
[email protected]:~# umount /dev/xxxx
from the /root directory (not from /tmp/vista) after you are done accessing the Vista drive, and then
[email protected]:~# exit
to kick you back into the regular ubuntu user account.

-- Tom


----------



## DaveSS (Jun 18, 2002)

Thanks for the detailed post. Am not having much luck though. 

Here's what I have: 

Device Boot Start End Blocks Id System
/dev/sda1 1 61 488281 82 Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sda2 * 730 9730 72289280 7 HPFS/NTFS
/dev/sda3 62 729 5365710 83 Linux


sudo mount -v -t ntfs /dev/sda2/tmp/vista

Results in 

Failed to mount '/dev/sda2': Operation not supported
Mount is denied because NTFS is marked to be in use

I tried to mount as root but it still comes back the same


----------



## lotuseclat79 (Sep 12, 2003)

DaveSS said:


> Thanks for the detailed post. Am not having much luck though.
> 
> Here's what I have:
> 
> ...


Hi DaveSS,

Try:
[email protected]:~$ sudo mount -v -t ntfs /dev/sda2 /tmp/vista
_______________________________________________^
i.e. there is a space between /dev/sda2 and /tmp/vista

or try:

[email protected]:~$ sudo -i
[email protected]:~# sudo mount -v -t ntfs /dev/sda2 /tmp/vista

Make sure you do not issue the mount or the umount command from the /tmp/vista directory, i.e. just issue the cd command before the mount or umount command.

-- Tom


----------



## DaveSS (Jun 18, 2002)

Thanks again, still no luck. Am getting the following. Vista is shutdown, yet this still goes on for both sudo and root commands??

$LogFile indicates unclean shutdown (0, 0)
Failed to mount '/dev/sda2': Operation not supported
Mount is denied because NTFS is marked to be in use. Choose one action:

Choice 1: If you have Windows then disconnect the external devices by
clicking on the 'Safely Remove Hardware' icon in the Windows
taskbar then shutdown Windows cleanly.

Choice 2: If you don't have Windows then you can use the 'force' option for
your own responsibility. For example type on the command line:

mount -t ntfs-3g /dev/sda2 /tmp/vista -o force

Or add the option to the relevant row in the /etc/fstab file:

/dev/sda2 /tmp/vista ntfs-3g force 0 0

If I go for choice 2 here my NTFS filesytem rthat I cannot get into dissapears altogether until I reboot.


----------



## lotuseclat79 (Sep 12, 2003)

Hi DaveSS,

If you boot up into Linux, what is the output of the simple no-parameter mount command:
$ mount

Is the NTFS auto mounted already?

What are the contents of the /etc/fstab file when you boot up into Linux?

-- Tom


----------



## DaveSS (Jun 18, 2002)

Ok somethings happening. 

I used the mount -t ntfs-3g /dev/sda2 /tmp/vista -o force command as Root and am able to access the drive. 

Yet two things:

If I create a folder in the windows partition, desktop, then its not appearing when I boot into windows. 

Secondly, when I go back into Ubuntu I have to go through the whole root mount -t ntfs-3g /dev/sda2 /tmp/vista -o force command line process again.


----------



## DaveSS (Jun 18, 2002)

Right update. Same situation with going through all the command lines as Root to access Vista via forced mount. 

But I discovered why the folder I created was not showing up in Vista. In the second attempt Vista was in Hibernation. I shut down again fully. And now the files are showing. 

Still having to do that force mount thing as Root which is a pain. But it's one tick off the problem box and nearly there.

As a side note, as I mounted from the cmd line I cannot unmount the Vista system. 

So the main issue now is to do this with out all this root into cmd force mount? Any ideas>?


----------



## lotuseclat79 (Sep 12, 2003)

Hi DaveSS,

To unmount, issue the following command as root (admin in Linux):
# umount /dev/xxxx
where xxxx is the device name of the NTFS partition that was mounted.

Make sure you are not located in /tmp/vista, as the device will then be detected as busy. Better to first, cd /, or cd /root, then issue the umount command.

Note: umount is the command to "unmount" the drive.

-- Tom


----------



## DaveSS (Jun 18, 2002)

With that I am getting 

/dev/sda2 is not in the fstab (and you are not root)

So it unmounts as root no problems

So you think the fstab needs to be changed to avoid all the command lines?


----------



## lotuseclat79 (Sep 12, 2003)

Hi DaveSS,

It depends on whether you want to expose your Windows disk to the Internet when you are connected via Linux or not.

You certainly can install an entry in your fstab to automount Windows every time you boot Linux.

How good is your security? You don't surf as root or Admin do you?

-- Tom


----------



## DaveSS (Jun 18, 2002)

Hi Tom,

Actually that's a good point. No I don't surf as root. But the primary reason I have the dual boot is that I am planning on using the Ubuntu partiton for internet when travelling. And the Vista for general work like photoshop etc. 

I prefer unbuntu's security over vista and it boots much faster. 

I would switch but windows still had too much in productivity over linux for me. And since Ubuntu 8.04 the fonts have gone a bit strange making ooo writer look bad, and as I work on writer a lot. Then I have to stick with it on windows.

So yep you are right I should not be editing in the fstab file due to this

Thank you very much for all your help on this by the way. Its been a big relief! 

Dave


----------

