mounting partitions

Asked by dural78

I have Windows XP on the master drive as the first partition, Ubuntu on the master drive as the second partition, and Windows 2000 on the slave drive. For whatever reason, I can't access the Windows 2000 drive from Ubuntu.

I tried the Automatically mount partitions tutorial to no avail:
https://help.ubuntu.com/community/AutomaticallyMountPartitions#head-80128df9c1c4215d74e3f016b5cd2c2352da247c

When I try the Manually mount partition instructions, I get stuck on the section "Preparing the system". I'm completely new to Terminal, so bear with me. The instructions read:
"For every location ('/media/windows'), run the following command."

How do I switch to each partition location in Terminal? If I hit cd /dev/hdd1/ , it says "Not a directory"

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Shashank Chintalagiri (shashank-chintalagiri) said :
#1

Hi,
I'll try to explain the commands to you, so that you'll be able to do this yourself.

In order to mount a partition, you need to mount in at a specific mount-point, which you can think of as a directory. Ubuntu generally likes to have these mountpoints in the /media folder. Even though you are not very familiar with the terminal I'll try to walk you through it through the terminal itself because, well, its a bit easier that way. I'll also tell you how to do specific tasks, when possible, with a graphical tool.

First thing to do is to decide where you want to mount your partition. The command 'ls' is like 'dir' in dos (if you've used dos or the windows command like before. It will list all the files that are in the current directory, or that satisfy the condition that comes after it (lightly put). THe exact command the guide you reffered to is "ls /media/windows", which basically will list all files in the /media directory that are called windows. It is basically to make sure that the name is unused. You can, instead (in my opinion, this is better) do "cd /media" to go to that folder and see then do an "ls" to see what folders that already exist. Now, pick a name that isnt used, and make the directory with the command "sudo mkdir windows2000" where windows2000 is the new directory name, and the name of the mountpoint. The word "sudo" in the command stands for "superuser-do", which basically gives you a temporary state of higher privileges to edit the files that you ddont normally have access to. This is also the reason why nautilus cant usually do this - You will have to run nautilus with the higher privileges in order to have write access there (you can do this by "sudo nautilus", or, preferaby, "gksu nautilus" from a terminal).

Since you've gotten so far and refer to hdd1, im assuming you've been able to figure out the device name of the partition you are interested in. /dev/hdd1 is the device that you mount on /media/windows2000. Again, mounting is an operation that needs higer privileges (as does editing the /etc/fstab file) and you will have to do so using the sudo command.

TO temporarily mount a drive, amybe if you want to make sure it is the right partition, do
"sudo mount /dev/hdd1 /media/windows2000"
And then, you can simply cd to /media/windows2000 and an ls there should show you your windows files. Most probably you wont have write access at this point.

You can unmount this partion by "sudo umount /dev/hdd1" or "sudo umount /media/windows2000"

In order to autmoatically mount it at bootup with write access to regular users, it ould be best to add it to your fstab file. Read the guide for information about the fstab entry, and do ask if you run into any more trouble.

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#2

Hello,

Please type those 2 commands in a terminal and report the output here:
sudo fdisk -l
cat /etc/fstab

Revision history for this message
Gord Allott (gordallott) said :
#3

the /dev/hdd locations are actually files (of sorts) so you can't cd into them :)

also to have read/write support for WindowsXP/2000 partitions you might want to use this tutorial https://help.ubuntu.com/community/MountingWindowsPartitions?action=show&redirect=NTFSReadWrite#head-c067eb7e3cd4107cc08cdf30a9e1aed8adb02971
it auto-detects your partitions and you just have to select the ones you want to mount :) it will only work on ubuntu Feisty (7.04) though.

what that particular tutorial is talking about though is about where you want to mount the hard-drives too. for example i have a /dev/hda2 partition that i mount to /media/storage. its just checking that where you want to mount the partition (if say you wanted to mount your windows 2000 partition to /media/win2k) exists, if it doesn't its asking you to create the directory yourself :).

Revision history for this message
dural78 (mike-tee-vee) said :
#4

Thank you for all the helpful replies! Ok, so I did the mkdir command and made the windows2000 directory. I can see it when I hit "ls". When I type the following command:
sudo mount /dev/hdd1/media/window2000
I get the following response:
mount: can't find /dev/hdd1/media/window2000 in /etc/fstab or /etc/mtab

Is there anything else I should be doing to make it work?

sudo fdisk -l returns:
Disk /dev/hdc: 40.0 GB, 40060403712 bytes
255 heads, 63 sectors/track, 4870 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot Start End Blocks Id System
/dev/hdc1 * 1 1276 10249438+ 7 HPFS/NTFS
/dev/hdc2 1277 2978 13671315 83 Linux
/dev/hdc3 2979 3102 996030 82 Linux swap / Solaris

Disk /dev/hdd: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot Start End Blocks Id System
/dev/hdd1 * 1 6374 51199123+ 7 HPFS/NTFS
/dev/hdd2 12749 30401 141797722+ 7 HPFS/NTFS
/dev/hdd3 6375 9968 28868805 7 HPFS/NTFS

Partition table entries are not in disk order

and cat /etc/fstab returns:
# /etc/fstab: static file system information.
#
# -- This file has been automaticly generated by ntfs-config --
#
# <file system> <mount point> <type> <options> <dump> <pass>

