Find the answer to your Linux question:
Results 1 to 5 of 5
In openSUSE I have developed a practice to install the system with /home on the root partition and then later make the link to my real /home, which is on ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    165

    Question [SOLVED] Need help with moving /home in Fedora 12


    In openSUSE I have developed a practice to install the system with /home on the root partition and then later make the link to my real /home, which is on the separate partition.
    Code:
    init 1
    mv /home /home.old
    mkdir /home      
    mount -t ext4 /dev/sda4 /home
    init 5
    Of course, I edit /etc/fstab to include new home location
    Code:
    /dev/disk/by-id/scsi-SATA_ST96812A_5PJ14Q1M-part4  /home       ext4     acl,user_xattr 1 2


    Recently I migrated to Fedora 12. There I perform the same operations to link my /home partition. It works fine, but I'm not entirely satisfied with the result.

    The problem is that gnome_terminal does not start in /home/<user>, but it brings me to / instead. I must always type "cd" to get to my working directory (as shown below).
    Code:
    [boris@nc6000 /]$ pwd
    /
    [boris@nc6000 /]$ cd
    [boris@nc6000 ~]$ pwd
    /home/boris
    [boris@nc6000 ~]$
    I checked environment variable $HOME, it points to the working directory:
    Code:
    [boris@nc6000 /]$ echo $HOME
    /home/boris
    What else can be wrong?

    Please help me, I have to fix this, it is simply too annoying to be ignored.
    Fedora_20@Dell_Latitude_E6410
    Ubuntu_14.04_LTS@HP_Compaq_DC7100

  2. #2
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    anything in any of your logs? messages, secure, anything like that? maybe its selinux?

    Code:
    sestatus
    is it enforcing? now check the file permissions of your home directory

    Code:
    ls -Z /home
    ls -Z /old.home
    are they different? try turning off selinux.
    Code:
    setenforce permissive
    or you could see if selinux is even the problem by logging alerts, check under /var/log/audit.

    I, in general, turn SELinux off. Too many things to configure, but this might be of some use to you if you do want to keep it on. HowTos/SELinux - CentOS Wiki

    Then again, selinux may not be your problem. Just have to wait and see.
    linux user # 503963

  3. #3
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    165

    Thumbs up

    SELinux status is indeed enforcing
    Code:
    [boris@nc6000 ~]$ sestatus
    SELinux status:                 enabled
    SELinuxfs mount:                /selinux
    Current mode:                   enforcing
    Mode from config file:          enforcing
    Policy version:                 24
    Policy from config file:        targeted
    [boris@nc6000 ~]$
    I see nothing strange with the file permissions of my home directory.
    Code:
    [boris@nc6000 ~]$ ls -Z /home
    drwx------. boris users unconfined_u:object_r:user_home_dir_t:s0 boris
    drwx------. root  root  system_u:object_r:file_t:s0      lost+found
    [boris@nc6000 ~]$ ls -Z /home.old
    drwx------. boris users unconfined_u:object_r:user_home_dir_t:s0 boris
    [boris@nc6000 ~]$
    But I do see a difference at / level
    Code:
    [boris@nc6000 ~]$ ls -Z /
    dr-xr-xr-x. root root system_u:object_r:bin_t:s0       bin
    dr-xr-xr-x. root root system_u:object_r:boot_t:s0      boot
    drwxr-xr-x. root root system_u:object_r:device_t:s0    dev
    drwxr-xr-x. root root system_u:object_r:etc_t:s0       etc
    drwxr-xr-x. root root system_u:object_r:file_t:s0      home
    drwxr-xr-x. root root system_u:object_r:home_root_t:s0 home.old
    dr-xr-xr-x. root root system_u:object_r:lib_t:s0       lib
    drwx------. root root system_u:object_r:lost_found_t:s0 lost+found
    drwxr-xr-x. root root system_u:object_r:mnt_t:s0       media
    drwxr-xr-x. root root system_u:object_r:mnt_t:s0       mnt
    drwxr-xr-x. root root system_u:object_r:usr_t:s0       opt
    dr-xr-xr-x. root root system_u:object_r:proc_t:s0      proc
    dr-xr-x---. root root system_u:object_r:admin_home_t:s0 root
    dr-xr-xr-x. root root system_u:object_r:bin_t:s0       sbin
    drwxr-xr-x. root root system_u:object_r:security_t:s0  selinux
    drwxr-xr-x. root root system_u:object_r:var_t:s0       srv
    drwxr-xr-x. root root system_u:object_r:sysfs_t:s0     sys
    drwxrwxrwt. root root system_u:object_r:tmp_t:s0       tmp
    drwxr-xr-x. root root system_u:object_r:usr_t:s0       usr
    drwxr-xr-x. root root system_u:object_r:var_t:s0       var
    [boris@nc6000 ~]$
    So I changed the /home attributes as follows:
    Code:
    [root@nc6000 /]# chcon -v --type=home_root_t home
    changing security context of `home'
    [boris@nc6000 ~]$
    Initially nothing happened, gnome-terminal still started in /.
    But after rebooting my computer, gnome-terminal starts in /home/boris .

    scathefire: thanks a lot for helping me!
    Fedora_20@Dell_Latitude_E6410
    Ubuntu_14.04_LTS@HP_Compaq_DC7100

  4. #4
    Linux User
    Join Date
    Sep 2008
    Location
    UK
    Posts
    358
    When you moved /home to /home.old and then made a new folder called home on the root partition were you logged in as a user or as root?
    If you were logged in as boris, boris and then run the commands as su, boris still needs his home directory.
    Log in as root and then mount the new partition as /home in the fstab. Don't worry about creating /home first since you are creating it in the fstab.
    Make sure that boris is still the owner of the new /home/boris.
    This works for me in suse and it should work in any other distro.

  5. #5
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    165
    whych: thanks for the explanation.

    I was indeed logged in as boris, and than used su to get the root privileges. However, as these operations were performed in 1st run level (init 1), I assumed that /home/boris is not used any more.
    Fedora_20@Dell_Latitude_E6410
    Ubuntu_14.04_LTS@HP_Compaq_DC7100

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •