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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
|
07-08-2017, 05:59 AM
|
#1
|
LQ Newbie
Registered: May 2017
Location: KSA
Distribution: ubuntu 14.4
Posts: 9
Rep:
|
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
|
|
|
07-08-2017, 07:17 AM
|
#2
|
LQ Guru
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,792
|
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.
|
|
|
07-08-2017, 12:10 PM
|
#3
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
From the Ubuntu you can log into, plug in the external drive, and do:
Code:
$ ls -al /dev/disk/by-UUID
and grab the UUID of the external /home partition of the system you can't log into.
Open /etc/fstab of that system and replace the UUID for /home with the new UUID you grabbed from the command above.
|
|
|
07-08-2017, 05:57 PM
|
#4
|
LQ Veteran
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,599
|
did you create a new user, or create new directory for the user you already have in /home?
|
|
|
07-08-2017, 06:07 PM
|
#5
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
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?
Last edited by BW-userx; 07-08-2017 at 06:23 PM.
|
|
|
07-08-2017, 07:12 PM
|
#6
|
LQ Guru
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,353
|
Check to see if the UUIDs in your 2 /etc/fstab files are the same as the UUIDs on the corresponding partitions.
----------------------
Steve Stites
|
|
|
07-09-2017, 12:16 PM
|
#7
|
LQ Newbie
Registered: May 2017
Location: KSA
Distribution: ubuntu 14.4
Posts: 9
Original Poster
Rep:
|
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
|
|
|
07-09-2017, 01:08 PM
|
#8
|
LQ Guru
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,353
|
Quote:
Originally Posted by abo sal
Colorpurple21859 [/U][/B]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
|
Linux keeps a table of usernames with a corresponding number for each username. In the various directories and files the owner is represented by a number not a name. If you have different users in your two Ubuntu systems or if you created the users in different orders on the two systems then the user numbers for some or all users will be different on the two Ubuntu systems. In that case copying the /home directory from one Ubuntu to another would create an unusable system.
-----------------------
Steve Stites
|
|
|
07-09-2017, 01:35 PM
|
#9
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
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
id -g username
id -G username
id username
change it
Code:
# find / -group 2000 -exec chgrp -h foo {} \;
# find / -user 1005 -exec chown -h foo {} \;
Last edited by BW-userx; 07-09-2017 at 01:37 PM.
|
|
|
07-09-2017, 02:15 PM
|
#10
|
LQ Veteran
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,599
|
Quote:
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 b
|
when you created the new home was it /home or /home/<username>? and even then, when you create the new /home/<username>/ you will still have to change ownership of the new /home/<username> to the user that owned the /home/<username> that you had deleted.
Last edited by colorpurple21859; 07-09-2017 at 03:20 PM.
|
|
|
07-10-2017, 03:23 AM
|
#11
|
LQ Newbie
Registered: May 2017
Location: KSA
Distribution: ubuntu 14.4
Posts: 9
Original Poster
Rep:
|
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
|
|
|
07-10-2017, 07:39 AM
|
#12
|
LQ Newbie
Registered: May 2017
Location: KSA
Distribution: ubuntu 14.4
Posts: 9
Original Poster
Rep:
|
Colorpurple21859 when I created the new home it was /home not /home/<username>? I don't know how to create /home/<username>
|
|
|
07-10-2017, 07:40 AM
|
#13
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
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
NTFS /dev/sda3
NTFS and swap partition on same partition?
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:
sudo nano /tmp/ect/fstab
do your thing
save
reboot when ready.
Last edited by BW-userx; 07-10-2017 at 07:51 AM.
|
|
|
07-10-2017, 07:46 AM
|
#14
|
LQ Newbie
Registered: May 2017
Location: KSA
Distribution: ubuntu 14.4
Posts: 9
Original Poster
Rep:
|
[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.
|
|
|
07-10-2017, 07:54 AM
|
#15
|
LQ Newbie
Registered: May 2017
Location: KSA
Distribution: ubuntu 14.4
Posts: 9
Original Poster
Rep:
|
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 07:20 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|