LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-17-2014, 02:19 AM   #1
frazelle09
Member
 
Registered: Dec 2004
Location: Mexicali, Baja California, México
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117

Rep: Reputation: 17
My /home partition is not available


i'm running PCLinuxOS and upgraded from 32bit to the 64bit edition on a laptop. Since /home had lots of info on it, i just formatted and installed (or so i thought) the new OS on /. However i come to find out that i must have missed one of the installation screens and ended up with my old partition out in the cold as sda7. i created a couple of users under /home on sda5 (sda6 is swap) but still could not access my old /home.

So, i went into the Control Center/disks/partitions and assigned sda7 to /home and checked the box to Not copy over the newly created users.

Now, i can boot into root but the boot menu still offers me the newly created users and they don't work anymore - of course so the only one on the menu that works is root. i can go into the file system as root with the file manager Krusader and see, under /home, my Old users (frazelle09 and guest) and their files.

How do i tell the system to offer me the Old users menu so i can log into them?

Any help would be greatly appreciated, especially since my wife has to turn in grades tomorrow. (Boy that was a dumb move - to chose tonight to try and upgrade to 64bit - sigh).

Have a great evening!
 
Old 12-17-2014, 02:31 AM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,257
Blog Entries: 24

Rep: Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193
You can't really tell the new system to "offer" the old users - they do not exist in the new system!

So the easy way forward is to create new users with the same name AND same UID/GID as the original users and all will be well.

I am not a PCLinuxOS user so I do not know what admin tools it offers, but the following should work from a terminal, or you can figure out how to do the equivalent from the OS tools. In addition to simply setting the UID's, creating the users on the new system will also do things like creating their mail-spool directories and any other distro specific per-user configs.

As root, unmount the old /home (sda7) for safety, then:

Code:
useradd -m -u UID originaluser
... where UID is the UID of the original user in the old system.

You will likely have to add them to the necessary groups, although the system will also probably create their own default group if it is the same distro.

To get the original UID/GID if you do not have the original /etc/passwd files, with sda7 mounted as home:

Code:
ls -n /home

drwxr-xr-x 17 555 1111 4096 Dec 14 14:15 username/
That will give you the original UID (ex: 555) and GID (ex: 1111) of each original user's home.

It might be worthwhile also to assure that your other new users do not confilct with same UID/GID and delete them if not needed.

The of course after the users are created, change the /home partition back to sda7 and all will be in agreement thereafter!

I am about to shut down for the evening so if you have additional questions I must defer to someone else - or until the clock progresses a few hours! Good luck!

Last edited by astrogeek; 12-17-2014 at 03:02 AM. Reason: Clarification and anticipating questions before signoff...
 
1 members found this post helpful.
Old 12-17-2014, 10:32 AM   #3
frazelle09
Member
 
Registered: Dec 2004
Location: Mexicali, Baja California, México
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117

Original Poster
Rep: Reputation: 17
astrogeek, thank you very much for your swift reply!

i'll give your suggestion and try and see what happens.

Have a wonderful evening and thanks again!
 
Old 12-17-2014, 01:44 PM   #4
frazelle09
Member
 
Registered: Dec 2004
Location: Mexicali, Baja California, México
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117

Original Poster
Rep: Reputation: 17
Well, i've been able to create user frazelle09 on sda7 (/home) but i just created a new account with GID 500 and did not connect to the old one (which i hope is still there). i was able to recreate the other user account "guest" and do see the old folders and files, including the hidden ones, so at least some of the stuff is still there, although not what we are looking for.

i think i set up user frazelle09 incorrectly, perhaps with the wrong username and/or password. Should i just delete that account or go into PCC Control Center and change the information, leaving the GID alone?

Should i try to copy this partition to another hd before i embark on the above adventure?

Thanks for helping and have a great afternoon!
 
Old 12-17-2014, 02:02 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,257
Blog Entries: 24

Rep: Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193
Quote:
Originally Posted by frazelle09 View Post
Well, i've been able to create user frazelle09 on sda7 (/home) but i just created a new account with GID 500 and did not connect to the old one (which i hope is still there). i was able to recreate the other user account "guest" and do see the old folders and files, including the hidden ones, so at least some of the stuff is still there, although not what we are looking for.

i think i set up user frazelle09 incorrectly, perhaps with the wrong username and/or password. Should i just delete that account or go into PCC Control Center and change the information, leaving the GID alone?

Should i try to copy this partition to another hd before i embark on the above adventure?

