Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Hi I'm new to ubuntu and linux so this might be a very begginers question. I have several partitions on my pc and I want to be able to access them with the console. When I type:

sudo fdisk -l

I get:

/dev/sda1   *        2048    97656831    48827392    7  HPFS/NTFS/exFAT
/dev/sda2        97656832   234375167    68359168    7  HPFS/NTFS/exFAT
/dev/sda3   *   234375168   312500223    39062528   83  Linux
/dev/sda4       312502270   625141759   156319745    5  Extended
/dev/sda5       312502272   318359551     2928640   82  Linux swap / Solaris
/dev/sda6       318361600   625141759   153390080   83  Linux

But it seams that the address is existing. for example I cant do cd /dev/sda4. How can I access the partitions with the console?

share|improve this question

migrated from stackoverflow.com Dec 15 '12 at 15:55

This question came from our site for professional and enthusiast programmers.

    
you took a look in /mnt ? –  F481 Dec 15 '12 at 11:59

3 Answers 3

up vote 1 down vote accepted

What you see with fdisk -l are drives and their partitions. To use a partition of a drive you first have to mount the device.

Just typing mount will give you a list with the already mounted devices and their mount destination.

If you want to mount a partition, just type something like mount /dev/sda1 /mnt/mydrive. You have to make sure that the folder /mnt/mydrive exists. (just type mkdir -p /mnt/mydrive)

The mount command then binds your partition to that folder. To mount you usually have to be root. So in ubunt type a sudo before mount.

sudo mkdir -p /mnt/mydrive
sudo mount /dev/sda1 /mnt/mydive

To unmount the partition you use the umount command. Also take a look at man mount and man fstab if you are interrested in automatic mounts on startup.

hth

share|improve this answer

it seams I find the solution: when you type:

sudo fdisk -l

you get the devices names, but if you want to find out the mounti position of a device then you write

mount 

that gives you: device_name on mount_location now you can simply search for the mount_location and open it. Mine was:

/dev/sda2 on /media/6C7EFECD6DA2CD85 type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)
share|improve this answer

to display mounted partitions:

df

or

cat /proc/mounts
share|improve this answer
    
thanks for the answer, it dose the same as in my solution. –  user1796624 Dec 15 '12 at 12:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.