How to install the boot loader on a new /dev/sda

Recently I installed a new 4TiB disk to house all backups I have, including those for Leap 15.1 and Windows 10 and older disks. My problem now is to get rid of the old 1TiB disk, witch is the /dev/sda with the boot loader. I am asking for your help to reinstall the boot loader on the new (/dev/sda) disk and how can I rename a disk to /dev/sda. Should I connect the 4TiB to the same connectors used by the old backup disk?

My disks are: /dev/sda the disk I want to get rid of
/dev/sdb the new backup disk
/dev/sdc the Windows 10 disk
/dev/sdd the Leap 15.1 disk

Any help would be appreciated. Thanks!

The output of “parted -l” is showed bellow:


Model: ATA WDC WD10EZEX-00B (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/phisical): 512B/4096B
Partition table: gpt
Disk options: 

Number  Start       End          Size         File System   Name     Options
 1             1049kB  1000GB  1000GB   ext4                primary   msftdata


Model: ATA WDC WD40PURZ-85T (scsi)
Disk /dev/sdb: 4001GB
Sector size (logical/phisical): 512B/4096B
Partition table: gpt
Disk options:: 

Number  Start       End          Size           File System       Name                             Options
 1              1049kB  4001GB  4001GB   ntfs                      Basic data partition    msftdata


Modelo: ATA ST1000DM003-1ER1 (scsi)
Disk /dev/sdc: 1000GB
Sector size (logical/phisical): 512B/4096B
Partition table: gpt
Disk options:: 

Number  Start        End           Size         File System   Name     Options
 1              1049kB  525MB     524MB    ntfs                                 hiden, diag
 2              525MB   1000GB   1000GB  ntfs                                 msftdata
 3              1000GB  1000GB  105MB    fat32                               boot, esp


Modelo: ATA ST1000DM003-1ER1 (scsi)
Disk /dev/sdd: 1000GB
Sector size (logical/phisical): 512B/4096B
Partition table: gpt
Disk options:: 

Number  Start       End          Size         File System         Name     Options
 1             1049kB  525MB    524MB    fat16                                     boot, esp
 2             525MB   984GB    983GB     ext4
 3             984GB   1000GB  16,7GB    linux-swap(v1)                    swap

When you unplug the current “/dev/sda”, the disks will probably be renamed as you want.

As for installing the boot loader – how is it installed now? I see some ESP partitions. That suggests that you are using UEFI booting. And those ESP partitions are not on “/dev/sda”. So maybe it will just work already (if you are using UEFI booting).

When I installed the new backup disk I did not remove the older one. After doing the back up of the Leap and Win10 disks I unplugged the old backup disk and restarted to the Leap system in the Grub2 menu, but after a while the screen showed the console prompt as root user. So I reinstalled the old backup.

All four disks are GPT/EFI, but I don’t know what means UEFI booting. The Win10 and the new backup disks are NTFS. The Leap and the older backup disks are ext4.

About the the boot loader, I have no idea how it was installed. I just installed Leap 15.1 in the same disk used by the former installation of Leap 15.0. The Windows 10 was already installed, as was the old backup disk.

Is it possible to install the boot loader manually?

Thanksfor your help!

Yes, but we first need to know how you are currently booting.

What’s the output from:

grep LOADER_TYPE /etc/sysconfig/bootloader

Hmm, may you can also give the output from:

cat /etc/default/grub_installdevice

It’s okay if that file does not exist. And if it does exist, then the output from

cat /boot/grub2/device.map

might also be useful.

Do you have the old backup drive auto mounted??

Check cat /etc/fstab and if the drive is in the list remove it (need to be root to edit the file). Then you should ale to boot without the drive in the machine.

If unsure post output here using code tags (# in editor tool bar)

I beg your pardon for no answering earlier. I had to travel for a couple of days.

The outputs are:

berredo@linux-9i0p:~> grep LOADER_TYPE /etc/sysconfig/bootloader
LOADER_TYPE="grub2-efi"
berredo@linux-9i0p:~> cat /etc/default/grub_installdevice
cat: /etc/default/grub_installdevice: File or Directory not found
berredo@linux-9i0p:~> cat /boot/grub2/device.map
cat: /boot/grub2/device.map: File or Directory not found

About the former system configuration, I had three 1 TiB disks:

  • Leap 15.1
  • Windows 10
  • Backup
  • The Backup and Windows 10 disks were NOT automatically mounted.

With the new 4 TiB backup disk installed, the the old backup disk IS automatically mounted
All backup operations (Leap and Win10) were (and are) made by running scrips in Leap system after mounting the Backup and Win10 disks.
After the backup operations the Backup and Windows 10 disks are manually unmounted.

Thanks again for your help!

The output is:

berredo@linux-9i0p:~> cat /etc/fstab
UUID=2cdb31bb-9fbe-4573-b789-3b846f142eaf  /          ext4  acl,user_xattr  0  1
UUID=c4d58cc1-1331-4bc6-8413-cf4d8ee4a4ef  swap       swap  defaults        0  0
UUID=F9A7-B579                             /boot/efi  vfat  defaults        0  0
UUID=525b37e9-0dfb-4bb2-9614-603af1e6aa26  /home      ext4  user,noauto,acl,user_xattr,data=ordered  0  2
LABEL=old_backup                           /run/media/berredo/old_backup  ext4  defaults        0  2

I am not an expert, but it seems to me that there is a /home partition on the old backup…
If true, is it possible to put the /home back on the Leap 15.1 system and get rid of this old_backup?

Thanks again for the help!

Okay. So you are using UEFI booting.

Based on your “parted -l” output, your EFI partition is on “/dev/sdc”. So that should remain unchanged.

It looks as if you linux system is currently on “/dev/sda”. But if you install to a new disk, that should update the UEFI boot information, so that you will boot from there. And UEFI booting normally use UUID to identify disks, so should continue to work after doing something that changes the disks.

In other words, the booting should take care of itself, as long as you install to the new disk in UEFI mode (boot the installer in UEFI mode).

OK, but what exactly should I install on a new disk? (Sorry, I am not even a newbie on UEFI). Should I install Leap 15.1 on the /dev/sda?

Thanks for your help and patience!

It is your computer. So you get to decide what to install.

But yes, installing Leap 15.1 on “/dev/sda” would probably give you what you want – always assuming that I understand what you want.

You need an EFI system partition, a system partition and a home partition. Home can be a folder in the system partition, but this is cumbersome. You may want ext4 for the system partition. One of my configurations is:

UUID=e89242e4-b980-44fa-b382-778cae48973e  /          ext4  defaults      0  1
UUID=18e63751-b483-4422-b10d-6b896681ee64  /home      ext4  data=ordered  0  2
UUID=404C-1EC8                             /boot/efi  vfat  defaults      0  0
erlangen:~ # df -h /boot/efi/ / /home
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       100M   15M   86M  15% /boot/efi
/dev/sdb3        40G   17G   23G  43% /
/dev/sdc3       428G  271G  136G  67% /home
erlangen:~ # 

The boot loader does not sit on a drive, but in the EFI system partition (sdb1). Operating systems may share an EFI system partition.

OK, thanks for your help!