Thanks for helping and have a great afternoon!
The whole idea here is that if a new user on the new install has the same UID as a user on the old /home partition, then the new user will own the old user's home directory when the old /home (sda7 in your case) is mounted as /home on the new install. It actually doesn't matter if the user names are the same for ownership, only the UID matters. If the names are different then when mounted the old /home directories and files will show as belonging to the new user. (We can then change the directory name if necessary.)

I do not know what PCC does, so will use shell commands, but the effect should be the same unless you are running SELinux I think.

First, lets collect the necessary info from the OLD /home partition, sda7. To keep it separate from your new /home, lets create a new mount point for it and see what is there. As root...

Code:
mkdir /mntsda7
mount /dev/sda7 /mntsda7

ls -l /mntsda7
ls -n /mntsda7
Paste the output of the two ls lines in the above.

Now do the same for you new /home as a sanity check, and paste the output of those here as well...
Code:
ls -l /home
ls -n /home
That will give us the old and new user names and UIDs (GIDs are less important for now).

Last edited by astrogeek; 12-17-2014 at 02:06 PM.
 
1 members found this post helpful.
Old 12-17-2014, 02:20 PM   #6
frazelle09
Member
 
Registered: Dec 2004
Location: Mexicali, Baja California, México
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117

Original Poster
Rep: Reputation: 17
Uf, thank you for your help. This is scary. Anyway here are the commands i ran...

Code:
$ su
Password: 
[root@localhost guest]# mkdir /mntsda7
[root@localhost guest]# mount /dev/sda7 /mntsda7
[root@localhost guest]# ls -l /home
total 28
drwx------ 19 frazelle09 frazelle09  4096 Dec 17 00:41 frazelle09/
drwx------ 48 guest      guest       4096 Dec 17 12:14 guest/
drwx------  2 root       root       16384 Oct  7  2010 lost+found/
drwxr-xr-x  7 root       root        4096 Jun  8  2011 mysql/
[root@localhost guest]# ls -n /home
total 28
drwx------ 19 500 500  4096 Dec 17 00:41 frazelle09/
drwx------ 48 501 502  4096 Dec 17 12:14 guest/
drwx------  2   0   0 16384 Oct  7  2010 lost+found/
drwxr-xr-x  7   0   0  4096 Jun  8  2011 mysql/
Unfortunately, as far as i can tell, the "new" frazelle09 does not give me access to the "Old" frazelle09 folders and files - it seems to have created a "new" user with just the basic folders and files...

Since i have an external hd connected to this lappy, would it be a good idea (better late than never - lol) to copy this partition to it?

Again,thanks for helping and have a wonderful afternoon!

edit> i'm running PCLinuxOS 64bit. i upgraded from the 32 bit version but must have missed one of the install screens to indicate where the /home should be and it wound up on the sda5 partition. We seem to have that solved at least.

Last edited by frazelle09; 12-17-2014 at 02:23 PM. Reason: add info
 
Old 12-17-2014, 02:26 PM   #7
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,257
Blog Entries: 24

Rep: Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193
Quote:
Originally Posted by frazelle09 View Post
Uf, thank you for your help. This is scary. Anyway here are the commands i ran...

Since i have an external hd connected to this lappy, would it be a good idea (better late than never - lol) to copy this partition to it?

Again,thanks for helping and have a wonderful afternoon!

edit> i'm running PCLinuxOS 64bit. i upgraded from the 32 bit version but must have missed one of the install screens to indicate where the /home should be and it wound up on the sda5 partition. We seem to have that solved at least.
Shouldn't be scary, let's go one step at a time.

Yes, if you have the space, a backup is ALWAYS a good idea! But we will be careful to not change anything on the old partition too.

You posted the ls -l/n from home but not from /mntsda7... so I still don't know the original UIDs.
 
1 members found this post helpful.
Old 12-17-2014, 02:32 PM   #8
frazelle09
Member
 
Registered: Dec 2004
Location: Mexicali, Baja California, México
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117

Original Poster
Rep: Reputation: 17
Nuts, sorry about that. Here's the results...

Code:
[root@localhost guest]# ls -l /mntsda7
total 28
drwx------ 19 frazelle09 frazelle09  4096 Dec 17 00:41 frazelle09/
drwx------ 48 guest      guest       4096 Dec 17 12:27 guest/
drwx------  2 root       root       16384 Oct  7  2010 lost+found/
drwxr-xr-x  7 root       root        4096 Jun  8  2011 mysql/                   
[root@localhost guest]# ls -n /mntsda7
total 28                                                                        
drwx------ 19 500 500  4096 Dec 17 00:41 frazelle09/
drwx------ 48 501 502  4096 Dec 17 12:27 guest/
drwx------  2   0   0 16384 Oct  7  2010 lost+found/
drwxr-xr-x  7   0   0  4096 Jun  8  2011 mysql/
Thanks, astrogeek.
 
