How to access C and D Drive

Asked by Rohith Kumar on 2011-07-17

I am have C and D Drive, I downloaded DJano in D Drive. But I don't get how to access C or D Drive through terminal. Just install GParted if it helps me to do something related to changing the format or partition.. I am giving the image of how my Drives are partitioned. Can anyone guide me how to access to C and D Drive through terminal so that I can access and create my Django project...

http://postimage.org/image/32uvi218k/

Thanks and Regards,
Rohit

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu nautilus Edit question
Assignee:
No assignee Edit question
Solved by:
Eliah Kagan
Solved:
2011-07-17
Last query:
2011-07-17
Last reply:
2011-07-17
Rohith Kumar (rohithkumar-av) said : #1

Disk /dev/sda: 40.0 GB, 40016019456 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000503a1

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 1275 10241406 83 Linux
/dev/sda2 1276 4865 28836675 f W95 Ext'd (LBA)
/dev/sda5 1276 2550 10241406 b W95 FAT32
/dev/sda6 2551 4864 18587173+ 7 HPFS/NTFS
/dev/sda7 4865 4865 8001 82 Linux swap / Solaris

As gparted is telling you, the mount point for what Windows probably calls the C: partition is /media/C and the mount point for what Windows probably calls the D: partition is /media/D (this is not the case on all computers--it just turns out that, on your computer, the C: partition has is called, i.e., as the volume label of, "C", and the D: partition is similarly called "D").

So in Nautilus (Ubuntu's file browser), you can go to File System, enter the folder called media, and then the C: partition is represented by the folder called C and the D: partition is represented by the folder called D. Even more easily, C and D should appear in the Places menu in any Nautilus window (and they should appear there even when the drives are not mounted, and you should be able to mount them by clicking on them in the Places menu).

From the Terminal, you can enter the C: partition by running "cd /media/C" or the D: partition by running "cd /media/D" (without the quotes). You can copy a file called foo in the current directory into the root directory of the C: partition by running "cp foo /media/C"). If the C and/or D partitions are not mounted and you need to mount them from the Terminal (which you wouldn't need to do, unless you were SSHing in or something like that), then since their device names are /dev/sda5 and /dev/sda6, you can mount C: with "udisks --mount /dev/sda5" and you can mount D: with "udisks --mount /dev/sda6".

Massimo Forti (slackwarelife) said : #3

Hi, you can mount with this command:

sudo mount -t vfat /dev/sda5 /mendia/C

sudo mount -t ntfs-3g /dev/sda6 /mendia/D

But your Ubuntu 11.04 be able to automaunt this partition directly by the left bar of Nautilus. Let me know. Thanks.

Rohith Kumar (rohithkumar-av) said : #4

Thanks Eliah Kagan, that solved my question.

Rohith Kumar (rohithkumar-av) said : #5

Thanks Eliah and Massimo..

Eliah, I wanted that terminal command. And just got figured it soon when I tried working with some commands. And as you mentioned I found C and D drive in media and could access through cd /media/D command. Thanks. However I didn't get what you mean by :"udisks --mount /dev/sda5" and you can mount D: with "udisks --mount /dev/sda6".. But at present things are working..

Massimo, I tried that command but it didn't work for me.. I found this commands when browsed it, but I can mount manually my C and D drives, but I didn't know after "@rohith-desktop:-$" how to enter C and D Drives, where some Django files I copied. That was my issue.. But present as cd /media/D or 'C' drive I can open and check my files. Its great help from you too indeed.

rohith@rohith-desktop:~$ sudo mount -t vfat /dev/sda6 /mendia/D
mount: mount point /mendia/D does not exist
rohith@rohith-desktop:~$ sudo mount -t vfat /dev/sda6 /mendia/C
mount: mount point /mendia/C does not exist

Thanks to both of you,

Massimo Forti (slackwarelife) said : #6

Hi, the problem to execute my command is you don't probably have the two directory in /media. You can resolve it creating two dir:

- sudo mkdir /media/C;
- sudo mkdir /media/D;

but .... this way is for static situation. I think you need a dynamic mount. Nautilus can do it. Let me know. Thanks.

The problem in running Massimo Forti's command was *not* that you didn't have directories C and D in media. The problem was that Massimo Forti's commands had typos--they said "mendia" instead of "media".

Once you correct those typos, if the commands fail similarly, then the advice given by Massimo Forti in post #6 applies.

However, if you manually create /media/C or /media/D then the corresponding partition will *not* be able to use that mount point when it is mounted from the desktop or by manual invocation of udisks. This is why, if you are going to continue using the graphical user interface at all to access these partitions, I recommend against manually invoking the mount command to access them. Mounting the devices automatically or by clicking on them in Places in Nautilus, and mounting them manually with udisks, are intercompatible; but neither is completely compatible with manually invoking the mount command in the way Masasimo Forti suggests (though that is, indeed, the traditional way to mount partitions from the command-line, and is important to know if you're going to be a server administrator for a Unix-like system such as Ubuntu).

"However I didn't get what you mean by [udisks commands]"

When you're in Ubuntu's graphical user interface and you attempt to browse to an unmounted partition (or you attach an external device that contains one or more valid accessible partitions), the partition is automatically mounted. Under the hood, so to speak, this is accomplished by running the udisks commands that I gave you.

Running udisks automatically creates appropriately named mount points for the devices (in this case, the folders /media/C and /media/D), and automatically removes them when the devices are unmounted. (If you ever need to manually unmount a device with udisks, you can use "udisks --unmount " followed by the device name, which in this case would be /dev/sda5 for C: and /dev/sda6 for D:.)

If you were using only the command line and you found that you could not access the partitions that we've been referring to in Windows lingo as the C: and D: drives, then you could use the "udisks --mount ..." commands I provided to make them available. If they are already available, then you do not need to use those commands.

To clarify further, Massimo Forti said (referring to the uses of the mount command that he had suggested):
"but .... this way is for static situation. I think you need a dynamic mount. Nautilus can do it. Let me know. Thanks."

udisks accomplishes a dynamic mount.

@Massimo Forti
Sorry about referring to you this whole time as though you're not here. I intended no rudeness.

Massimo Forti (slackwarelife) said : #9

@ Eliah Kagan
Hi Elijah, don't worry, the important thing is helping Rohitha Kumar to find the right solution for his needs. Thank you for your explanations and for correcting my typos ... I'm rusty ;) thanks again.