proc /proc proc defaults 0 0
# Entry for /dev/hdc2 :
UUID=644076bf-df01-4e07-9a8d-a9b054fa5a71 / ext3 defaults,errors=remount-ro 0 1
# Entry for /dev/hdc1 :
UUID=6AC1F425FF4780EB /media/hdc1 ntfs-3g defaults,locale=en_CA.UTF-8 0 1
# Entry for /dev/hdc1 :
UUID=6AC1F425FF4780EB /media/hdd1 ntfs-3g defaults,locale=en_CA.UTF-8 0 1
# Entry for /dev/hdd2 :
UUID=8478564C78563CDC /media/hdd2 ntfs-3g defaults,locale=en_CA.UTF-8 0 1
# Entry for /dev/hdc1 :
UUID=6AC1F425FF4780EB /media/hdd3 ntfs-3g defaults,locale=en_CA.UTF-8 0 1
# Entry for /dev/hdc3 :
UUID=eb8f70f0-096f-4045-94d4-b065647ef6e2 none swap sw 0 0
/dev/hda /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/scd0 /media/cdrom1 udf,iso9660 user,noauto 0 0
/dev/scd1 /media/cdrom2 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

Thanks again for your help.

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#5

Hello,

You forgot a space in the command (between hdd1 and /media):
sudo mount /dev/hdd1 /media/window2000

But It is not necessary, you should already access your drives in /media:
Navigate to /media/hdd1, /media/hdd2 ... with the file explorer.

If there you can't see any files in /media/hdd1, /media/hdd2, ...
then please type this command in a terminal and report the output here:
cat /etc/mtab

Revision history for this message
dural78 (mike-tee-vee) said :
#6

Hi,

When I type: sudo mount /dev/hdd1 /media/window2000
I get the following reply:
mount: mount point /media/window2000 does not exist

When I navigate to /media/hdd1 and /media/hdd2 in File Browser, the both folders bring up the same partition in hdd3.

cat /etc/mtab brings up:
/dev/hdc2 / ext3 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
/sys /sys sysfs rw,noexec,nosuid,nodev 0 0
varrun /var/run tmpfs rw,noexec,nosuid,nodev,mode=0755 0 0
varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0
procbususb /proc/bus/usb usbfs rw 0 0
udev /dev tmpfs rw,mode=0755 0 0
devshm /dev/shm tmpfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
lrm /lib/modules/2.6.20-16-generic/volatile tmpfs rw 0 0
/dev/disk/by-uuid/6AC1F425FF4780EB /media/hdc1 fuseblk rw,nosuid,nodev,noatime,allow_other,blksize=4096 0 0
/dev/disk/by-uuid/6AC1F425FF4780EB /media/hdd1 fuseblk rw,nosuid,nodev,noatime,allow_other,blksize=4096 0 0
/dev/disk/by-uuid/8478564C78563CDC /media/hdd2 fuseblk rw,nosuid,nodev,noatime,allow_other,blksize=4096 0 0
/dev/disk/by-uuid/6AC1F425FF4780EB /media/hdd3 fuseblk rw,nosuid,nodev,noatime,allow_other,blksize=4096 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0

Revision history for this message
Shashank Chintalagiri (shashank-chintalagiri) said :
#7

typo in the spelling of your directory. try windows2000 insteda of window2000. if you still get the error, paste the output of "ls -l /media"

Revision history for this message
dural78 (mike-tee-vee) said :
#8

Ok, I was able to mount after correcting that spelling error for: sudo mount /dev/hdd1 /media/windows2000

When I go to File Browser, it says that I do not have permission to access that folder. What should I do?

Also, something strange happened when booted up again. Previously my XP partition and a music partition would appear as drives on the desktop. Now, my 2000 partition appeared on the desktop, but the XP partition disappeared. Also, in File Browser, the 2000 partition is showing up as hdc1, hdd1, and hdd3 What could have happened?

The output of "ls -l /media" is:
total 72
lrwxrwxrwx 1 root root 6 2007-06-16 16:15 cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 2007-06-16 16:15 cdrom0
drwxr-xr-x 2 root root 4096 2007-06-16 16:15 cdrom1
drwxr-xr-x 2 root root 4096 2007-06-16 16:15 cdrom2
lrwxrwxrwx 1 root root 7 2007-06-16 16:15 floppy -> floppy0
drwxr-xr-x 2 root root 4096 2007-06-16 16:15 floppy0
drwxrwxrwx 1 root root 8192 2007-06-16 21:49 hdc1
drwxrwxrwx 1 root root 8192 2007-06-16 21:49 hdd1
drwxrwxrwx 1 root root 4096 2007-06-16 21:49 hdd2
drwxrwxrwx 1 root root 8192 2007-06-16 21:49 hdd3
drwxr-xr-x 2 root root 4096 2007-06-19 06:56 windows
dr-x------ 1 root root 24576 2007-06-16 21:49 windows2000

thanks again!

Revision history for this message
Shashank Chintalagiri (shashank-chintalagiri) said :
#9

You could try changing the permissions of the folder. Its not an especially good way of doing this, but it should work ::

cd /media
sudo umount windows2000
sudo chmod 777 windows2000
sudo mount /dev/hdd1 /media/windows2000

I still suggest you put in the required line in the fstab. It should look something like :

/media/hdd1 /media/windows2000 ntfs-3g defaults,locale=en_CA.UTF-8 0 1

Also, if you continue having problems with the xp partition (once you edit fstab and reboot) please post the output of "sudo mount" once again.

Revision history for this message
Shashank Chintalagiri (shashank-chintalagiri) said :
#10

You could try changing the permissions of the folder. Its not an especially good way of doing this, but it should work ::

cd /media
sudo umount windows2000
sudo chmod 777 windows2000
sudo mount /dev/hdd1 /media/windows2000

I still suggest you put in the required line in the fstab. It should look something like :

/media/hdd1 /media/windows2000 ntfs-3g defaults,locale=en_CA.UTF-8 0 1

Also, if you continue having problems with the xp partition (once you edit fstab and reboot) please post the output of "sudo mount" once again.

Can you help with this problem?

Provide an answer of your own, or ask dural78 for more information if necessary.

To post a message you must log in.