Old 12-17-2014, 03:34 PM   #9
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,257
Blog Entries: 24

Rep: Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193
Thanks, sorry to be so slow, I am in and out at the moment.

OK, from what you posted it looks like the UIDs and GIDs for both old and new users are already the same. That is good if true, but let's double check just to make sure we did not inadvertently list the same things... (suspicous because of timestamps)

To do that, with sda7 mounted on /mntsda7, poke around inside the directories there and make double sure that it is in fact the old filesystem that you are expecting it to be.

If it is, then we should only need to get it mounted as /home for it to all work as expected. You indicated that sda5 was the new home, but to be sure can you past the output of...

Code:
cat /etc/fstab
If that lists /dev/sda5 /home, then we are all set to make the change, otherwise let's wait and see what is there...

Last edited by astrogeek; 12-17-2014 at 03:42 PM.
 
1 members found this post helpful.
Old 12-17-2014, 03:46 PM   #10
frazelle09
Member
 
Registered: Dec 2004
Location: Mexicali, Baja California, México
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117

Original Poster
Rep: Reputation: 17
Astrogeek, no problem. Take your time. i "poked around" in sda7/frazelle09 and it appears to be a newly created user. The folders are empty.

Here are the results of fstab as well...
Code:
root@localhost guest]# cat /etc/fstab
# Entry for /dev/sda5 :
UUID=48d55c94-bb7b-4463-9de6-1d7deb017c4d / ext4 defaults 1 1
none /dev/pts devpts defaults 0 0
# Entry for /dev/sda7 :
UUID=005e989b-ca49-4957-8961-f62416c2a0f0 /home ext4 defaults 1 2
none /proc proc defaults 0 0
# Entry for /dev/sda6 :
UUID=756bc71f-a977-482d-a4fb-79e716ac5349 swap swap defaults 0 0
Have a great afternoon!
 
Old 12-17-2014, 03:54 PM   #11
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,257
Blog Entries: 24

Rep: Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193
Quote:
Originally Posted by frazelle09 View Post
Astrogeek, no problem. Take your time. i "poked around" in sda7/frazelle09 and it appears to be a newly created user. The folders are empty.

Here are the results of fstab as well...
Code:
root@localhost guest]# cat /etc/fstab
# Entry for /dev/sda5 :
UUID=48d55c94-bb7b-4463-9de6-1d7deb017c4d / ext4 defaults 1 1
none /dev/pts devpts defaults 0 0
# Entry for /dev/sda7 :
UUID=005e989b-ca49-4957-8961-f62416c2a0f0 /home ext4 defaults 1 2
none /proc proc defaults 0 0
# Entry for /dev/sda6 :
UUID=756bc71f-a977-482d-a4fb-79e716ac5349 swap swap defaults 0 0
Have a great afternoon!
Hmmm...

According to your fstab, sda7 IS mounted as /home already. sda5 is your / (root) directory. I think that you were mistaken about sda5 being the new home.

I suspect that you did in fact specify sda7 as /home and may have possibly reformatted it during the new install. As a result, your original home data "may" be gone...

For completeness, please post the output of (as root)

Code:
fdisk -l
 
Old 12-17-2014, 04:00 PM   #12
frazelle09
Member
 
Registered: Dec 2004
Location: Mexicali, Baja California, México
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117

Original Poster
Rep: Reputation: 17
Thanks for helping. i would hope that the data on sda7 is still there. Since i was able to successfully set up user account guest (which was on this partition before) and it shows all the old folders and files, i would hope that the "other" account would still be there as well - it's just not visible.

Code:
# fdisk -l                

Disk /dev/sda: 250.1 GB, 250059350016 bytes, 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0393754d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           0           0           0    0  Empty
/dev/sda3              63   488392064   244196001    5  Extended
/dev/sda5             126   242565434   121282654+  83  Linux
/dev/sda6       242579295   250770869     4095787+  82  Linux swap / Solaris
/dev/sda7       250770933   488392064   118810566   83  Linux

