Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Installation] I have a bootloader in a wrong device

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
User avatar
MikeLieberman
Posts: 162
Joined: 2013-01-29 17:26
Location: General Santos City, Philippines
Has thanked: 17 times
Been thanked: 2 times

[Installation] I have a bootloader in a wrong device

#1 Post by MikeLieberman »

I made a rookie mistake. So the question is, can I find a way to fix it, or do I start over? (You don't have to tell me I'm an idiot. I already figured that out. But all my previous experiences with RAID drives where BIOS based. I read that Debian doesn't like that type of RAID.)

Here's what I have:
  • TWO SSD SATA drives as a RAID1 install via Debian Bullseye and that part is fine to the extent that it is functioning as a RAID1.
  • But there was no space left for the primary bootloader on the RAID.
  • So I stuck a 16GB USB stick in and told the installer to use that. It did and the system boots.
  • All the /home file structure is on the RAID.
  • BUT the system is incredibly slow to update or add software. AND I suspect that it will just get worse until the system is unusable.
I have a 500MB fixed disk I could add to the PC,

I guess I should note that all I am doing on the hardware platform is running BIND and VirtualBox. The rest of the work is the VM that loads on off the RAID Array. The base system as 32GB DDRAMM and the VB uses maybe 6GB or RAM. Other than Debian and VB updates I am not adding anything else to the system. It will run as a home server via the VM.

So do I start over from scratch, or is there a way to migrate to system's bootloader from the USB stick to the HDD?
Last edited by MikeLieberman on 2022-11-23 13:02, edited 2 times in total.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: [Installation] I have a bootloader in a wrong device

#2 Post by p.H »

Your setup reminds me of an older discussion but I cannot find it.
MikeLieberman wrote: 2022-11-22 11:38 TWO SSD SATA drives as a RAID1
BIOS RAID or Linux RAID ?
MikeLieberman wrote: 2022-11-22 11:38 So I stuck a 16GB USB stick in and told the installer to use that.
Use for what ? Bootloader, /boot, whole root filesystem ?
MikeLieberman wrote: 2022-11-22 11:38 I have a 500MB fixed disk I could add to the PC,
500 MB hard disk ?

Please post the output of the following commands:

Code: Select all

lsblk
fdisk -l

User avatar
MikeLieberman
Posts: 162
Joined: 2013-01-29 17:26
Location: General Santos City, Philippines
Has thanked: 17 times
Been thanked: 2 times

Re: [Installation] I have a bootloader in a wrong device

#3 Post by MikeLieberman »

I had the 500GB HDD on a shelf. It still had Debian on it. I connected it and the unit booted with that. This is what I get. It looks like the RAID is seen but not mounted. How do I use fstab to mount the RAID? I see the UUIDs for the individual drives but there is no single identifier for the RAID array.

ALSO: The BIOS said the sda drive of the raid was a boot drive, but when I tried to boot to it I got a "grub>" prompt. Can I boot to that and tell it:
set root=(hd2,gpt2)?

Code: Select all

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 476.9G  0 disk 
├─sda1   8:1    0   512M  0 part 
├─sda2   8:2    0 475.5G  0 part 
└─sda3   8:3    0   976M  0 part 
sdb      8:16   0 476.9G  0 disk 
├─sdb1   8:17   0   512M  0 part 
├─sdb2   8:18   0 475.5G  0 part 
└─sdb3   8:19   0   976M  0 part 
sdc      8:32   0 465.8G  0 disk 
├─sdc1   8:33   0 464.8G  0 part /
├─sdc2   8:34   0     1K  0 part 
└─sdc5   8:37   0   975M  0 part [SWAP]

Code: Select all

$ sudo fdisk -l
Disk /dev/sdc: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: TOSHIBA MK5061GS
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: 0x7ca7996a

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdc1  *         2048 974772223 974770176 464.8G 83 Linux
/dev/sdc2       974774270 976771071   1996802   975M  5 Extended
/dev/sdc5       974774272 976771071   1996800   975M 82 Linux swap / Solaris


Disk /dev/sdb: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: WDS500G2B0A-00SM
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: gpt
Disk identifier: 911A1499-8286-4BEA-A00B-2F35B8E0D6C3

Device         Start        End   Sectors   Size Type
/dev/sdb1       2048    1050623   1048576   512M EFI System
/dev/sdb2    1050624  998215679 997165056 475.5G Linux RAID
/dev/sdb3  998215680 1000214527   1998848   976M Linux swap


Disk /dev/sda: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: WDS500G2B0A-00SM
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: gpt
Disk identifier: 0F042267-92CB-4506-A018-A75C2B5313F0

Device         Start        End   Sectors   Size Type
/dev/sda1       2048    1050623   1048576   512M EFI System
/dev/sda2    1050624  998215679 997165056 475.5G Linux RAID
/dev/sda3  998215680 1000214527   1998848   976M Linux swap
The current fstab:

Code: Select all

UUID=121a7fae-ff9f-44ea-9ee1-326f06a8d87b /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=f77f96b5-8ebf-4714-a6f1-0f7f9a007578 none            swap    sw              0       0

Code: Select all

$ sudo parted -l
Model: ATA WDS500G2B0A-00SM (scsi)
Disk /dev/sda: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system     Name  Flags
 1      1049kB  538MB  537MB   fat32                 boot, esp
 2      538MB   511GB  511GB   ext4                  raid
 3      511GB   512GB  1023MB  linux-swap(v1)        swap


Model: ATA WDS500G2B0A-00SM (scsi)
Disk /dev/sdb: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system     Name  Flags
 1      1049kB  538MB  537MB                         boot, esp
 2      538MB   511GB  511GB   ext4                  raid
 3      511GB   512GB  1023MB  linux-swap(v1)        swap


Model: ATA TOSHIBA MK5061GS (scsi)
Disk /dev/sdc: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size    Type      File system     Flags
 1      1049kB  499GB  499GB   primary   ext4            boot
 2      499GB   500GB  1022MB  extended
 5      499GB   500GB  1022MB  logical   linux-swap(v1)
These commands give me nothing:
cat /etc/mdadm.conf
cat /proc/mdstat

Code: Select all

$ sudo lsblk -pf
NAME        FSTYPE            FSVER LABEL      UUID                                 FSAVAIL FSUSE% MOUNTPOINT
/dev/sda                                                                                           
├─/dev/sda1 vfat              FAT32            8671-F88B                                           
├─/dev/sda2 linux_raid_member 1.2   whitebox:0 316a5222-ef24-233e-155a-e703bd03917b                
└─/dev/sda3 swap              1                a689db4a-ff9d-48c9-b8f6-221e7a7f041b                
/dev/sdb                                                                                           
├─/dev/sdb1                                                                                        
├─/dev/sdb2 linux_raid_member 1.2   whitebox:0 316a5222-ef24-233e-155a-e703bd03917b                
└─/dev/sdb3 swap              1                2e61144e-553c-437c-81ae-c9c8a6b5549e                
/dev/sdc                                                                                           
├─/dev/sdc1 ext4              1.0              121a7fae-ff9f-44ea-9ee1-326f06a8d87b  424.7G     2% /
├─/dev/sdc2                                                                                        
└─/dev/sdc5 swap              1                f77f96b5-8ebf-4714-a6f1-0f7f9a007578                [SWAP]

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: [Installation] I have a bootloader in a wrong device

#4 Post by p.H »

I need the requested information from the installed system, with the 16 GB USB stick.
I guess the other system on the 500 GB drive lacks mdadm.

User avatar
MikeLieberman
Posts: 162
Joined: 2013-01-29 17:26
Location: General Santos City, Philippines
Has thanked: 17 times
Been thanked: 2 times

Re: [Installation] I have a bootloader in a wrong device

#5 Post by MikeLieberman »

The 16GB stick no longer loads. Have no idea why it just stopped booting, which is why I threw the 500GB drive on it. And I'm a guy not a gal. :-)

Look, if it is lost now, the ne3xt step is to use parted and blow off the RAID array, right?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: [Installation] I have a bootloader in a wrong device

#6 Post by p.H »

What happens when you try to boot with the USB stick ?
Can you still read it from a working system ?

What is your goal now ?
If you want to explore the RAID drives, install mdadm in the working system. and start RAID arrays.

Code: Select all

apt-get install mdadm
mdadm --assemble --scan
If you used LVM, install lvm2 and activate logical arrays.

Code: Select all

apt-get install lvm2
vgchange -ay
Check lsblk.
If the root filesystem was in RAID or LVM (either /dev/mdX or /dev/mapper/<vgname>-<lvname>), mount it on /mnt and post the contents of /mnt/etc/fstab.
MikeLieberman wrote: 2022-11-23 10:31 I'm a guy not a gal.
So what ? Nobody's perfect.
Last edited by p.H on 2022-11-23 10:48, edited 1 time in total.

User avatar
artytux
Posts: 77
Joined: 2022-10-20 09:00
Has thanked: 18 times
Been thanked: 14 times

Re: [Installation] I have a bootloader in a wrong device

#7 Post by artytux »

MikeLieberman wrote: 2022-11-23 10:31 And I'm a guy not a gal. :-)
mm madam mm mdadm

https://en.wikipedia.org/wiki/Mdadm

Regards
artytux

User avatar
MikeLieberman
Posts: 162
Joined: 2013-01-29 17:26
Location: General Santos City, Philippines
Has thanked: 17 times
Been thanked: 2 times

Re: [Installation] I have a bootloader in a wrong device

#8 Post by MikeLieberman »

THANKS! It is mounted and I see all the duplicate folders.

mdadm: /dev/md/0 has been started with 1 drive

Code: Select all

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda           8:0    0 476.9G  0 disk  
├─sda1        8:1    0   512M  0 part  
├─sda2        8:2    0 475.5G  0 part  
│ └─md0       9:0    0 475.4G  0 raid1 
│   ├─md0p1 259:0    0 474.4G  0 part  
│   ├─md0p2 259:1    0     1K  0 part  
│   └─md0p5 259:2    0 976.7M  0 part  
I do not believe I installed lvm.

User avatar
MikeLieberman
Posts: 162
Joined: 2013-01-29 17:26
Location: General Santos City, Philippines
Has thanked: 17 times
Been thanked: 2 times

Re: [Installation] I have a bootloader in a wrong device

#9 Post by MikeLieberman »

Well I thought it was solved. but it just got worse. The system won't boot at all now.

Here's the thing, It knows about the RAID array, sees the HDD and wants the to load the ARRAY but can't. I get stuck at a prompt asking for the maintenance password and a Control-D. But it won't take my password, Not the one for the HDD and not the one for when I set up the Array.

If I stick in the original 16GB stick it produces a Failed to start gnome manager and terminates Plymouth Boot Screen... and hangs.

I can't ssh into the unit as it won't even ping.

User avatar
MikeLieberman
Posts: 162
Joined: 2013-01-29 17:26
Location: General Santos City, Philippines
Has thanked: 17 times
Been thanked: 2 times

Re: [Installation] I have a bootloader in a wrong device

#10 Post by MikeLieberman »

I gave up and are doing a clean install with the RAID and the other HDD.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: [Installation] I have a bootloader in a wrong device

#11 Post by p.H »

Ok. Why do you use the other HDD ? You can install only on the RAID HDDs (so that you have redundancy for everything).

Post Reply