Create /home in new partition

Hi,
This is my first message in this forum lol!. I just installed opensuse 13.1 in my laptop along w8:). I’m rather new in linux and fell in love with this distro. I do not have much experience configuring the system and ask for your assistance.

I installed the distro in a single partition and afterwards i made a new partition that contains the swap partition and a new logical partition. My fdisk -l shows:

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 718847 358400 7 HPFS/NTFS/exFAT
/dev/sda2 718848 189466531 94373842 7 HPFS/NTFS/exFAT
/dev/sda3 189466624 375271423 92902400 83 Linux
/dev/sda4 375271424 976773119 300750848 5 Extended
/dev/sda5 375273472 395724799 10225664 82 Linux swap / Solaris
/dev/sda6 395726848 976773119 290523136 83 Linux

In /dev/sda2 i have the w8 system (that came with the machine) and in /dev/sda3 i installed opensuse 13.1. I would like the /dev/sda6 partition become my /home partition. How do I do that? Can you help me?:shame:
Could you tell me how to copy the files to this new partition?
Is the swap partition correctly allocated?:sarcastic:

thank you

The install defaults would have sett things up right :wink:

Any way, If you want make sda6 your home ok I assume you want to keep what is in your current home? Are you ready for a bit of command line magic?

first log into a terminal as root. (at boot screen press ‘e’ and find the line starting with linux. put cursor on it press end key then space and 3. Press F10 to continue the boot. This will bring you to a text terminal login enter root then the root password)

Then rename the current home partition ( at the command prompt type mv /home /home.bak)

Now start Yast (at the command prompt type yast)

In the terminal version of Yast you will need to use tab keys, arrow keys and spaces and enter to move and select things
Navigate to the partitioner section section Select disks then sda6
Select edit
and then set mount point to /home
If the partition is formatted thats it if not formatted the select format to ext4
Accept it exit partitioner module quit yast
reboot (type reboot)
boot normally to GUI

Now your sda6 is your new home directory. Note that since it was empty all things are set to the defaults If you want your old settings or data you can copy from /home.bak. If not you can just delete it. If something did not work just follow the first few steps above and rename /home.bak to just /home again and go into yast and set sda6 not to mount.

Thanks for replying so fast!lol!.
I followed the steps you indicated me. Worked just fine!rotfl!
But now i have a new issue. I can login only as root. If i try to login as a user i obtain two screens:
“Cannot enter home directory using /.” and “Call to lnusertemp failed (temporary directories full?) check your installation”
How do i fix this? :open_mouth:
Can i recover my settings? how?

Thank you

On 2013-12-08 22:16, jazmiel wrote:
>
> Thanks for replying so fast!lol!.
> I followed the steps you indicated me. Worked just fine!rotfl!
> But now i have a new issue. I can login only as root. If i try to login
> as a user i obtain two screens:

Is “/home” mounted and populated?


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Make sure /home is mounted and not just as a drive but so that the system knows that it is actually /home and not some random drive.

Hola!
Looking at the file manager i obtain the same contents under “Root” (located at “Places”) and under “277.1 GB Hard Drive” (located at “Devices”).
In “Places” i have a “Home” file but not related to “Root” or the “277…Drive”.
Yes, it contains some data.
How can i fix this?
Gracias

Looking at the file manager (dolphin) it gives me the impression that i obtained just another drive. The “Home” file (Capital H) that appears under “Places” does not coincide with this new drive. Also, in “Places” I have a “Root” file which contains a “home” file (note that it is not Capital H) and this file does coincide with the new partition.
What can I do?

Saludoslol!

You can use /etc/fstab. Back it up (copy it somewhere) then open it up (as root to edit) and you should get a rough idea of how it is formatted. Basically its something like this (your names and stuff will vary):


/dev/disk/by-id/ata-KINGSTON_SH103S3120G_50026B722A0480DC-part2 swap                 swap       defaults              0 0
UUID=bc9a8b77-7e43-44b1-9d57-95b15dfff6b3 /                    btrfs      defaults              0 0
/dev/disk/by-id/ata-KINGSTON_SH103S3120G_50026B722A0480DC-part4 /home                xfs        defaults              1 2

As you can see the third line sets a partition on my drive to be treated as /home so if I try to go to /home it will take me to that partition. You will have to figure out the names of your partitions using fdisk -l or gparted but it should be an easy process.

Be sue of capitalization in Linux caps count. so Home is not the same as home

When you look into /home you should see your user(s) names.

Note the root does not use /home as it’s home directory it has a special place /root

You can copy the stuff from /home.bak and that should fix things

Note the ownership for you /home/username has to be for that user both name and UID (user ID) normally if you have only one user the UID is 1000

As a general rule you should not log into a GUI as root since you can inadvertently change file ownership. In this case to correct a /Home (must be /home) miss spelling it should be ok just don’t make it a habit.

This is my /etc/fstab:

/dev/disk/by-id/ata-ST500LT012-9WS142_W0VCDXWA-part5 swap swap defaults 0 0
/dev/disk/by-id/ata-ST500LT012-9WS142_W0VCDXWA-part3 / ext4 acl,user_xattr 1 1
/dev/disk/by-id/ata-ST500LT012-9WS142_W0VCDXWA-part1 /boot/efi ntfs-3g fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-ST500LT012-9WS142_W0VCDXWA-part6 /home ext4 defaults 1 2

So I think everything is in place now.
Thank you very much for your supportrotfl!

jazmiel

Thanks for your reply.lol!
I still wonder how to login as a “normal” user and not root.
Gracias!

This is only if there are no other users. In your case its because you dont have a /home location so root is the only usable account and in this case you must use a console login not a GUI one. You can do this from the KDM login screen (I think you click the button that looks like a power button and choose console login). You could also use a tty by pressing ctrl + alt + F[1-6]. Pressing F7 brings you back to the GUI.

On 2013-12-09 02:46, jazmiel wrote:
>
> Hola!
> Looking at the file manager i obtain the same contents under “Root”
> (located at “Places”) and under “277.1 GB Hard Drive” (located at
> “Devices”).
> In “Places” i have a “Home” file but not related to “Root” or the
> “277…Drive”.
> Yes, it contains some data.
> How can i fix this?

Your description is not clear enough. I prefer to see the output of
“mount” and “df -h”, pasted here inside code tags.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Look in the /home.bak directory. You should see a single directory with your user name copy that directory to the new /home reboot and you should have your user back