Disk /dev/sdb: 500.1 GB, 500107861504 bytes, 976773167 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x08276bda

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048    24595514    12296733+  83  Linux
/dev/sdb2        24595515   976768064   476086275    5  Extended
/dev/sdb5        24595578   976768064   476086243+  83  Linux
Thanks again for your patience.
 
Old 12-17-2014, 04:04 PM   #13
frazelle09
Member
 
Registered: Dec 2004
Location: Mexicali, Baja California, México
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117

Original Poster
Rep: Reputation: 17
this was a double post. Please ignore.

Last edited by frazelle09; 12-17-2014 at 04:05 PM. Reason: detlete double post
 
Old 12-17-2014, 05:12 PM   #14
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,257
Blog Entries: 24

Rep: Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193
Quote:
Originally Posted by frazelle09 View Post
Thanks for helping. i would hope that the data on sda7 is still there. Since i was able to successfully set up user account guest (which was on this partition before) and it shows all the old folders and files, i would hope that the "other" account would still be there as well - it's just not visible.

Code:
# fdisk -l                

Disk /dev/sda: 250.1 GB, 250059350016 bytes, 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0393754d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           0           0           0    0  Empty
/dev/sda3              63   488392064   244196001    5  Extended
/dev/sda5             126   242565434   121282654+  83  Linux
/dev/sda6       242579295   250770869     4095787+  82  Linux swap / Solaris
/dev/sda7       250770933   488392064   118810566   83  Linux

Disk /dev/sdb: 500.1 GB, 500107861504 bytes, 976773167 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x08276bda

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048    24595514    12296733+  83  Linux
/dev/sdb2        24595515   976768064   476086275    5  Extended
/dev/sdb5        24595578   976768064   476086243+  83  Linux
Thanks again for your patience.
Sorry again for the delay...

So I think our focus should be to determine whether those files are actually there or not.

Let's unmount sda7 from anywhere that it is mounted (as root)

Code:
mount (will show all current mounts, please paste this here for completeness)

umount /home
umount /mntsda7
(and umount any others for sda7)

mount (again, just to be sure they unmounted)
Now lets see if there is anything in /home

Code:
ls -l /home
If there are any user directories there, poke around and see what is there...

Now lets mount sda7 at a location other than /home (/mntsda7 if you have not removed it)

Code:
mount /dev/sda7 /mntsda7
Now either things are there - or they are not... let's hope for the best!

Poke around /mntsda7 to see if the files you want are there (possibly down another subdirectory?).

When done, let's put the mount points back right...

Code:
umount /mntsda7
mount /dev/sda7 /home
Post what you find!

Last edited by astrogeek; 12-17-2014 at 05:13 PM.
 
Old 12-17-2014, 06:30 PM   #15
frazelle09
Member
 
Registered: Dec 2004
Location: Mexicali, Baja California, México
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117

Original Poster
Rep: Reputation: 17
astrogeek, here's the result of some commands i ran as Live CD/root

Code:
mkdir -p /mnt/here /mnt/there /mnt/usb
[root@localhost root]# mount /dev/sda5 /mnt/here
[root@localhost root]# mount /dev/sda7 /mnt/there
[root@localhost root]# cat /mnt/here/etc/base-iso
Installation iso: pclinuxos64-kde-2014.08
Installation date:  2014-12-16
[root@localhost root]# ls -l /mnt/here/home
total 12
drwx------ 26   501  502 4096 Dec 17 01:33 frazelle09/
drwxr-xr-x 22 guest  500 4096 Dec 16 21:40 linda/
drwxr-xr-x  6 root  root 4096 Jun 15  2012 mysql/
[root@localhost root]# ls -l /mnt/there
total 28
drwx------ 19 guest  500  4096 Dec 17 02:41 frazelle09/
drwx------ 48   501  502  4096 Dec 17  2014 guest/
drwx------  2 root  root 16384 Oct  7  2010 lost+found/
drwxr-xr-x  7 root  root  4096 Jun  8  2011 mysql/
i thought it might be a little safer like this. What should i do to bring up the directories/partitions on the hard disk?

Have a great evening!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora 20 - Expand /home partition and shrink Win8 partition lolzies Linux - Hardware 1 07-12-2014 10:40 AM
Is there any benefit of making a separate partition for home, root and boot partition Vexe Linux - Hardware 18 02-23-2013 11:00 AM
cannot write $(HOME).dmrc file home is on a seperate partition Person_1873 Linux - Newbie 5 12-07-2008 01:41 PM
,dmrc problem after moving /home partition to NTFS partition yeehung Linux - Newbie 1 11-14-2007 06:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration