Author Topic: Is it too late to change my /home partition - and how? [Solved]  (Read 1853 times)

Offline spinoza

  • Full Member
  • ***
  • Posts: 233
    • At Spinoza's
Is it too late to change my /home partition - and how? [Solved]
« on: January 05, 2012, 09:06:59 AM »
Hi there.

My primary harddrive crashed and now I have installed PCLOS on a new one. Before this I has a version of MiniME installed, the new install is latest full version of PCLINUX. Under the install I tried to mount my old /home partition, but of some reason the install would not complete. In panic I then told the installer to install everything on the new harddrive. Since I had a lot of work to do I have been using this setop for 2 days now.

My old /home partition is still intact and I have also access to it. Now I would like to tell PCLOS to use that one and also my old user on the old /home.

Is that possible now, and if it is, how do I do it in a safe way?
Please ask if my question is unclear, english is not my first language.

/Thomas
« Last Edit: January 10, 2012, 02:42:49 AM by spinoza »

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: Is it too late to change my /home partition - and how?
« Reply #1 on: January 05, 2012, 03:00:04 PM »

My old /home partition is still intact and I have also access to it. Now I would like to tell PCLOS to use that one and also my old user on the old /home.


Thomas,

Yes, it's possible. Need to know how your old drive containing the /home partition is attached to your computer. Is it an internal or external drive? Please open a terminal and post the results of the following with the old drive attached to the computer:

su -
fdisk -l
cat /etc/fstab
exit
exit


The second command is fdisk -l (fdisk [SPACE] [DASH] lowercase L). Please indicate which is the old drive and which is the new.
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline spinoza

  • Full Member
  • ***
  • Posts: 233
    • At Spinoza's
Re: Is it too late to change my /home partition - and how?
« Reply #2 on: January 05, 2012, 03:30:31 PM »
Thank you very much for your help here djohnston.
I will post the full results below. Some of it is in danish though because I have run the localisation manager. I hope it will give you the details you need.

My old /home partition is the one named: /dev/sdc1    (this is the one I want to use)
The /home in use now is: /dev/sdb6

It's not shown in the results as far as I can see, but I,m pretty sure that the old /home partition is formatted ext3 and the new one ext4 - would that be a problem?

Here is the outputs:
---------------------------------------------------
fdisk -l

Disk /dev/sda: 37.0 Gb, 37019566080 byte
255 heads, 63 sectors/track, 4500 cylinders, i alt 72303840 sektorer
Units = sektorer of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3d4b4cb4

    Enhed Opstart   Start         Slut     Blokke   Id  System
/dev/sda1   *          63    72276434    36138186    7  HPFS/NTFS

Disk /dev/sdb: 37.0 Gb, 37019566080 byte
255 heads, 63 sectors/track, 4500 cylinders, i alt 72303840 sektorer
Units = sektorer of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3d4b4cb5

    Enhed Opstart   Start         Slut     Blokke   Id  System
/dev/sdb1   *          63    25189919    12594928+  83  Linux
/dev/sdb2        25189920    72292499    23551290    5  Udvidet
/dev/sdb5        25189983    30587759     2698888+  82  Linux swap / Solaris
/dev/sdb6        30587823    72292499    20852338+  83  Linux

Disk /dev/sdc: 500.1 Gb, 500107862016 byte
255 heads, 63 sectors/track, 60801 cylinders, i alt 976773168 sektorer
Units = sektorer of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x07340734

    Enhed Opstart   Start         Slut     Blokke   Id  System
/dev/sdc1   *          63   204812684   102406311   83  Linux
/dev/sdc2       204812685   409625369   102406342+   c  W95 FAT32 (LBA)
/dev/sdc3       409625370   976768064   283571347+   7  HPFS/NTFS

Disk /dev/sdd: 250.1 Gb, 250059350016 byte
255 heads, 63 sectors/track, 30401 cylinders, i alt 488397168 sektorer
Units = sektorer of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfc49fc49

    Enhed Opstart   Start         Slut     Blokke   Id  System
/dev/sdd1   *          63   163846934    81923436   83  Linux
/dev/sdd2       163846935   368659619   102406342+   c  W95 FAT32 (LBA)
/dev/sdd3       368659620   488392064    59866222+   b  W95 FAT32

---------------------------------------------------------------------------------
cat /etc/fstab

