PDA

View Full Version : where is /home mounted from?



muellere
29th July 2011, 06:40 PM
Everything works fine, but I wonder, where /home is mounted from since it is not in fstab (but in mtab):

[root@fedora15 ~]# df -hP
Filesystem Size Used Avail Use% Mounted on
rootfs 18G 3.7G 14G 22% /
udev 491M 0 491M 0% /dev
tmpfs 500M 380K 499M 1% /dev/shm
tmpfs 500M 644K 499M 1% /run
/dev/mapper/vg_fedora15-lv_root 18G 3.7G 14G 22% /
tmpfs 500M 0 500M 0% /sys/fs/cgroup
tmpfs 500M 0 500M 0% /media
/dev/sda1 485M 47M 414M 11% /boot
/dev/mapper/vg_fedora15-lv_root 18G 3.7G 14G 22% /tmp
/dev/mapper/vg_fedora15-lv_root 18G 3.7G 14G 22% /var/tmp
/dev/mapper/vg_fedora15-lv_root 18G 3.7G 14G 22% /home
[root@fedora15 ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Fri Jul 22 21:05:27 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_fedora15-lv_root / ext4 defaults 1 1
UUID=e0f16308-21b1-4ca6-adf3-ee65d4d3c7b5 /boot ext4 defaults 1 2
/dev/mapper/vg_fedora15-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
[root@fedora15 ~]# grep home /etc/fstab || echo "not in fstab"
not in fstab
[root@fedora15 ~]# uname -a
Linux fedora15 2.6.38.8-35.fc15.x86_64 #1 SMP Wed Jul 6 13:58:54 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@fedora15 ~]# cat /etc/redhat-release
Fedora release 15 (Lovelock)
[root@fedora15 ~]# ll /home/
total 4
drwx------. 21 eric eric 4096 Jul 29 18:43 eric
[root@fedora15 ~]# ll -d /home
drwxr-xr-x. 3 root root 4096 May 18 13:33 /home

this is strange. Should bin in /etc/fstab, shouldn`t it. Thanks for explanation.

DBelton
29th July 2011, 07:24 PM
you are not required to have a separate /home.

If you did not define a separate /home, then it is part of / and mounted when / is mounted.

from your setup, it appears that you have taken the default with Fedora using LVM, so unless you manually changed something in the partitioning setup during the install, your /home should have been set up as part of the vg_fedora15 volume group. it shoud have the name in your fstab of /dev/mapper/vg_fedora15-lv_home

I would bet that somehow you changed the default and it didn't create /home as a separate logical volume, and it created it in the vg_fedora15-lv_root volume.

Edit:

Nothing wrong with having /home as part of your / filesystem. Fedora still works the same. It just means that it will be a little harder for you to upgrade in the future and keep the contents of your /home folder intact. (You will need to backup what you wish to keep, and then do the upgrade, instead of just telling the Fedora installer to not format /home)

About the only issue you may have is if you put a lot of stuff in your /home folder and fill up your drive. You are now sharing drive space (only 18GB total) between /home and / so if you fill up /home/ then your system runs out of space as well.

muellere
29th July 2011, 08:06 PM
I did not modify anything on installation. Just the vanilla settings. But I did not checked the settings on installation. anaconda-ks.cfg tells the following:

#part /boot --fstype=ext4 --size=500
#part pv.008002 --grow --size=500

#volgroup vg_fedora15 --pesize=32768 pv.008002
#logvol / --fstype=ext4 --name=lv_root --vgname=vg_fedora15 --grow --size=1024 --maxsize=51200
#logvol swap --name=lv_swap --vgname=vg_fedora15 --grow --size=1008 --maxsize=2016
bootloader --location=mbr --driveorder=sda --append="rhgb quiet"

So, there was no /home defined. And so I am still really puzzled about how it could be mounted
(looks for me like a bind-mount, but the output of "mount" does not reveal something like this).

[root@fedora15 ~]# mount | grep home
/dev/mapper/vg_fedora15-lv_root on /home type ext4 (rw,relatime,seclabel,barrier=1,data=ordered)

I still do not understand where it is defined to be mounted (again). This could have then also be the case with e.g. /etc or /lib or whatever...

DBelton
29th July 2011, 08:11 PM
if it was created under your / filesystem and not a spearate filesystem, then all it had to do was a mkdir /home and it would require no separate mount for the filesystem.

In other words, it is actually located at /home instead of a separate filesystem being mounted at /home

bodhi.zazen
29th July 2011, 09:16 PM
I suspect this is part of (selinux) sandbox.

See : https://bugzilla.redhat.com/show_bug.cgi?id=701176

You can test this by turning sandbox off


systemctl stop sandbox.service

For an example of using sandbox see:

http://www.bress.net/blog/archives/195-Firefox-in-a-sandbox-with-Fedora.html

jpollard
29th July 2011, 10:04 PM
What you are seeing is a bind mount. See the manpage on mount.

bodhi.zazen
30th July 2011, 04:49 AM
It is indeed from sandbox. If you turn sandbox off


chkconfig sandbox off

and reboot the multiple mounts go away.

If you then start sandbox they return


systemctl start sandbox.service

See the link I gave you about using sandbox, you might like it (I have been using it).

To add sandbox back , with the default settings


chkconfig --level 5 sandbox on