Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117
Rep:
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).
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...
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117
Original Poster
Rep:
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?
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).
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117
Original Poster
Rep:
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
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.
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...
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)
Distribution: PCLinuxOS 2016 - 64bit on four machines, including a laptop.
Posts: 117
Original Poster
Rep:
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 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...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.