# Entry for /dev/sdb1 :
UUID=5c15b38e-e736-4ac2-bb07-59a13e4975cc / ext4 defaults 1 1
# Entry for /dev/sdb6 :
UUID=ca2570d4-e7f7-493c-ab48-96ba9e6caf8f /home ext4 defaults 1 2
none /proc proc defaults 0 0
# Entry for /dev/sdb5 :
UUID=f6b06731-ca2f-4885-ab96-f03b15b3fbfa swap swap defaults 0 0
none /dev/pts devpts defaults 0 0
--------------------------------------------------------------------------------

Offline spinoza

  • Full Member
  • ***
  • Posts: 233
    • At Spinoza's
Re: Is it too late to change my /home partition - and how?
« Reply #3 on: January 05, 2012, 03:47:30 PM »
PS.
Sorry, I forgot to answer that all drives are internal drives, not sure if that is clear by the outputs.

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: Is it too late to change my /home partition - and how?
« Reply #4 on: January 05, 2012, 03:58:53 PM »

My old /home partition is the one named: /dev/sdc1    (this is the one I want to use)
The /home in use now is: /dev/sdb6


Sorry. I forgot about the UUIDs. We need the one for /dev/sdc1. Run this in a terminal to get it. You don't need root privileges.

ls -l /dev/disk/by-uuid | grep sdc1

(The | character is a vertical bar, or pipe symbol. On my keyboard, it's the Shift-\ key, but may be different on your keyboard.) Copy the UUID from the terminal to a text file. You'll need it later. You can change the home partition by editing a text file, or you can do it in the PCLinuxOS Control Center GUI. Which do you prefer?
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline spinoza

  • Full Member
  • ***
  • Posts: 233
    • At Spinoza's
Re: Is it too late to change my /home partition - and how?
« Reply #5 on: January 05, 2012, 04:24:23 PM »
I think I will prefer what is the easiest for you to explain, I was not sure that it is possible in the PCC since the /home can not be unmounted using the gui. I'll let you choose :-)

I get this output, not sure what you need exactly:
lrwxrwxrwx 1 root root 10 jan  5 23:25 cf9e3dcc-1b4d-4974-a75b-856ee887380f -> ../../sdc1

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: Is it too late to change my /home partition - and how?
« Reply #6 on: January 05, 2012, 04:44:55 PM »
Okay. Close all running programs. Open a terminal. We're going to make a backup copy of your existing fstab for safety. Then we'll edit the current fstab file. For the editor, use a text editor, such as kwrite or leafpad. I'll use kwrite as the example.

su -
cp /etc/fstab /etc/fstab-backup
kwrite /etc/fstab


If you're running KDE, kwrite will open with the contents of /etc/fstab in the window. First, comment the current /home partition line by adding a # symbol at the beginning of the /home stanza.

# Entry for /dev/sdb6 :
#UUID=ca2570d4-e7f7-493c-ab48-96ba9e6caf8f /home ext4 defaults 1 2


At the end of the file, add the following. Copy and paste it from this post if you need to.

# Entry for /dev/sdc1 :
UUID=cf9e3dcc-1b4d-4974-a75b-856ee887380f /home ext3 defaults 1 2


Your /etc/fstab will now look like this:

# Entry for /dev/sdb1 :
UUID=5c15b38e-e736-4ac2-bb07-59a13e4975cc / ext4 defaults 1 1
# Entry for /dev/sdb6 :
#UUID=ca2570d4-e7f7-493c-ab48-96ba9e6caf8f /home ext4 defaults 1 2
none /proc proc defaults 0 0
# Entry for /dev/sdb5 :
UUID=f6b06731-ca2f-4885-ab96-f03b15b3fbfa swap swap defaults 0 0
none /dev/pts devpts defaults 0 0
# Entry for /dev/sdc1 :
UUID=cf9e3dcc-1b4d-4974-a75b-856ee887380f /home ext3 defaults 1 2


Save the file. You'll be back in the terminal as root. Issue the command

reboot

Your old partition will be mounted on the next boot.
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline spinoza

  • Full Member
  • ***
  • Posts: 233
    • At Spinoza's
Re: Is it too late to change my /home partition - and how?
« Reply #7 on: January 05, 2012, 06:59:19 PM »
I think the fstab file is ok, but it stops right after userlogin. A small messagebox appears with:
"kstartupconfig4 does not exists or fails. The errorcode is 3. Check your installation".

I logged in as root and changed the fstab back, so everything is ok.

Then I searched for the file kstartupconfig4 and found it in usr/bin, but not sure if I should look for missing references to it or have to change settings in userprofile or other kde configuration files. Do you think it's possible to fix, or will it likely end in bunch of errors because of conflicts between the old and new kde?

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: Is it too late to change my /home partition - and how?
« Reply #8 on: January 05, 2012, 07:50:08 PM »
Sounds like an ownership problem. With your sdb6 /home partition mounted, open a terminal.

su -
mkdir /mnt/newhome
mount /dev/sdc1 /mnt/newhome
ls /mnt/newhome
chown -R username:username /mnt/newhome/username
umount /mnt/newhome


This is important. The username:username in red is your current username. The username in green is your old home directory name, (the same as your previous username), which was listed when you did the ls /mnt/newhome command.

You can then change to the edited /etc/fstab, reboot, and see if that was the problem. I hope you saved the edited fstab by renaming it. If not, edit it as you did before. Leave the fstab-backup file as a precaution.
« Last Edit: January 05, 2012, 09:06:24 PM by djohnston »
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Is it too late to change my /home partition - and how?
« Reply #9 on: January 05, 2012, 08:16:53 PM »
Sounds like an ownership problem. With your sdb6 /home partition mounted, open a terminal.

su -
mkdir /mnt/newhome
mount /dev/sdc1 /mnt/newhome
ls /mnt/newhome
chown -R username.username /mnt/newhome/username
umount /mnt/newhome


This is important. The username.username in red is your current username. The username in green is your old home directory name, (the same as your previous username), which was listed when you did the ls /mnt/newhome command.

You can then change to the edited /etc/fstab, reboot, and see if that was the problem. I hope you saved the edited fstab by renaming it. If not, edit it as you did before. Leave the fstab-backup file as a precaution.


+1, but ...
note that the separator between name and group must be colon, not  dot.  ;)
chown -R username:username /mnt/newhome/username

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11523
  • ----IOFLU----
