how to fix fstab of one Ubuntu from older Ubuntu in multi-boot system
I have 6 os installed (MBR HDD) on my PC (2 windows and 4 Linux disros), but let me make the long story short. I will say that I have 4 Os's (2 windows, Ubuntu 14.04 and Ubuntu 16.04 installed). After I copied the Ubuntu 16.04 /home data to external HDD, I manipulated the HDD (repartitions) using disk management and MiniTool Partition Wizard in MS windows. I intentionally deleted the /home and /swap partitions of one Ubuntu 16.04; using those windows tools. I ended up booting to one windows only from the 4 OS's, so I used boot-repair USP flash to to fix the grub. all 4 OS's are in the grub I can log to one Ubuntu but not the other it try to log and comes back to login screen(because I deleted /home). Using Ubuntu 14.04 ( instead of live CD) I created new home and swap partitions for Ubuntu 16.04 and edited its fstab using the method recommended by , Steve Stites in: http://www.linuxquestions.org/questi...estion-631370/ . I still can't log to Ubuntu 16.04. please help to fix this, Abo sal
|
Since you already have the boot repair software, the best thing to do would be to run it again and select the option to Create BootInfo Summary. This will give a link at the end to post here so that members can review drive/partition and boot file info. You modified partitions and thus changed UUID's.
|
From the Ubuntu you can log into, plug in the external drive, and do:
Code:
$ ls -al /dev/disk/by-UUID Open /etc/fstab of that system and replace the UUID for /home with the new UUID you grabbed from the command above. |
did you create a new user, or create new directory for the user you already have in /home?
|
or back door that one as root re-create a user or same one - give passwd to said same user then try to get in that way?
|
Check to see if the UUIDs in your 2 /etc/fstab files are the same as the UUIDs on the corresponding partitions.
---------------------- Steve Stites |
Thank you all for your help
Thank you all for your help
Steve Stites – The 2 /etc/fstab files are the same _after some modification_as the UUIDs on the corresponding partitions, if you meant by the 2 /etc/fstab - ( fstab's Ubuntu 16.04 + fstab's Ubuntu 14.04.) - I think each distro has its own fstab (independent). Of course Ubuntu 14.04 fstab matches its home UUID after boot repair. For Ubuntu 16.04 I recreated new home and swap and added the new UUID to fstab of 16.04 using installed Ubuntu 14.04 not live CD; like you explained before in your post(..gedit /sparrow/etc/fstab..). Of course I commented the old UUID, because they don't exist any more. I think I used your method once but using live CD and I think it worked. Now I don't have have live CD but I have another Ubuntu that I can create new /home and new swap using geparted and edit fstab of the other Ubuntu. Colorpurple21859 I see the 3 users (created before) in the login screen when trying to log (no new user). I can log as gust. Does new directory means new home ?? regards |
Quote:
----------------------- Steve Stites |
yeah what jailbate said but in short hand all of your users have to have same username = same UID and group = same GID in every and all distos if you are sharing the /home especially or it will have conflicts.
find it Code:
id -u username Code:
# find / -group 2000 -exec chgrp -h foo {} \; |
Quote:
|
To avoid confusion let me ask a simpler question I have Ubuntu 16.04 installed on mbr HDD. The partitions on the hdd are:
/root /dev/sda1 /home /dev/sda2 /swap /dev/sda3 NTFS /dev/sda3 The users are: A and B. if I used live CD and deleted the home and swap partitions,kept /root intact.I repartitioned the HDD. How can I add new home + swap and edit fstab. thnakx |
Colorpurple21859 when I created the new home it was /home not /home/<username>? I don't know how to create /home/<username>
|
why are you deleting the partitions? if you are needing more space in you home and swap is where you are taking it from then just resize. to delete two partitions and just re-establish them seems redundant.
too bad you cannot just log in root with your system being split that just removes the need to use a DVD or USB Stick - logging in root keeps you on the / (sda1) side then you can do what ever you want to sda2 thru N but now can this be? Code:
/swap /dev/sda3 but to just answer your question. Boot DVD when you are in a login off DVD open a terminal blkid to get the proper address for safety, then cfdisk /dev/sda2 delete /dev/sda3 delete - then take that new space and split it up again then when you have everything the way you want it, then have cfdisk 'write' that to the disk. I believe that formatting will then be need if using cfdisk. Now the need for home/user lifts its head, so then you're back to adding that home/user with proper permissions UID and GID on the directory, and their is plenty of how to do that in this thread. you can delete the partitions with Gparted too if the DVD os has gparted. and do that same thing with Gparted. GParted can easily do the formatting for you after you've re done your partitions. Not forgetting New swap, New Home Partitions -- you can use old school /dev/sda3 /home - until you get into your original OS and change it to UUID's -- that will work - or sudo blkid to get UUIDs - I usually open two terminals one for notes UUID and such notes and the other terminal for the work to be done. still DVD OS just terminal -> mount /sda1 to DVD /tmp Code:
save reboot when ready. |
[QUOTE= would create an unusable system.
----------------------- Steve Stites[/QUOTE] jailbait I don't know what u meant by "would create an unusable system".grub lists all operating systems, I can use 3 of them (2 windows and one Ubuntu). I meant copying data I downloaded or created in desktop or downloaded to NfTS partition. Every distro has its own home directory. Eventually all of my data ends up to NTFS partition, because they can be accessed by windows and Linux. |
BW-userx
windows is in (sda1). but I can log to the root using recovery or alt+ ctr l F1. |
All times are GMT -5. The time now is 06:37 AM. |