LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 06-08-2020, 02:21 AM   #1
ArthurDent
Member
 
Registered: Feb 2004
Location: London
Distribution: Formerly Various Linux Distros, Now Fixed on Fedora 32
Posts: 189

Rep: Reputation: 30
Managed to bork my system. Messed up grub. What can I do?


So I had a lovely Fedora 32 system running nicely on old hardware (Dell Dimension E520). For reasons I won't bore you with I wanted to try out Manjaro Linux, but didn't want to install it. I created a bootable USB and started it from that. The problem was that Manjaro doesn't seem to allow the creation of persistent storage on a USB.
So... My brilliant solution? I have a spare 32gb USB stick, I'll just install it on that. What could possibly go wrong?...

Well it installed OK. It even boots from the USB.

The problem is that now I can't boot my Fedora 32 system.

The Manjaro boot screen shows a Fedora 32 option, but selecting that just leads to hundreds of errors.

I can put a Fedora 32 (Server edition) DVD in the drive and go into the rescue option on that. It shows some errors, but does eventually get me to a command line.

What do I need to do next? My files seem to there under /mnt/sysroot - but I am unsure as to what best to do.
I have seen these instructions https://docs.fedoraproject.org/en-US...ng_GRUB_2.html

and also this page from the same site: https://docs.fedoraproject.org/en-US...ng_GRUB_2.html

Which do I need to follow? And do I need to chroot or something before I do so?

All help gratefully accepted...

Thanks!

Last edited by ArthurDent; 06-08-2020 at 09:32 AM. Reason: Fix mangled links
 
Old 06-08-2020, 03:14 AM   #2
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,980
Blog Entries: 33

Rep: Reputation: 1469Reputation: 1469Reputation: 1469Reputation: 1469Reputation: 1469Reputation: 1469Reputation: 1469Reputation: 1469Reputation: 1469Reputation: 1469
ArthurDent,

I would recommend using boot-repair-disk:
https://sourceforge.net/p/boot-repair-cd/home/Home/

Alternatively, boot from your Fedora installation media and follow these instructions:
https://docs.fedoraproject.org/en-US...escuemode.html

If you are in any doubt, then the first option may be safer.

Good luck.
 
Old 06-08-2020, 03:19 AM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
The two links are garbled. I can't tell to which instructions you refer.

The general approach is: Boot from the installation disk, open the recovery menu. Launch a shell, chroot to /mnt/sysroot, use dnf/yum to reinstall grub.
 
Old 06-08-2020, 03:55 AM   #4
ArthurDent
Member
 
Registered: Feb 2004
Location: London
Distribution: Formerly Various Linux Distros, Now Fixed on Fedora 32
Posts: 189

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by beachboy2 View Post
ArthurDent,

I would recommend using boot-repair-disk:
https://sourceforge.net/p/boot-repair-cd/home/Home/

Alternatively, boot from your Fedora installation media and follow these instructions:
https://docs.fedoraproject.org/en-US...escuemode.html

If you are in any doubt, then the first option may be safer.

Good luck.
Thanks!

Unfortunately I fell at the first hurdle. The guide says to chroot to /mnt/sysimage
OK That worked.
But then I ran fdisk -l
I get:
Code:
bash-5.0# fdisk -l
fdisk: cannot open /proc/partitions: No such file or directory
gulp!

(I am trying to download the rescue disk from the above link now...)

Last edited by ArthurDent; 06-08-2020 at 04:02 AM. Reason: Add comment about rescue disk
 
Old 06-08-2020, 05:01 AM   #5
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,841
Blog Entries: 1

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
Seems to me if you can boot Manjaro, you should be able to chroot from it. Before trying that, maybe better to mount the Fedora partition(s) to collect fdisk -l output and the fstab and grub.cfg from Fedora to post here. Fedora typically includes LVM, which can complicate the rescue process. Knowing what Fedora's installer did can help us help you. Something else that can help is to ensure the Fedora filesystems all have volume labels, which can be added with e2label or tune2fs if using EXTx filesystems. Mounting by label in a manual rescue environment can be orders of magnitude easier than using UUIDs, yet more accurate than device names that can differ when booted to USB.
 
Old 06-08-2020, 05:33 AM   #6
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,369