Re: Is it too late to change my /home partition - and how?
« Reply #10 on: January 05, 2012, 08:17:16 PM »
Sounds like an ownership problem. With your sdb6 /home partition mounted, open a terminal.

su -
mkdir /mnt/newhome
mount /dev/sdc1 /mnt/newhome
ls /mnt/newhome
chown -R username.username /mnt/newhome/username
umount /mnt/newhome


This is important. The username.username in red is your current username. The username in green is your old home directory name, (the same as your previous username), which was listed when you did the ls /mnt/newhome command.

You can then change to the edited /etc/fstab, reboot, and see if that was the problem. I hope you saved the edited fstab by renaming it. If not, edit it as you did before. Leave the fstab-backup file as a precaution.


That's username:username with a colon in between, not a period (.)

Edit: There's that echo again!
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Is it too late to change my /home partition - and how?
« Reply #11 on: January 05, 2012, 08:20:49 PM »

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: Is it too late to change my /home partition - and how?
« Reply #12 on: January 05, 2012, 09:05:19 PM »
Thanks, old-polack and as. I thought that looked wrong and went to check it. I figured one of you would have my back. Thanks again.

EDIT: Fixed it.
« Last Edit: January 05, 2012, 09:07:04 PM by djohnston »
Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline bicol_willem

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2378
Re: Is it too late to change my /home partition - and how?
« Reply #13 on: January 06, 2012, 02:15:38 AM »
Hehehehe .. always nice to see the muscles of the geeks at work  :D

I would just .... copy my stuff from the old /home to the new /home....  :P

I am missing out here or there?
YES!  That doesn't answer the original question  :D :D :D

Offline spinoza

  • Full Member
  • ***
  • Posts: 233
    • At Spinoza's
Re: Is it too late to change my /home partition - and how?
« Reply #14 on: January 06, 2012, 03:06:16 AM »
Thank you guys for stepping in to help
It became middle of the night in my part of the world, so had to sleep a bit...

Quote
I would just .... copy my stuff from the old /home to the new /home....
I did think of that as a last solution, but the new home is on a small rapture disk I perfere only using for the system that is too small for my home too. So I have to change it later anyway. And since all this started with my system disk physically broke down I would loose all material in home if this happens again. I would prefer if it works just changing it.

I have forgot to tell you a thing before that might be important. When I started up the new installation wanted to view the old home with Dolphin to get a few files I needed, but had no access from the new user. I then tried to change the permissions for the old userfolder, which is the same name as the new one, it said it failed on a specific file with strange characters but it worked anyway and I had access to the folder from my new user.

Now I went to check the excact permissions of the old userfolder and that is indeed strange and might be the problem.
The owner is named 501
the group is named fuse

Why it finally chose that I don't know, I tried to change both to spinoza

Both my old and new user is called spinoza
They have both the ID 500

Shall I still follow your guide or should I do something else after these new informations?

Sorry for forgetting this, but I thought it was fine with permissions since the the current user have access to the old home folder via Dolphin
« Last Edit: January 06, 2012, 03:09:35 AM by spinoza »