Finding mounted partitions

M

maxim

Guest
Hello everyone.
I have created 4 partitions on my debian wheezy OS in ext4 format using gparted.
Now I'm finding I can't write to the partitions and create files/directories.
I'm guessing this is a 'permissions' issue and am trying to sort this out.

However, I want to configure them simply and neatly on the system.
If I use cat /proc/mounts, I get a list of mounted partitions:
Code:
root@debian:/# cat /proc/mounts
/dev/sda6 /mnt/part1 ext4 rw,nosuid,nodev,noexec,relatime,user_xattr,barrier=1,data=ordered 0 0
/dev/sda7 /mnt/part2 ext4 rw,nosuid,nodev,noexec,relatime,user_xattr,barrier=1,data=ordered 0 0
/dev/sda8 /mnt/part3 ext4 rw,nosuid,nodev,noexec,relatime,user_xattr,barrier=1,data=ordered 0 0
/dev/sda9 /mnt/part4 ext4 rw,nosuid,nodev,noexec,relatime,user_xattr,barrier=1,data=ordered 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
/dev/sda2 /media/dave ext4 rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered 0 0

As you can see, it's saying /dev/sda2 is mounted.
But if I use df -h, it tells me /dev/sda2 is unmounted:
Code:
root@debian:/# df -h
Filesystem  Size  Used Avail Use% Mounted on
rootfs  39G  8.3G  29G  23% /
udev  10M  0  10M  0% /dev
tmpfs  176M  696K  175M  1% /run
/dev/disk/by-uuid/345ca57e-9947-462f-a828-be2f021e9cf3  39G  8.3G  29G  23% /
tmpfs  5.0M  0  5.0M  0% /run/lock
tmpfs  1.2G  220K  1.2G  1% /run/shm
/dev/sda6  5.8G  140M  5.4G  3% /mnt/part1
/dev/sda7  5.8G  140M  5.4G  3% /mnt/part2
/dev/sda8  5.8G  140M  5.4G  3% /mnt/part3
/dev/sda9  11G  154M  9.5G  2% /mnt/part4

As you can see, /dev/sda2 is not listed. So why does 'cat /proc/mounts' seem to show the partition is mounted?

Also, after creating the partitions do I then need to give permissions to each partition because I can't write to them? I have looked at a few tutorials on the net and they always skip the permissions part.
Thank you in advance.
 


what happens when you do:
Code:
sudo mount -t ext4 /dev/sda2 /media/dave
?
 
what happens when you do:
Code:
sudo mount -t ext4 /dev/sda2 /media/dave
?

It's really weird but cat /proc/mounts doesn't show sda2 anymore!
I've recently upgraded the OS with apt-get upgrade.
I think this must've resolved the conflicting information.
Thank you for your reply.
 
try the mount command:
Code:
 :!$ mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=8161220k,nr_inodes=2040305,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/sda6 on / type ext4 (rw,relatime,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/sda5 on /home type ext4 (rw,relatime,data=ordered)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1633064k,mode=700,uid=1000,gid=100)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
 
The directory in /media with the user name is governed by ACL.
Code:
man acl
for more info. Udisks uses that folder to mount from the file manager when you select an unmounted partition.

Create a folder /media/data or whatever you want to call it then mount /dev/sda2 there. Then set the file system's permissions with
Code:
chown yourname:yourname /media/data
The chown is required once.

To mount the partition at boot add an entry to fstab for it.

Good luck ;)
 
The directory in /media with the user name is governed by ACL.
Code:
man acl
for more info.
This was interesting read. It help understand permissions.

Create a folder /media/data or whatever you want to call it then mount /dev/sda2 there. Then set the file system's permissions with
Code:
chown yourname:yourname /media/data
The chown is required once.

This will answer my probem.
On other site I also saw:
Code:
chown -R <yourname> /media/data

Now I can create folder to partition! Great!
Thank you very much!
 
The definitive list of mounted filesystems in in /proc/mounts

There's also a list of mounted filesystems in /etc/mtab. This list is maintained by the mount and umount commands. That means that if you don't use these commands (which is pretty rare), your action (mount or unmount) won't be recorded
 

Staff online

Members online


Latest posts

Top