Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
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.
|
 |
08-02-2020, 08:07 AM
|
#1
|
Member
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
|
Moving dual boot system to larger SSD. Possible to expand ?
My hardware upgrade path has already been captured in brief here.
So I decided to throw in an SSD upgrade too from 120G to 250G. The older SSD will likely revive an old laptop.
Currently the new SSD is attached via an SATA to USB converter and is detected by as follows -
Code:
# fdisk -l /dev/sda /dev/sdc
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Disk model: KINGSTON SUV400S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: F4AF905B-0F37-49BA-AD75-2C7C679838F7
Device Start End Sectors Size Type
/dev/sda1 2048 130258762 130256715 62.1G Microsoft basic data
/dev/sda3 138647552 142841855 4194304 2G EFI System
/dev/sda4 142841856 143863807 1021952 499M Windows recovery environment
/dev/sda5 143863808 144068607 204800 100M EFI System
/dev/sda6 144068608 144101375 32768 16M Microsoft reserved
/dev/sda7 144101376 230230015 86128640 41.1G Linux LVM
Disk /dev/sdc: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Disk model: Generic
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Now the sda holds windows boot data (drive C -> sda1, recovery -> sda4, EFI -> sda5 and reserved -> sda6) and linux boot data (/ -> sda7 and /boot/efi -> sda3).
I know I can clone sda to sdc , make changes of uuids in fstab(chroot in sdc) and boot off it. But that accounts for a like for like disk partition scheme on sdc so I wont be able to use the increased disk space.
Regrettably, I am not using LVM for / and /boot/efi , just partitions.
Code:
# df -hPT / /boot/efi
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda7 ext4 41G 15G 25G 37% /
/dev/sda3 vfat 2.0G 5.0M 2.0G 1% /boot/efi
I also know that I can use this drive sdc like placeholder to copy my / data off sda, boot from a live USB, convert sda7 as lvm, copy the data back, create new initrd and see if it works. But I do not know if the other OS will survive it.
Do you think I need to take any further precaution here ? or it is too much of a hassle and I am better off installing fresh OS on the sdc.
All my data (linux+windows) is on a HDD so they are not being touched at all. I was wondering if anyone has done this already and could give me few pointers.
|
|
|
08-02-2020, 01:08 PM
|
#2
|
Member
Registered: Feb 2010
Posts: 417
|
You still have everything on the 120G and the 250G is a work in progress attached via usb at this point? If the answer is yes, you can afford to fool around with and start over and reclone if something goes wrong a this point? Gparted will probably show 130G of unallocated space after /dev/sda7 (your linux root partition), so growing sda7 to 171G is probably easy and probably won't ruin anything. Creating an extra partition to use the extra space which windows & linux can share as extra storage is another easy harmless possibility. A combination dividing your unallocated space between the previous two alternatives is also easy/probably safe. Growing anything that will relocate your windows partitions is quite risky. There is some risk in any of these changes, so do it while starting over and recloning is not a big hassle. Taking the 250G and replacing the 120G with it on a direct sata connection and booting using a live distro on a dvd or usb pendrive to use gparted is probably preferable to trying to make the partition alterations with the 250G attached via usb, but if starting over from scratch doesn't bother you and physically swapping drives does, it's your call.
|
|
|
08-02-2020, 04:49 PM
|
#3
|
Member
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Original Poster
|
Yes, everything is still as it was. I am going to try it ( conversion of partion to lvm ) a few days down the line, but I just wanted to make sure I am not missing a step or something.
I'll have few usb drives ready, before I try it out though.
Obviously, I'll keep you all posted about the outcome so this would maybe help someone.
|
|
|
08-15-2020, 08:47 AM
|
#4
|
Member
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Original Poster
|
update
I had a go with disk to disk clone from sda(120G , original boot device) to sdc (240G, intended boot device), Using Clonezilla stable based on ubuntu.
I looked at the documentation here, and made following adjustments -
1. selected expert mode
2. chose option K1
The disk copy has been completed, and I see following behavior -
A. Partition size has been adjusted as follows -
Code:
# fdisk /dev/sda
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Disk model: KINGSTON SUV400S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: F4AF905B-0F37-49BA-AD75-2C7C679838F7
Device Start End Sectors Size Type
/dev/sda1 2048 130258762 130256715 62.1G Microsoft basic data
/dev/sda3 138647552 142841855 4194304 2G EFI System
/dev/sda4 142841856 143863807 1021952 499M Windows recovery environment
/dev/sda5 143863808 144068607 204800 100M EFI System
/dev/sda6 144068608 144101375 32768 16M Microsoft reserved
/dev/sda7 144101376 230230015 86128640 41.1G Linux LVM
# gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.1
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 234441648 sectors, 111.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): F4AF905B-0F37-49BA-AD75-2C7C679838F7
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 234441614
Partitions will be aligned on 2048-sector boundaries
Total free space is 12602402 sectors (6.0 GiB)
Number Start (sector) End (sector) Size Code Name
1 2048 130258762 62.1 GiB 0700
3 138647552 142841855 2.0 GiB EF00 Basic data partition
4 142841856 143863807 499.0 MiB 2700 Basic data partition
5 143863808 144068607 100.0 MiB EF00 EFI system partition
6 144068608 144101375 16.0 MiB 0C01 Microsoft reserved ...
7 144101376 230230015 41.1 GiB 8E00
# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sdc: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Disk model: Generic
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: F4AF905B-0F37-49BA-AD75-2C7C679838F7
Device Start End Sectors Size Type
/dev/sdc1 2048 260503716 260501669 124.2G Microsoft basic data
/dev/sdc3 260503717 264698020 4194304 2G EFI System
/dev/sdc4 264698021 265719972 1021952 499M Windows recovery environment
/dev/sdc5 265719973 265924772 204800 100M EFI System
/dev/sdc6 265924773 265957540 32768 16M Microsoft reserved
/dev/sdc7 265957541 468862094 202904554 96.8G Linux LVM
Partition 3 does not start on physical sector boundary.
Partition 4 does not start on physical sector boundary.
Partition 5 does not start on physical sector boundary.
Partition 6 does not start on physical sector boundary.
Partition 7 does not start on physical sector boundary.
# gdisk -l /dev/sdc
GPT fdisk (gdisk) version 1.0.1
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sdc: 468862128 sectors, 223.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): F4AF905B-0F37-49BA-AD75-2C7C679838F7
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 468862094
Partitions will be aligned on 1-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 2048 260503716 124.2 GiB 0700
3 260503717 264698020 2.0 GiB EF00 Basic data partition
4 264698021 265719972 499.0 MiB 2700 Basic data partition
5 265719973 265924772 100.0 MiB EF00 EFI system partition
6 265924773 265957540 16.0 MiB 0C01 Microsoft reserved ...
7 265957541 468862094 96.8 GiB 8E00
B. The device sdc can be booted, but it is still using the old efiboot partition -
Code:
# cat /etc/fstab
UUID=3b7d7caa-e926-49cc-8d7b-d0d9d0b1cfda / ext4 acl,user_xattr 0 1
#/dev/sdb4 /home btrfs defaults 0 0
UUID=c1aa41c3-bd6e-4370-8427-94edf7fc4b09 /home btrfs defaults 0 0
UUID=1BB7-512E /boot/efi vfat codepage=437 0 0
#UUID=74b6ede4-be66-4073-b559-64bf5da81b8d swap swap defaults 0 0
#/dev/sdb3 /VMs btrfs defaults 0 0
UUID=f199d576-98b6-4f3d-ac44-9eeb1dd1ba8f /VMs btrfs defaults 0 0
UUID=e49e8082-e5ee-4c63-82de-3c5649fc043d swap swap defaults 0 0
C. Here are the UUID details, note that sdc does not seem to have proper UUID for many partitions (and that error in fdisk output).I re-read the instructions and now understand that the expert -k1 option does not play well with GPT, so that could be the problem.
Also. note that the UUIDs on /dev/sda and /dev/sdc are same.
Code:
# blkid /dev/sd*
/dev/sda: PTUUID="f4af905b-0f37-49ba-ad75-2c7c679838f7" PTTYPE="gpt"
/dev/sda1: UUID="BEEAD572EAD52783" TYPE="ntfs" PARTUUID="5fbc43d6-87f3-4ebe-8881-4e9535f41d0e"
/dev/sda3: LABEL_FATBOOT="suse-boot" LABEL="suse-boot" UUID="1BB7-512E" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="95043473-aa4c-4a00-acc3-6ac82f0dfbac"
/dev/sda4: LABEL="Recovery" UUID="34AC09E4AC09A18A" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="b871139c-59e8-47d6-98e6-f778f287039b"
/dev/sda5: UUID="200E-BDB8" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="9a4ef6eb-27e7-4ead-af33-7c3700b67db1"
/dev/sda6: PARTLABEL="Microsoft reserved partition" PARTUUID="32be22ae-79cc-4dfa-afa2-666e61d10ec2"
/dev/sda7: UUID="3b7d7caa-e926-49cc-8d7b-d0d9d0b1cfda" TYPE="ext4" PARTUUID="89b18791-3fad-4594-8ee0-1cdb99ba7d13"
/dev/sdc: PTUUID="f4af905b-0f37-49ba-ad75-2c7c679838f7" PTTYPE="gpt"
/dev/sdc1: UUID="BEEAD572EAD52783" TYPE="ntfs" PARTUUID="5fbc43d6-87f3-4ebe-8881-4e9535f41d0e"
/dev/sdc3: LABEL="suse-boot" UUID="1BB7-512E" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="95043473-aa4c-4a00-acc3-6ac82f0dfbac"
/dev/sdc4: LABEL="Recovery" UUID="34AC09E4AC09A18A" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="b871139c-59e8-47d6-98e6-f778f287039b"
/dev/sdc5: UUID="200E-BDB8" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="9a4ef6eb-27e7-4ead-af33-7c3700b67db1"
/dev/sdc6: PARTLABEL="Microsoft reserved partition" PARTUUID="32be22ae-79cc-4dfa-afa2-666e61d10ec2"
/dev/sdc7: UUID="3b7d7caa-e926-49cc-8d7b-d0d9d0b1cfda" TYPE="ext4" PARTUUID="89b18791-3fad-4594-8ee0-1cdb99ba7d13"
/dev/sdb: PTUUID="9e9b9b32-df6c-4227-996b-e4640b21b16f" PTTYPE="gpt"
/dev/sdb1: LABEL="Win-E" UUID="3870D900000C472B" TYPE="ntfs" PTTYPE="dos" PARTUUID="077e1b84-7e10-4ef3-81c7-1a389c93f5de"
/dev/sdb2: LABEL="swap" UUID="e49e8082-e5ee-4c63-82de-3c5649fc043d" TYPE="swap" PARTUUID="366f5a0a-030b-402a-8ac7-32ca4a8c540c"
/dev/sdb3: LABEL="DATA-vms" UUID="f199d576-98b6-4f3d-ac44-9eeb1dd1ba8f" UUID_SUB="72fa0afc-6480-4315-9dcd-213cc3c2191b" TYPE="btrfs" PARTUUID="1c47df9e-685f-49fc-9002-e4768bb78768"
/dev/sdb4: LABEL="Home" UUID="c1aa41c3-bd6e-4370-8427-94edf7fc4b09" UUID_SUB="226efb32-cef2-456c-9530-ec476dc82069" TYPE="btrfs" PARTUUID="efe61e0f-1e48-4a4c-8fd8-6a7b1a6bc02a"
/dev/sdd: UUID="2018-05-16-17-45-22-53" LABEL="openSUSE-Leap-15.0-DVD-x86_64267" TYPE="iso9660" PTUUID="6b8b4567" PTTYPE="dos"
/dev/sdd1: UUID="70A5-CF2C" TYPE="vfat" PARTUUID="6b8b4567-01"
So currently here is my mounted filesystems -
Code:
# df -hPT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 16G 8.0K 16G 1% /dev
tmpfs tmpfs 16G 180M 16G 2% /dev/shm
tmpfs tmpfs 16G 9.8M 16G 1% /run
tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sdc7 ext4 95G 15G 76G 17% /
/dev/sda3 vfat 2.0G 5.0M 2.0G 1% /boot/efi
/dev/sdb4 btrfs 196G 11G 183G 6% /home
/dev/sdb3 btrfs 147G 119G 28G 82% /VMs
tmpfs tmpfs 3.2G 16K 3.2G 1% /run/user/1000
|
|
|
08-15-2020, 08:55 AM
|
#5
|
Member
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Original Poster
|
so a quick edit to fstab to specifically find /dev/sdc3 later, it seems linux booted entirely off sdc -
Code:
# df -hPT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 16G 0 16G 0% /dev
tmpfs tmpfs 16G 67M 16G 1% /dev/shm
tmpfs tmpfs 16G 9.8M 16G 1% /run
tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sdc7 ext4 95G 15G 76G 17% /
/dev/sdc3 vfat 2.0G 5.0M 2.0G 1% /boot/efi
/dev/sdb4 btrfs 196G 11G 183G 6% /home
/dev/sdb3 btrfs 147G 119G 28G 82% /VMs
tmpfs tmpfs 3.2G 16K 3.2G 1% /run/user/1000
# cat /etc/fstab
UUID=3b7d7caa-e926-49cc-8d7b-d0d9d0b1cfda / ext4 acl,user_xattr 0 1
#/dev/sdb4 /home btrfs defaults 0 0
UUID=c1aa41c3-bd6e-4370-8427-94edf7fc4b09 /home btrfs defaults 0 0
#UUID=1BB7-512E /boot/efi vfat codepage=437 0 0
/dev/sdc3 /boot/efi vfat codepage=437 0 0
#UUID=74b6ede4-be66-4073-b559-64bf5da81b8d swap swap defaults 0 0
#/dev/sdb3 /VMs btrfs defaults 0 0
UUID=f199d576-98b6-4f3d-ac44-9eeb1dd1ba8f /VMs btrfs defaults 0 0
UUID=e49e8082-e5ee-4c63-82de-3c5649fc043d swap swap defaults 0 0
|
|
|
08-15-2020, 09:13 AM
|
#6
|
Member
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Original Poster
|
Another reboot later -
Code:
# df -hPT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 16G 0 16G 0% /dev
tmpfs tmpfs 16G 0 16G 0% /dev/shm
tmpfs tmpfs 16G 18M 16G 1% /run
tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sdc7 ext4 41G 15G 24G 40% /
/dev/sdc3 vfat 2.0G 5.0M 2.0G 1% /boot/efi
/dev/sdd3 btrfs 147G 119G 28G 82% /VMs
/dev/sdd4 btrfs 196G 11G 183G 6% /home
tmpfs tmpfs 3.2G 16K 3.2G 1% /run/user/1000
So, my system now interchages sda and sdc ?
Note that df output from post#1 where root partition's size is 41G and in post #4 and #5, the root partition's size is 95G, which is expected.
But in the current scenario, the system has now interchanged sda and sdc than what it was in earlier scenario (post #4) --
Code:
# fdisk -l
Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Disk model: Generic
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: F4AF905B-0F37-49BA-AD75-2C7C679838F7
Device Start End Sectors Size Type
/dev/sda1 2048 260503716 260501669 124.2G Microsoft basic data
/dev/sda3 260503717 264698020 4194304 2G EFI System
/dev/sda4 264698021 265719972 1021952 499M Windows recovery environment
/dev/sda5 265719973 265924772 204800 100M EFI System
/dev/sda6 265924773 265957540 32768 16M Microsoft reserved
/dev/sda7 265957541 468862094 202904554 96.8G Linux LVM
Partition 3 does not start on physical sector boundary.
Partition 4 does not start on physical sector boundary.
Partition 5 does not start on physical sector boundary.
Partition 6 does not start on physical sector boundary.
Partition 7 does not start on physical sector boundary.
Disk /dev/sdc: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Disk model: KINGSTON SUV400S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: F4AF905B-0F37-49BA-AD75-2C7C679838F7
Device Start End Sectors Size Type
/dev/sdc1 2048 130258762 130256715 62.1G Microsoft basic data
/dev/sdc3 138647552 142841855 4194304 2G EFI System
/dev/sdc4 142841856 143863807 1021952 499M Windows recovery environment
/dev/sdc5 143863808 144068607 204800 100M EFI System
/dev/sdc6 144068608 144101375 32768 16M Microsoft reserved
/dev/sdc7 144101376 230230015 86128640 41.1G Linux LVM
Since UUIDs, labels etc are same and the system now interchanges sda with sdc, how can I reliably boot off the new 240G disk ?
Note that the original 120G disk is connected internally (SATA) and 240G disk is connected via USB. And if I disconnect the USB, the system still behaves as it would prior to the entire operation.
Last edited by Honest Abe; 08-15-2020 at 09:14 AM.
|
|
|
08-16-2020, 10:08 AM
|
#7
|
Member
Registered: Feb 2010
Posts: 417
|
Another part of this is your bootloader and options on the kernel boot line. Are you using elilo, or grub or something else? What does the configuration file look like in the bootloader? Are you using UUID in the bootloader configuration file?
|
|
|
08-16-2020, 11:04 AM
|
#8
|
Member
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Original Poster
|
120G disconnected, 240G connected via USB
@biker_rat, this is grub2. Looking at the grub.cfg, I do not see UUID naming convention being used, only disk/partition. Do you know what I need to do in /etc/default/grub ?
current troubleshooting -
- disconnected 120G sata power & data cable
- connected 240G via USB
- booted off 240G opensuse bootloader (which controls opensuse and windows)
- right off the bat the system did not boot, because of what I did in post #5 (partition instead of UUID in fstab)
- booted off ubunti 17.10 live, mounted the root partition and fixed the fstab again to boot off UUID. rebooted
- the 240G now boots opensuse correctly. [This makes the disk a like for like replacement as far as linux is concerned]
- the 240G did not boot M$ at all.
- obviously the system recognizes disks differently now
- os-prober reported this. In this Setup, sdb is the 240G disk
Code:
# os-prober
/dev/sdb5@/efi/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
- so I took a backup of the old grub.cfg and created a new grub.cfg but they are now alike, which worries me.
Code:
# sdiff /boot/grub2/grub.cfg /boot/grub2/grub.cfg.16082020
# #
# DO NOT EDIT THIS FILE # DO NOT EDIT THIS FILE
# #
# It is automatically generated by grub2-mkconfig using templ # It is automatically generated by grub2-mkconfig using templ
# from /etc/grub.d and settings from /etc/default/grub # from /etc/grub.d and settings from /etc/default/grub
# #
### BEGIN /etc/grub.d/00_header ### ### BEGIN /etc/grub.d/00_header ###
if [ -f ${config_directory}/grubenv ]; then if [ -f ${config_directory}/grubenv ]; then
load_env -f ${config_directory}/grubenv load_env -f ${config_directory}/grubenv
elif [ -s $prefix/grubenv ]; then elif [ -s $prefix/grubenv ]; then
load_env load_env
fi fi
if [ "${env_block}" ] ; then if [ "${env_block}" ] ; then
set env_block="(${root})${env_block}" set env_block="(${root})${env_block}"
export env_block export env_block
load_env -f "${env_block}" load_env -f "${env_block}"
fi fi
if [ "${next_entry}" ] ; then if [ "${next_entry}" ] ; then
set default="${next_entry}" set default="${next_entry}"
set next_entry= set next_entry=
save_env next_entry save_env next_entry
if [ "${env_block}" ] ; then if [ "${env_block}" ] ; then
save_env -f "${env_block}" next_entry save_env -f "${env_block}" next_entry
fi fi
set boot_once=true set boot_once=true
else else
set default="${saved_entry}" set default="${saved_entry}"
fi fi
if [ x"${feature_menuentry_id}" = xy ]; then if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id" menuentry_id_option="--id"
else else
menuentry_id_option="" menuentry_id_option=""
fi fi
export menuentry_id_option export menuentry_id_option
if [ "${prev_saved_entry}" ]; then if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}" set saved_entry="${prev_saved_entry}"
save_env saved_entry save_env saved_entry
set prev_saved_entry= set prev_saved_entry=
save_env prev_saved_entry save_env prev_saved_entry
set boot_once=true set boot_once=true
fi fi
function savedefault { function savedefault {
if [ -z "${boot_once}" ]; then if [ -z "${boot_once}" ]; then
saved_entry="${chosen}" saved_entry="${chosen}"
if [ "${env_block}" ] ; then if [ "${env_block}" ] ; then
save_env -f "${env_block}" saved_entry save_env -f "${env_block}" saved_entry
else else
save_env saved_entry save_env saved_entry
fi fi
fi fi
} }
function load_video { function load_video {
if [ x$feature_all_video_module = xy ]; then if [ x$feature_all_video_module = xy ]; then
insmod all_video insmod all_video
else else
insmod efi_gop insmod efi_gop
insmod efi_uga insmod efi_uga
insmod ieee1275_fb insmod ieee1275_fb
insmod vbe insmod vbe
insmod vga insmod vga
insmod video_bochs insmod video_bochs
insmod video_cirrus insmod video_cirrus
fi fi
} }
if [ x$feature_default_font_path = xy ] ; then if [ x$feature_default_font_path = xy ] ; then
font=unicode font=unicode
else else
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd0,gpt7' set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt
else else
search --no-floppy --fs-uuid --set=root 3b7d7caa-e926-49cc- search --no-floppy --fs-uuid --set=root 3b7d7caa-e926-49cc-
fi fi
font="/usr/share/grub2/unicode.pf2" font="/usr/share/grub2/unicode.pf2"
fi fi
if loadfont $font ; then if loadfont $font ; then
echo "Please press t to show the boot menu on this console" echo "Please press t to show the boot menu on this console"
set gfxmode=auto set gfxmode=auto
load_video load_video
insmod gfxterm insmod gfxterm
fi fi
terminal_output gfxterm terminal_output gfxterm
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd0,gpt7' set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt
else else
search --no-floppy --fs-uuid --set=root 3b7d7caa-e926-49cc- search --no-floppy --fs-uuid --set=root 3b7d7caa-e926-49cc-
fi fi
insmod gfxmenu insmod gfxmenu
loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans-Bold14 loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans-Bold14
loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans10.pf2 loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans10.pf2
loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans12.pf2 loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans12.pf2
loadfont ($root)/boot/grub2/themes/openSUSE/ascii.pf2 loadfont ($root)/boot/grub2/themes/openSUSE/ascii.pf2
insmod png insmod png
set theme=($root)/boot/grub2/themes/openSUSE/theme.txt set theme=($root)/boot/grub2/themes/openSUSE/theme.txt
export theme export theme
if [ x${boot_once} = xtrue ]; then if [ x${boot_once} = xtrue ]; then
set timeout=0 set timeout=0
elif [ x$feature_timeout_style = xy ] ; then elif [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu set timeout_style=menu
set timeout=10 set timeout=10
# Fallback normal timeout code in case the timeout_style feat # Fallback normal timeout code in case the timeout_style feat
# unavailable. # unavailable.
else else
set timeout=10 set timeout=10
fi fi
### END /etc/grub.d/00_header ### ### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/00_tuned ### ### BEGIN /etc/grub.d/00_tuned ###
set tuned_params="" set tuned_params=""
set tuned_initrd="" set tuned_initrd=""
### END /etc/grub.d/00_tuned ### ### END /etc/grub.d/00_tuned ###
### BEGIN /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/10_linux ###
menuentry 'openSUSE Leap 15.1' --class opensuse --class gnu- menuentry 'openSUSE Leap 15.1' --class opensuse --class gnu-
load_video load_video
set gfxpayload=keep set gfxpayload=keep
insmod gzio insmod gzio
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd0,gpt7' set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios search --no-floppy --fs-uuid --set=root --hint-bios
else else
search --no-floppy --fs-uuid --set=root 3b7d7caa-e9 search --no-floppy --fs-uuid --set=root 3b7d7caa-e9
fi fi
echo 'Loading Linux 4.12.14-lp151.28.59-default .. echo 'Loading Linux 4.12.14-lp151.28.59-default ..
linuxefi /boot/vmlinuz-4.12.14-lp151.28.59-default ro linuxefi /boot/vmlinuz-4.12.14-lp151.28.59-default ro
echo 'Loading initial ramdisk ...' echo 'Loading initial ramdisk ...'
initrdefi /boot/initrd-4.12.14-lp151.28.59-default initrdefi /boot/initrd-4.12.14-lp151.28.59-default
} }
submenu 'Advanced options for openSUSE Leap 15.1' --hotkey=1 submenu 'Advanced options for openSUSE Leap 15.1' --hotkey=1
menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1 menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1
load_video load_video
set gfxpayload=keep set gfxpayload=keep
insmod gzio insmod gzio
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd0,gpt7' set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; t if [ x$feature_platform_search_hint = xy ]; t
search --no-floppy --fs-uuid --set=root --h search --no-floppy --fs-uuid --set=root --h
else else
search --no-floppy --fs-uuid --set=root 3b7 search --no-floppy --fs-uuid --set=root 3b7
fi fi
echo 'Loading Linux 4.12.14-lp151.28.59-de echo 'Loading Linux 4.12.14-lp151.28.59-de
linuxefi /boot/vmlinuz-4.12.14-lp151.28.59-de linuxefi /boot/vmlinuz-4.12.14-lp151.28.59-de
echo 'Loading initial ramdisk ...' echo 'Loading initial ramdisk ...'
initrdefi /boot/initrd-4.12.14-lp151.28.59-de initrdefi /boot/initrd-4.12.14-lp151.28.59-de
} }
menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1 menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1
load_video load_video
set gfxpayload=keep set gfxpayload=keep
insmod gzio insmod gzio
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd0,gpt7' set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; t if [ x$feature_platform_search_hint = xy ]; t
search --no-floppy --fs-uuid --set=root --h search --no-floppy --fs-uuid --set=root --h
else else
search --no-floppy --fs-uuid --set=root 3b7 search --no-floppy --fs-uuid --set=root 3b7
fi fi
echo 'Loading Linux 4.12.14-lp151.28.59-de echo 'Loading Linux 4.12.14-lp151.28.59-de
linuxefi /boot/vmlinuz-4.12.14-lp151.28.59-de linuxefi /boot/vmlinuz-4.12.14-lp151.28.59-de
echo 'Loading initial ramdisk ...' echo 'Loading initial ramdisk ...'
initrdefi /boot/initrd-4.12.14-lp151.28.59-de initrdefi /boot/initrd-4.12.14-lp151.28.59-de
} }
menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1 menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1
load_video load_video
set gfxpayload=keep set gfxpayload=keep
insmod gzio insmod gzio
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd0,gpt7' set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; t if [ x$feature_platform_search_hint = xy ]; t
search --no-floppy --fs-uuid --set=root --h search --no-floppy --fs-uuid --set=root --h
else else
search --no-floppy --fs-uuid --set=root 3b7 search --no-floppy --fs-uuid --set=root 3b7
fi fi
echo 'Loading Linux 4.12.14-lp151.28.52-de echo 'Loading Linux 4.12.14-lp151.28.52-de
linuxefi /boot/vmlinuz-4.12.14-lp151.28.52-de linuxefi /boot/vmlinuz-4.12.14-lp151.28.52-de
echo 'Loading initial ramdisk ...' echo 'Loading initial ramdisk ...'
initrdefi /boot/initrd-4.12.14-lp151.28.52-de initrdefi /boot/initrd-4.12.14-lp151.28.52-de
} }
menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1 menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1
load_video load_video
set gfxpayload=keep set gfxpayload=keep
insmod gzio insmod gzio
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd0,gpt7' set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; t if [ x$feature_platform_search_hint = xy ]; t
search --no-floppy --fs-uuid --set=root --h search --no-floppy --fs-uuid --set=root --h
else else
search --no-floppy --fs-uuid --set=root 3b7 search --no-floppy --fs-uuid --set=root 3b7
fi fi
echo 'Loading Linux 4.12.14-lp151.28.52-de echo 'Loading Linux 4.12.14-lp151.28.52-de
linuxefi /boot/vmlinuz-4.12.14-lp151.28.52-de linuxefi /boot/vmlinuz-4.12.14-lp151.28.52-de
echo 'Loading initial ramdisk ...' echo 'Loading initial ramdisk ...'
initrdefi /boot/initrd-4.12.14-lp151.28.52-de initrdefi /boot/initrd-4.12.14-lp151.28.52-de
} }
} }
### END /etc/grub.d/10_linux ### ### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ### ### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ### ### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ### ### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ### ### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ### ### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sda5)' --class windo menuentry 'Windows Boot Manager (on /dev/sda5)' --class windo
insmod part_gpt insmod part_gpt
insmod fat insmod fat
set root='hd0,gpt5' set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios search --no-floppy --fs-uuid --set=root --hint-bios
else else
search --no-floppy --fs-uuid --set=root 200E-BDB8 search --no-floppy --fs-uuid --set=root 200E-BDB8
fi fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi chainloader /efi/Microsoft/Boot/bootmgfw.efi
} }
### END /etc/grub.d/30_os-prober ### ### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ### ### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. # This file provides an easy way to add custom menu entries.
# menu entries you want to add after this comment. Be carefu # menu entries you want to add after this comment. Be carefu
# the 'exec tail' line above. # the 'exec tail' line above.
### END /etc/grub.d/40_custom ### ### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ### ### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ];
source $prefix/custom.cfg; source $prefix/custom.cfg;
fi fi
### END /etc/grub.d/41_custom ### ### END /etc/grub.d/41_custom ###
### BEGIN /etc/grub.d/80_suse_btrfs_snapshot ### ### BEGIN /etc/grub.d/80_suse_btrfs_snapshot ###
### END /etc/grub.d/80_suse_btrfs_snapshot ### ### END /etc/grub.d/80_suse_btrfs_snapshot ###
### BEGIN /etc/grub.d/90_persistent ### ### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ### ### END /etc/grub.d/90_persistent ###
### BEGIN /etc/grub.d/95_textmode ### ### BEGIN /etc/grub.d/95_textmode ###
# On EFI systems we can only have graphics *or* serial, s # On EFI systems we can only have graphics *or* serial, s
# to switch between the two # to switch between the two
hiddenentry 'Text mode' --hotkey 't' { hiddenentry 'Text mode' --hotkey 't' {
set textmode=true set textmode=true
terminal_output console terminal_output console
} }
### END /etc/grub.d/95_textmode ### ### END /etc/grub.d/95_textmode ###
# os-prober
/dev/sdb5@/efi/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
# diff /boot/grub2/grub.cfg /boot/grub2/grub.cfg.16082020
#
Note, all this is still reversible, the 120G can still be connected and boots off both OS just fine.
|
|
|
08-16-2020, 11:16 AM
|
#9
|
Member
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Original Poster
|
|
|
|
08-16-2020, 11:28 AM
|
#10
|
Member
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Original Poster
|
So apparently, I can now UUID for linux partitions, but not for windows -
Code:
# sdiff /boot/grub2/grub.cfg /boot/grub2/grub.cfg.16082020
# #
# DO NOT EDIT THIS FILE # DO NOT EDIT THIS FILE
# #
# It is automatically generated by grub2-mkconfig using templ # It is automatically generated by grub2-mkconfig using templ
# from /etc/grub.d and settings from /etc/default/grub # from /etc/grub.d and settings from /etc/default/grub
# #
### BEGIN /etc/grub.d/00_header ### ### BEGIN /etc/grub.d/00_header ###
if [ -f ${config_directory}/grubenv ]; then if [ -f ${config_directory}/grubenv ]; then
load_env -f ${config_directory}/grubenv load_env -f ${config_directory}/grubenv
elif [ -s $prefix/grubenv ]; then elif [ -s $prefix/grubenv ]; then
load_env load_env
fi fi
if [ "${env_block}" ] ; then if [ "${env_block}" ] ; then
set env_block="(${root})${env_block}" set env_block="(${root})${env_block}"
export env_block export env_block
load_env -f "${env_block}" load_env -f "${env_block}"
fi fi
if [ "${next_entry}" ] ; then if [ "${next_entry}" ] ; then
set default="${next_entry}" set default="${next_entry}"
set next_entry= set next_entry=
save_env next_entry save_env next_entry
if [ "${env_block}" ] ; then if [ "${env_block}" ] ; then
save_env -f "${env_block}" next_entry save_env -f "${env_block}" next_entry
fi fi
set boot_once=true set boot_once=true
else else
set default="${saved_entry}" set default="${saved_entry}"
fi fi
if [ x"${feature_menuentry_id}" = xy ]; then if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id" menuentry_id_option="--id"
else else
menuentry_id_option="" menuentry_id_option=""
fi fi
export menuentry_id_option export menuentry_id_option
if [ "${prev_saved_entry}" ]; then if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}" set saved_entry="${prev_saved_entry}"
save_env saved_entry save_env saved_entry
set prev_saved_entry= set prev_saved_entry=
save_env prev_saved_entry save_env prev_saved_entry
set boot_once=true set boot_once=true
fi fi
function savedefault { function savedefault {
if [ -z "${boot_once}" ]; then if [ -z "${boot_once}" ]; then
saved_entry="${chosen}" saved_entry="${chosen}"
if [ "${env_block}" ] ; then if [ "${env_block}" ] ; then
save_env -f "${env_block}" saved_entry save_env -f "${env_block}" saved_entry
else else
save_env saved_entry save_env saved_entry
fi fi
fi fi
} }
function load_video { function load_video {
if [ x$feature_all_video_module = xy ]; then if [ x$feature_all_video_module = xy ]; then
insmod all_video insmod all_video
else else
insmod efi_gop insmod efi_gop
insmod efi_uga insmod efi_uga
insmod ieee1275_fb insmod ieee1275_fb
insmod vbe insmod vbe
insmod vga insmod vga
insmod video_bochs insmod video_bochs
insmod video_cirrus insmod video_cirrus
fi fi
} }
if [ x$feature_default_font_path = xy ] ; then if [ x$feature_default_font_path = xy ] ; then
font=unicode font=unicode
else else
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd1,gpt7' | set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt | search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt
else else
search --no-floppy --fs-uuid --set=root 3b7d7caa-e926-49cc- search --no-floppy --fs-uuid --set=root 3b7d7caa-e926-49cc-
fi fi
font="/usr/share/grub2/unicode.pf2" font="/usr/share/grub2/unicode.pf2"
fi fi
if loadfont $font ; then if loadfont $font ; then
echo "Please press t to show the boot menu on this console" echo "Please press t to show the boot menu on this console"
set gfxmode=auto set gfxmode=auto
load_video load_video
insmod gfxterm insmod gfxterm
set locale_dir=$prefix/locale <
set lang=POSIX <
insmod gettext <
fi fi
terminal_output gfxterm terminal_output gfxterm
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd1,gpt7' | set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt | search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt
else else
search --no-floppy --fs-uuid --set=root 3b7d7caa-e926-49cc- search --no-floppy --fs-uuid --set=root 3b7d7caa-e926-49cc-
fi fi
insmod gfxmenu insmod gfxmenu
loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans-Bold14 loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans-Bold14
loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans10.pf2 loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans10.pf2
loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans12.pf2 loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans12.pf2
loadfont ($root)/boot/grub2/themes/openSUSE/ascii.pf2 loadfont ($root)/boot/grub2/themes/openSUSE/ascii.pf2
insmod png insmod png
set theme=($root)/boot/grub2/themes/openSUSE/theme.txt set theme=($root)/boot/grub2/themes/openSUSE/theme.txt
export theme export theme
if [ x${boot_once} = xtrue ]; then if [ x${boot_once} = xtrue ]; then
set timeout=0 set timeout=0
elif [ x$feature_timeout_style = xy ] ; then elif [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu set timeout_style=menu
set timeout=10 set timeout=10
# Fallback normal timeout code in case the timeout_style feat # Fallback normal timeout code in case the timeout_style feat
# unavailable. # unavailable.
else else
set timeout=10 set timeout=10
fi fi
### END /etc/grub.d/00_header ### ### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/00_tuned ### ### BEGIN /etc/grub.d/00_tuned ###
set tuned_params="" set tuned_params=""
set tuned_initrd="" set tuned_initrd=""
### END /etc/grub.d/00_tuned ### ### END /etc/grub.d/00_tuned ###
### BEGIN /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/10_linux ###
menuentry 'openSUSE Leap 15.1' --class opensuse --class gnu- menuentry 'openSUSE Leap 15.1' --class opensuse --class gnu-
load_video load_video
set gfxpayload=keep set gfxpayload=keep
insmod gzio insmod gzio
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd1,gpt7' | set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios | search --no-floppy --fs-uuid --set=root --hint-bios
else else
search --no-floppy --fs-uuid --set=root 3b7d7caa-e9 search --no-floppy --fs-uuid --set=root 3b7d7caa-e9
fi fi
echo 'Loading Linux 4.12.14-lp151.28.59-default .. echo 'Loading Linux 4.12.14-lp151.28.59-default ..
linuxefi /boot/vmlinuz-4.12.14-lp151.28.59-default ro | linuxefi /boot/vmlinuz-4.12.14-lp151.28.59-default ro
echo 'Loading initial ramdisk ...' echo 'Loading initial ramdisk ...'
initrdefi /boot/initrd-4.12.14-lp151.28.59-default initrdefi /boot/initrd-4.12.14-lp151.28.59-default
} }
submenu 'Advanced options for openSUSE Leap 15.1' --hotkey=1 submenu 'Advanced options for openSUSE Leap 15.1' --hotkey=1
menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1 menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1
load_video load_video
set gfxpayload=keep set gfxpayload=keep
insmod gzio insmod gzio
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd1,gpt7' | set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; t if [ x$feature_platform_search_hint = xy ]; t
search --no-floppy --fs-uuid --set=root --h | search --no-floppy --fs-uuid --set=root --h
else else
search --no-floppy --fs-uuid --set=root 3b7 search --no-floppy --fs-uuid --set=root 3b7
fi fi
echo 'Loading Linux 4.12.14-lp151.28.59-de echo 'Loading Linux 4.12.14-lp151.28.59-de
linuxefi /boot/vmlinuz-4.12.14-lp151.28.59-de | linuxefi /boot/vmlinuz-4.12.14-lp151.28.59-de
echo 'Loading initial ramdisk ...' echo 'Loading initial ramdisk ...'
initrdefi /boot/initrd-4.12.14-lp151.28.59-de initrdefi /boot/initrd-4.12.14-lp151.28.59-de
} }
menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1 menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1
load_video load_video
set gfxpayload=keep set gfxpayload=keep
insmod gzio insmod gzio
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd1,gpt7' | set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; t if [ x$feature_platform_search_hint = xy ]; t
search --no-floppy --fs-uuid --set=root --h | search --no-floppy --fs-uuid --set=root --h
else else
search --no-floppy --fs-uuid --set=root 3b7 search --no-floppy --fs-uuid --set=root 3b7
fi fi
echo 'Loading Linux 4.12.14-lp151.28.59-de echo 'Loading Linux 4.12.14-lp151.28.59-de
linuxefi /boot/vmlinuz-4.12.14-lp151.28.59-de | linuxefi /boot/vmlinuz-4.12.14-lp151.28.59-de
echo 'Loading initial ramdisk ...' echo 'Loading initial ramdisk ...'
initrdefi /boot/initrd-4.12.14-lp151.28.59-de initrdefi /boot/initrd-4.12.14-lp151.28.59-de
} }
menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1 menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1
load_video load_video
set gfxpayload=keep set gfxpayload=keep
insmod gzio insmod gzio
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd1,gpt7' | set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; t if [ x$feature_platform_search_hint = xy ]; t
search --no-floppy --fs-uuid --set=root --h | search --no-floppy --fs-uuid --set=root --h
else else
search --no-floppy --fs-uuid --set=root 3b7 search --no-floppy --fs-uuid --set=root 3b7
fi fi
echo 'Loading Linux 4.12.14-lp151.28.52-de echo 'Loading Linux 4.12.14-lp151.28.52-de
linuxefi /boot/vmlinuz-4.12.14-lp151.28.52-de | linuxefi /boot/vmlinuz-4.12.14-lp151.28.52-de
echo 'Loading initial ramdisk ...' echo 'Loading initial ramdisk ...'
initrdefi /boot/initrd-4.12.14-lp151.28.52-de initrdefi /boot/initrd-4.12.14-lp151.28.52-de
} }
menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1 menuentry 'openSUSE Leap 15.1, with Linux 4.12.14-lp1
load_video load_video
set gfxpayload=keep set gfxpayload=keep
insmod gzio insmod gzio
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set root='hd1,gpt7' | set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; t if [ x$feature_platform_search_hint = xy ]; t
search --no-floppy --fs-uuid --set=root --h | search --no-floppy --fs-uuid --set=root --h
else else
search --no-floppy --fs-uuid --set=root 3b7 search --no-floppy --fs-uuid --set=root 3b7
fi fi
echo 'Loading Linux 4.12.14-lp151.28.52-de echo 'Loading Linux 4.12.14-lp151.28.52-de
linuxefi /boot/vmlinuz-4.12.14-lp151.28.52-de | linuxefi /boot/vmlinuz-4.12.14-lp151.28.52-de
echo 'Loading initial ramdisk ...' echo 'Loading initial ramdisk ...'
initrdefi /boot/initrd-4.12.14-lp151.28.52-de initrdefi /boot/initrd-4.12.14-lp151.28.52-de
} }
} }
### END /etc/grub.d/10_linux ### ### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ### ### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ### ### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ### ### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ### ### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ### ### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sdb5)' --class windo | menuentry 'Windows Boot Manager (on /dev/sda5)' --class windo
insmod part_gpt insmod part_gpt
insmod fat insmod fat
set root='hd1,gpt5' | set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios | search --no-floppy --fs-uuid --set=root --hint-bios
else else
search --no-floppy --fs-uuid --set=root 200E-BDB8 search --no-floppy --fs-uuid --set=root 200E-BDB8
fi fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi chainloader /efi/Microsoft/Boot/bootmgfw.efi
} }
### END /etc/grub.d/30_os-prober ### ### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ### ### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. # This file provides an easy way to add custom menu entries.
# menu entries you want to add after this comment. Be carefu # menu entries you want to add after this comment. Be carefu
# the 'exec tail' line above. # the 'exec tail' line above.
### END /etc/grub.d/40_custom ### ### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ### ### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ];
source $prefix/custom.cfg; source $prefix/custom.cfg;
fi fi
### END /etc/grub.d/41_custom ### ### END /etc/grub.d/41_custom ###
### BEGIN /etc/grub.d/80_suse_btrfs_snapshot ### ### BEGIN /etc/grub.d/80_suse_btrfs_snapshot ###
### END /etc/grub.d/80_suse_btrfs_snapshot ### ### END /etc/grub.d/80_suse_btrfs_snapshot ###
### BEGIN /etc/grub.d/90_persistent ### ### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ### ### END /etc/grub.d/90_persistent ###
### BEGIN /etc/grub.d/95_textmode ### ### BEGIN /etc/grub.d/95_textmode ###
# On EFI systems we can only have graphics *or* serial, s # On EFI systems we can only have graphics *or* serial, s
# to switch between the two # to switch between the two
hiddenentry 'Text mode' --hotkey 't' { hiddenentry 'Text mode' --hotkey 't' {
set textmode=true set textmode=true
terminal_output console terminal_output console
} }
### END /etc/grub.d/95_textmode ### ### END /etc/grub.d/95_textmode ###
Note I used this in /etc/default/grub
Code:
# cat /etc/default/grub
# If you change this file, run 'grub2-mkconfig -o /boot/grub2/grub.cfg' afterwards to update
# /boot/grub2/grub.cfg.
# Uncomment to set your own custom distributor. If you leave it unset or empty, the default
# policy is to determine the value from /etc/os-release
GRUB_DISTRIBUTOR=
GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_CMDLINE_LINUX_DEFAULT="splash=silent quiet showopts"
GRUB_CMDLINE_LINUX=""
GRUB_DISABLE_LINUX_PARTUUID=false
GRUB_DISABLE_LINUX_UUID=true
# Uncomment to automatically save last booted menu entry in GRUB2 environment
# variable `saved_entry'
# GRUB_SAVEDEFAULT="true"
#Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
# GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
#Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL="gfxterm"
# The resolution used on graphical terminal
#note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE="auto"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
# GRUB_DISABLE_LINUX_UUID=true
#Uncomment to disable generation of recovery mode menu entries
# GRUB_DISABLE_LINUX_RECOVERY="true"
#Uncomment to get a beep at grub start
# GRUB_INIT_TUNE="480 440 1"
GRUB_BACKGROUND=
GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt
SUSE_BTRFS_SNAPSHOT_BOOTING="true"
GRUB_USE_LINUXEFI="true"
GRUB_DISABLE_OS_PROBER="false"
GRUB_ENABLE_CRYPTODISK="n"
GRUB_CMDLINE_XEN_DEFAULT="vga=gfx-1024x768x16"
Can I get a pointer ?
|
|
|
08-16-2020, 02:09 PM
|
#11
|
LQ Guru
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,522
|
If you wish life to be easier, don't mess with grub.cfg. It's designed for robots to use, not humans who lack eidetic memory. Instead, make use of /etc/default/grub, /etc/grub.d/*custom and /boot/grub2/custom.cfg. I move 40_custom to 06_custom and 41_custom to 07_custom, which moves the custom.cfg merged entries to the top of the Grub menu displayed at boot. Here's a redacted head of one of my custom.cfg files:
Code:
menuentry "memtest86 8.3 EFI" {
search --no-floppy --label --set=root P01ESP
chainloader /mt83x64.efi
}
menuentry "openSUSE TW defkernel 3 on P07" {
load_video
set gfxpayload=keep
search --no-floppy --set=root --hint-bios=hd0,gpt7 --label p07stw
linux /boot/vmlinuz root=LABEL=p07stw noresume mitigations=auto consoleblank=0 drm.debug=0x1e log_buf_len=1M pci=noaer 3
initrd /boot/initrd
}
menuentry "openSUSE 15.1 defkernel on P09" {
load_video
set gfxpayload=keep
search --no-floppy --set=root --hint-efi=hd0,gpt9 --label p09s151
linux /boot/vmlinuz root=LABEL=p09s151 noresume mitigations=auto consoleblank=0 pci=noaer 3
initrd /boot/initrd
}
menuentry "Debian 10 Buster defkernel 3 on P10" {
load_video
set gfxpayload=keep
search --no-floppy --set=root --hint-baremetal=ahci0,gpt10 --label p10deb10
linux /vmlinuz root=LABEL=p10deb10 noresume mitigations=auto consoleblank=0 pci=noaer 3
initrd /initrd.img
}
menuentry "openSUSE 15.2 defkernel on P11" {
load_video
set gfxpayload=keep
search --no-floppy --set=root --hint-efi=hd0,gpt11 --label p11s152
linux /boot/vmlinuz root=LABEL=p11s152 noresume mitigations=auto consoleblank=0 debug rd.debug pci=noaer 3
initrd /boot/initrd
}
Note how little each stanza is compared to auto-generated stanzas in grub.cfg. Mine have had the auto-generator's cruft fairly well excised. Each includes only what's actually needed to get the job done. Part of the redaction is the labels I use. I assign a short string to each disk based upon its make, model, and/or serial number and include it in every label. A significant part of the redaction is the tail entries, all of which are designed to initiate NET installation of a distro via previously downloaded installation kernel and initrd. Once Grub is present on a system, no installation media is required to install the better distros when using this method.
Here's a redacted portion of my openSUSE 15.2 fstab head:
Code:
#LABEL=P01ESP /boot/efi vfat noatime,codepage=437 0 0
LABEL=p02swap swap swap defaults 0 0
LABEL=p05home /home ext4 noatime 0 2
LABEL=p07stw /disks/stw ext4 noatime,nofail 0 0
LABEL=p10deb10 /distros/deb10 ext4 noatime,noauto 0 0
Booting and mounting by LABEL= (or /dev/disk/by-label=) simplifies the job of utilizing a clone, since the admin gets to assign human-memorable labels and readily retype them or use rather less copy/paste gyrations for the considerably shorter-than-UUID strings.
Once I've made the clone, first thing I do is relabel each filesystem to keep each unique, and adjust fstab and custom.cfg to match. To adjust, I use tune2fs, since I only use EXTx filesystems for Linux. Until the relabeling is done, I don't do any rebooting with both original and clone attached at the same time.
|
|
|
08-16-2020, 02:48 PM
|
#12
|
Member
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Original Poster
|
Thanks @mrmazda. If you check #10, I actually made changes in /etc/default/grub and generated the new grub.cfg file.  But your hints regarding /etc/grub.d/*custom looks interesting.
With ntfslabel, tune2fs and mlabel I think I can rename all partitions on the new drive and use them on the fstab on the new disk. But I have not fiddled with /etc/grub.d/*custom before, so I'll have to get my hands dirty.
Right now, I have stopped fiddling and will attempt again sometime in midweek. Perfect time to read up and make plans.
|
|
|
08-21-2020, 11:04 PM
|
#13
|
Member
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Original Poster
|
Labels are fixed. Linux clone boots fine now. The cloned windows is having problems. (Thanks for nothing, M$). I am trying to troubleshoot that on my own.
|
|
|
01-13-2021, 08:58 AM
|
#14
|
Member
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Original Poster
|
Closure:
In my test, Windows or linux could be cloned successfully to the newer ssd (as standalone OS), but when done together (disk copy/clone), windows became unbootable. But it still was a good use case to test my 15.1 upgrade to 15.2 "with all repos intact" theory.
in the end I did what many people had already advised me to do - fresh OS install on the new disk.
Many thanks for your patient assistance.
|
|
|
08-09-2021, 01:30 PM
|
#15
|
LQ Newbie
Registered: Aug 2021
Posts: 2
Rep: 
|
dual boot clone windows and linux
I just did this procedure after several days of failed attempts and endless futile googles so I thought I'd post my successful method.
I had a 250 GB SSD on my laptop with dual boot Windows 10 and Unbuntu studio 20.04. Both Operating systems were up to date. My goal was to clone this SSD to a 500 SSD so both Operating Systems would have more space. My Source disk had 4 partitions - 3 Primary and one Logical Volume.
My problem was if I used Macrium Reflect in Windows, My Unbuntu wouldn't boot up (didn't like the Logical Volume Partition), and if I used Clonezilla, my Windows wouldn't boot up (don't know what clonezillas problem was and couldn't solve it with google). So my solution was to use both.
Make a USB boot stick for Clonezilla as it needs the source and target drives to be offline. (lots of information on clonezilla out there, google it).
Using Clonezilla, clone the entire source disk to the target disk. I let clonezilla resize partitions proportionately, but I believe you can set exact size parameters within clonezilla. I really only cared about the logical volume as I was going to overwrite the 3 Primary partitions with Macrium and just wanted it to set up in the right order on the disk with about the right size (Logical volume was 4th in line and was expanded to 200 GB). Maybe for you, this works (it was supposed to), but if your Windows won't boot properly.....keep reading.
I happen to have 2 USB external hard drive enclosures, and a PC with macrium already installed, so I pulled the SSD out of my laptop and and installed it in the 2nd external enclosue, but I believe you could do this with the source disk Live in your pc/laptop and windows up and running macrium on it, I just didn't have to.
Start Macrium reflect and select the source disk (the original disk you want to clone) and select 'clone this disk"
Select the Target disk (the new disk you want to clone to)
Delete the 3 primary partitions on the TARGET disk (yes, the partitions you just copied from the source disk with clonezilla) (MAKE SURE YOU ARE WORKING WITH THE RIGHT DISK.!!!). This will leave unallocated space on the left side of the Logical volume partition. Primary and logical partitions are clearly labeled and colour coded on Macrium so this is easy.
You want to bring in individual partitions to clone,. So Drag and drop the first partition (closest to left) from source to target. highlight the partition on the target and you will see an option below to manipulate the "partition properties". Here you can adjust the partition size to what you want on the new disk. You can only shrink/expand partitions on the right end of the partition so you have to do it before dropping in the next one.
Do the same for each of the remaining partitions. . Keep the partition order the same for both source and target disks.
When it looks right, follow the instructions to start the backup process
This worked for me. Someone smarter than me can probably slim this down, figuring out which of the 3 primary partitions Clonezilla was messing up, but this worked and now I need to move on.
Hope it works for you. 
Last edited by cj11; 08-09-2021 at 02:24 PM.
|
|
|
All times are GMT -5. The time now is 03:09 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
|
|