Rep: Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592Reputation: 1592
at the boot menu press c for a grub prompt
Code:
grub> ls
will display a list of drives and partitions in the form of
Code:
grub> (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (hd1,2) (hd1,1)
If you know drive/partition is fedora/fedora boot partition is on
do something like this. For example if you have fedora boot partition on sda1, use this
Code:
grub>configfile (hd0,1)/grub2/grub.cfg
to get the fedora grub menu. Then boot into fedora and run
Code:
sudo grub2-install /dev/sda
To reinstall fedora grub bootloader.

To see what files are on the first drive/first partition do this
Code:
grub> ls (hd0,1)/
or change accordingly for other partitions.
Without knowing the number of drives you have and partition layout, unable to give concrete numbers just examples

Last edited by colorpurple21859; 06-08-2020 at 05:39 AM.
 
Old 06-08-2020, 05:41 AM   #7
ArthurDent
Member
 
Registered: Feb 2004
Location: London
Distribution: Formerly Various Linux Distros, Now Fixed on Fedora 32
Posts: 189

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by mrmazda View Post
... Before trying that, maybe better to mount the Fedora partition(s) to collect fdisk -l output and the fstab and grub.cfg from Fedora to post here....
OK Apologies for asking a dumb question - but how do I mount the partitions?

I can see my /etc/fstab file, but fdisk gives the errors I describe above.

Thanks for your help so far. Much appreciated...
 
Old 06-08-2020, 07:06 AM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,543

Rep: Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497
Too many unknowns so I would concur w/post 2 to get the bootinfoscript which will give a lot of detailed information to get help for you.

Also, could you try the commands suggested in post 6 and post that info here. To mount a partition you need to use or create a mount point which is simply a directory then use the mount command. Below is an example if the partition you want to mount is sdb1 so change accordingly (needs to be done w/root privileges:

Code:
mkdir /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1
I'm not clear on what you actually did as your first post indicates you put a 'live' manjaro on a usb and then did a full install to a 32GB usb, correct?
 
Old 06-08-2020, 09:44 AM   #9
ArthurDent
Member
 
Registered: Feb 2004
Location: London
Distribution: Formerly Various Linux Distros, Now Fixed on Fedora 32
Posts: 189

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by yancek View Post
I'm not clear on what you actually did as your first post indicates you put a 'live' manjaro on a usb and then did a full install to a 32GB usb, correct?
Yes. That is exactly right. I had a "live" version of Manjaro on a 4gb USB stick. I booted into that and then tried to do a full install onto a different 32gb USB stick. I naively thought that my Fedora installation would not be would involved at all - it would just use the metal and plastic of the PC... You live and learn (or don't in my case)...

Anyway...

I ran the Boot Repair Disk (from message 2 above - thanks!) over it and it produced this: http://paste.ubuntu.com/p/xg5JvtZPnY/

Could someone who knows about these things (so definitely not me!) take a look and tell me what it means - and hopefully what I need to do to fix it!

Many many many thanks!
 
Old 06-08-2020, 11:27 AM   #10
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,841
Blog Entries: 1

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
Even an expert at the helm directly would find this hardly worth the effort to "repair". With old PCs it's common that including USB at boot time causes device enumeration to differ from when only HD or HD and CD/DVD are present. Here, with USB present, the HD can be shoved out of order by the USB multi-reader, which on the repair boot reserved drives sdd, sde, sdf & sdg. By disconnecting the multi-reader before booting, and booting repair from CD/DVD with no USB devices present, a different scenario is certain. Doing so might make another run with a boot repair CD or DVD produce a report that could result in an easier job of repair.

The report shows the 320GB Hitachi HD still has a partition sdb10 with a Fedora 20 installation to further confuse. Partition rearranging on the 320GB Hitachi occurred when Fedora 25 and/or 32 was installed, so the partitions on it are out of order. There is free space at start of Hitachi where a Fedora 20 or 25 partition surely lived.

The repair suggested by the report, if successful would resurrect the Fedora 20 installation. I don't see that as a possibility, as the Fedora 25 and/or 32 installation rearranged the device names, and probably reused one or more partitions from the Fedora 20 installation.

IMO it will be far easier to use the Fedora DVD to perform a clean install on the HD, wiping it completely. Then if you wish to install Manjaro on USB, disconnect the HD first. Better to pre-partition the 320GB Hitachi HD for both Fedora and Manjaro, and install both there, but only use CD/DVD to install from, not USB. Alternatively, repartition the 500GB Seagate to host one of the operating systems. In either case, switch the Seagate with the Hitachi physically (via cable and/or jumpers) so that the Hitachi is enumerated before the Seagate during a normal boot.
 
Old 06-08-2020, 12:36 PM   #11
ArthurDent
Member
 
Registered: Feb 2004
Location: London
Distribution: Formerly Various Linux Distros, Now Fixed on Fedora 32
Posts: 189

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by mrmazda View Post
...IMO it will be far easier to use the Fedora DVD to perform a clean install on the HD, wiping it completely....
Sigh... Yes I was afraid of that.

My approach until relatively recently, was to have two partitions for Fedora OSs with a separate /home partition. As a new release came out I would do a clean install over the last-but-one release (keeping the most recent previous release in the other other partition, which would enable me to access configuration settings etc. and speed up the process of getting back to how things were). I would then alternate new releases between these two partitions. Once Fedora introduced the complete upgrade system however (and it seemed relatively reliable) I simply allowed it to upgrade to the new version as it became available. This is why I still have a partition with F20 on it lying around. Ironically, only the other day I thought about wiping that and reclaiming the space... Like many things - I never got around to it...

The DVD I have is of F32 Server Edition (which I put on a different machine). So I am downloading a F32 Desktop .iso as we speak and I will do a complete install later, when I have time...

I will not dual boot with Manjaro (I simply wanted to try it - but be able to install software on it). I have had quite enough to deal with without adding extra complexity...

Hopefully I will get back to what I had in the not too distant future...

I would like to take this opportunity to thank all the people here who took the trouble and time to try to help me. I really appreciate the spirit of this community.

Thank you.

Last edited by ArthurDent; 06-08-2020 at 12:38 PM.
 
Old 06-10-2020, 11:35 AM   #12
ArthurDent
Member
 
Registered: Feb 2004
Location: London
Distribution: Formerly Various Linux Distros, Now Fixed on Fedora 32
Posts: 189

Original Poster
Rep: Reputation: 30
Well the saga continues...

I decided to bite the bullet and reinstall. I popped in a Fedora 32 Live CD and, while I was in there I did my best to tidy up the partitions using the Disks GUI utility. I removed the FAT partitions that I had used to share when I dual booted with Windows (a very long time ago) and combined them all into one large partition that I formatted as ext4 and rsync'd my /home (which was previously on an ext3 partition) data into it so that I would have a nice large area for /home. I deleted the old F20 partition and reformatted it, naming it as "Fedora32" ready for the new install, but I kept the "Fedora_25" partition (which actually houses my F32 OS - it has been incrementally upgraded from F25 to F32) because I want to be able to access any configuration settings I might need for the new install.

I then did an install into the partition that I had set aside for it (and allowed it to reformat the partition). I watched it complete (and noticed the message saying "installing bootloader" - and then rebooted...
Code:
error: no such device: b6657472-d09e-49de-8493-7aaade80b3ed.
error: unknown filesystem
Entering rescue mode...
grub rescue>
This is how I partitioned the drive:

Click image for larger version

Name:	Screenshot from 2020-06-10 17-16-05.jpg
Views:	14
Size:	120.6 KB
ID:	33366

Notice the free space at the beginning of the drive. I could not get rid of that! I deleted the partition that was originally next to it (the one that held the old Fedora 20 install) and it made one contiguous chunk of space. Good... So I then created a partition using all of that space and... hey presto... the space appeared again... What's happening there I wonder?

Anyway. Despite installing without any reported errors, I still can't boot.

Where do I go from here?

Thanks again for your help...

[Edit]: I just put the Manjaro USB into the drive. According to Fedora's Disks utility, its UUID is b6657472-d09e-49de-8493-7aaade80b3ed. So grub is still looking for that! Why did the the install not create its own boot point?

Last edited by ArthurDent; 06-10-2020 at 05:07 PM. Reason: Add Infor about USB
 
Old 06-10-2020, 09:43 PM   #13
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,841
Blog Entries: 1

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
IMO you didn't go far enough. Partitions out of logical order on disk is an obstacle, the degree to which different people will have differing opinions. Mine is I can't be of any material help if when I recommend wipe, wipe or a functional equivalent thereof does not occur. The same limitation results from a screenshot of a GUI partitioner rather than text output from fdisk -l, parted -l or equivalent. IME with nearly three decades of multibooting, bootloader(s) and the kernel need to be in sync at all times for multiboot to work reliably.

What I might have done if I was really ambitious would have been to devise a plan of both deleting, relocating, then creating, to ensure everything exists in logical order, with no unexpected freespace, after all was done.

One other thing that can help when trying to rescue is to ensure every filesystem has a label. In contrast to utilities and scripts, labels are infinitely easier for humans to work with than are UUIDs, particularly at a GRUB> prompt. If I can get to a GRUB> prompt, and labels are present, I can boot Linux with relative ease. With only UUIDs, I'd be crosseyed and exhausted before anything would boot. All of my native filesystems have labels, none of my fstabs use UUIDs, and none of my bootloader menus depend on UUIDs.

Last edited by mrmazda; 06-10-2020 at 09:45 PM.
 
Old 06-11-2020, 06:46 AM   #14
ArthurDent
Member
 
Registered: Feb 2004
Location: London
Distribution: Formerly Various Linux Distros, Now Fixed on Fedora 32
Posts: 189

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by mrmazda View Post
IMO you didn't go far enough.
In actual fact I agree with this. My trusty workhorse is a very old PC and it has been with me through many variations of OSs Dual Boots and goodness knows what else. Over the years I have tinkered around, added stuff, removed stuff created new partitions, reformatted others etc.etc. It was definitely time for a clear up.

So this is what I did. The only things I really cared about were my /home partition and (for reference) my existing F32 install. Fortunately there was *just* enough space left on the 500gb drive (which is my media / data storage) to rsync each of these filesystems there for temporary safekeeping.

I then swapped the SATA cables so that the 320gb drive became once again /dev/sda (There was a reason in the long-distant past that I swapped them to be the wrong way round, but I have absolutely no recollection of why I did it).

I then destroyed ALL the partitions on the 320gb drive (and re-formatted for good measure).

I then allowed the Fedora Live distro to install on the blank drive. Bearing in mind that I first set this drive up back in the days of Fedora Core 1 or 2 (or something), and I have messed around with it ever since, I was curious to see how a new version of Fedora would like to have its disks. I therefore let it do an "automatic" partitioning.

It installed and I now have a working, but virgin, Fedora 32 system (it boots!).

As you can tell from my previous posts I am no expert when it comes to filesystems and I have no idea how LVMs work. I was a little perturbed to see that it seems to have created a partition of only 1.1gb for itself and then /sda2 is a LVM of 297gb.

If I add more software, will the 1.1gb expand? If I copy back the ~32gb of my /home where will that go?

If this is not an optimal solution I an, at this stage, quite prepared to tear it down and start again with another install. Essentially I want to have what is considered to be best practice in terms of file structure for security and flexibility going forward. Is there a better configuration?

Code:
[mark@localhost ~]$ sudo fdisk -l
Disk /dev/sda: 298.9 GiB, 320072933376 bytes, 625142448 sectors
Disk model: Hitachi HDT72503
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x67919503

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sda1  *       2048   2099199   2097152     1G 83 Linux
/dev/sda2       2099200 625141759 623042560 297.1G 8e Linux LVM


Disk /dev/sdb: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST3500418AS     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000d6ab9

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1          63 976768064 976768002 465.8G 83 Linux




Disk /dev/mapper/fedora_localhost--live-root: 70 GiB, 75161927680 bytes, 146800640 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 /dev/mapper/fedora_localhost--live-swap: 3.92 GiB, 4185915392 bytes, 8175616 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 /dev/mapper/fedora_localhost--live-home: 223.19 GiB, 239645753344 bytes, 468058112 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
Many thanks for your help so far...
 
Old 06-11-2020, 12:22 PM   #15
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,841
Blog Entries: 1

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
Quote:
Originally Posted by ArthurDent View Post
I was a little perturbed to see that it seems to have created a partition of only 1.1gb for itself and then /sda2 is a LVM of 297gb.

If I add more software, will the 1.1gb expand? If I copy back the ~32gb of my /home where will that go?
sda1 is a boot partition. sda2 is everything else in LVM, a typical Fedora automatic configuration.

In the LV, you have three filesystems, 70GB OS, 4GB swap, and 223GB /home. There's no near future need to modify any of it. 70GB is more than plenty for adding more software. If you wish a future Fedora version to be added to the Hitachi, you could easily reduce the LV size of /home in real time to accommodate one, assuming your /home has sufficient freespace at that time.
 
1 members found this post helpful.
  


Reply



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
[SOLVED] Vmnet adapters are shown as "device not managed". There are two adapters vmnet1 and vmnet8 which are all not managed. kats99 Linux - Networking 4 11-01-2019 01:42 AM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
wierd nfs + mdadm bork (worked before) bobbens Debian 2 10-03-2005 03:17 PM
Managed to bork XFce4... infidel Linux - Software 3 01-18-2005 07:40 PM

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

All times are GMT -5. The time now is 02:57 PM.

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