Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I can't access my files in other partitions even if I mounted them by mount /dev/sda12?

How can I solve this problem? on Using cat /etc/fstab /etc/mtab I got the following output.

 /etc/fstab: static file system information.    
 Use 'blkid -o value -s UUID' to print the universally unique identifier
 for a device; this may be used with UUID= as a more robust way to name
 devices that works even if disks are added and removed. See fstab(5).  

 file system mount point   type  options       dump  pass  
proc            /proc           proc    nodev,noexec,nosuid 0       0  
/dev/sdb5       /               ext4    errors=remount-ro 0       1  
 swap was on /dev/sdb11 during installation  
UUID=c0f5af91-01c4-4a4a-8700-b03afbe2898a none            swap    sw              0       0    
/dev/sda5 / ext4 rw,errors=remount-ro 0 0  
proc /proc proc rw,noexec,nosuid,nodev 0 0  
none /sys sysfs rw,noexec,nosuid,nodev 0 0  
none /sys/fs/fuse/connections fusectl rw 0 0  
none /sys/kernel/debug debugfs rw 0 0  
none /sys/kernel/security securityfs rw 0 0  
none /dev devtmpfs rw,mode=0755 0 0  
none /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0  
none /dev/shm tmpfs rw,nosuid,nodev 0 0  
none /var/run tmpfs rw,nosuid,mode=0755 0 0  
none /var/lock tmpfs rw,noexec,nosuid,nodev 0 0  
none /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0

And for fdisk -l i got the following output:

Disk  /dev/sda: 320.1 GB, 320072933376 bytes  
84 heads, 59 sectors/track, 126138 cylinders, total 625142448 sectors  
Units = sectors of 1 * 512 = 512 bytes  
Sector size (logical/physical): 512 bytes / 512 bytes  
I/O size (minimum/optimal): 512 bytes / 512 bytes  
Disk identifier: 0x005c005c  

   Device Boot      Start         End      Blocks   Id  System  
/dev/sda1   *          59    52097471    26048706+   7  HPFS/NTFS/exFAT  
/dev/sda2        52099127   625134971   286517922+   f  W95 Ext'd (LBA)  
/dev/sda5        52099129    81399910    14650391   83  Linux  
/dev/sda6       104195003   208384931    52094964+   7  HPFS/NTFS/exFAT  
/dev/sda7       208384991   312574919    52094964+   7  HPFS/NTFS/exFAT  
/dev/sda8       312574979   416764907    52094964+   7  HPFS/NTFS/exFAT  
/dev/sda9       416764967   520954895    52094964+   7  HPFS/NTFS/exFAT  
/dev/sda10      520954955   625134971    52090008+   7  HPFS/NTFS/exFAT  
/dev/sda11       81401856    84664319     1631232   82  Linux swap / Solaris  
/dev/sda12       84666368   104194047     9763840   83  Linux  

Partition table entries are not in disk order
share|improve this question
    
The command mount -t /dev/sda12 has wrong syntax and should fail, so we've been assuming you've been having trouble mounting the partition, rather than that you succeeded in mounting it but are having trouble accessing its contents even once it's mounted. However, if that assumption is wrong, please provide more information to clarify. (You can do this by editing your question.) –  Eliah Kagan Jul 14 '12 at 15:22
    
It's very difficult to interpret the output of cat /etc/fstab /etc/mtab because they are concatenated and their contents look like each other. It's hard to know where one file ends and the other begins. Please replace the output of cat /etc/fstab /etc/mtab with separate output from cat /etc/fstab and cat /etc/mtab. By the way, it seems /dev/sda12 is just not mounted at all, rather than being mounted but with its contents inaccessible. Have you tried specifying a folder as the mount point as detailed in my answer? –  Eliah Kagan Jul 24 '12 at 17:54
add comment

2 Answers

As drake01 has said, if you use the -t flag, you need to specify the filesystem type after it. See man mount for details.

However, you usually do not need to specify -t or the filesystem type. mount should be able to infer the filesystem type, and when it cannot, usually that means you are mounting it incorrectly or there's something wrong with the partition.

Furthermore, you generally must run mount as root.

So you could just use:

sudo mount /dev/sda12

But that, too, will be insufficient unless /dev/sda12 is listed in /etc/fstab. Otherwise, you must mount it, specifying the mount point.

So, if you wanted a mount point of /media/Foo, first you would have to create it (if it's not already there):

sudo mkdir /media/Foo

Then you'd mount the drive there, specifying that as the mount point:

sudo mount /dev/sda12 /media/Foo

You can see what's mounted by running mount with no arguments:

mount

Once mounted, you can unmount it with the umount command, passing the device node name or the mount point name:

sudo umount /dev/sda12
sudo umount /media/Foo

You may prefer to mount this volume without running any commands as root, and without having to create or specify a mount point. You can accomplish that with a dynamic mount. The mount point is created on-the-fly and is named the same as the volume name (unless there is no volume name, then usually it's the partition's UUID).

Dynamic mounting in Ubuntu is done with udisks. You can invoke it explicitly:

udisks --mount /dev/sda12

Or you can click on the volume in a file manager like Nautilus, and the appropriate udisks command will be invoked automatically. (This is especially helpful if you don't know the device name but could identify the partition's volume name in a list.)

To unmount a partition that is mounted with udisks:

udisks --unmount /dev/sda12

Or you can still unmount it directly as root, if you wish:

sudo umount /dev/sda12
share|improve this answer
    
on mounting i am getting a error error: can't find /dev/sda12 on /etc/fstab or /etc/mtab –  Harshit Chaudhary Jul 15 '12 at 12:48
    
@HarshitChaudhary Please see the part of my answer above where I say: "But that, too, will be insufficient unless /dev/sda12 is listed in /etc/fstab‌​..." If that doesn't help, then please provide the exact command you are running as well as detailed information about the drive you're trying to mount, the output of cat /etc/fstab, cat /etc/mtab, mount and sudo fdisk -l, and a link to a pastebin containing the output of dmesg. You can provide this by editing your question. –  Eliah Kagan Jul 15 '12 at 16:10
add comment

-t flag in mount command expects the type of the filesystem after it. Assuming that the partition you are trying to mount is ntfs you should run sudo mkdir /media/mydrive123; mount -t ntfs /dev/sda12 /media/mydrive123 It should mount the sda12 on mydrive123 in /media directory. Now you should be able to access the contents of sda12.

share|improve this answer
    
its still not working as i used mount -t ext4 /dev/sda12 –  Harshit Chaudhary Jul 15 '12 at 12:53
    
sda12 is probably not listed in the /etc/fstab file. To mount the partition, type this: sudo mkdir /media/mydrive123; sudo mount /dev/sda12 /media/mydrive123; Now you should be able to access the contents of the partition sda12 through directory /media/mydrive123; –  drake01 Jul 15 '12 at 23:58
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.