Partition Strategy for External HDD for Linux/Windows?
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Partition Strategy for External HDD for Linux/Windows?
Hi Everyone,
I've recently bought a 500 GB Notebook Hard Drive and a USB 3/SATA III Enclosure for it.
I want to backup Windows System Images to an NTFS partition and I want to be able to have multiple EXT4 partitions and a SWAP partition for booting Linux Distros on a GPT/UEFI Laptop with Secure Boot disabled.
It looks like I should be able to do all this with GParted.
I just need logically ordered instructions to follow.
In which order should the partitions be made?
How do I make the Hard Drive bootable for the EXT4 partitions?
Does this require a /boot/efi partition as I see on the Internal Hard Drive?
What about partitions for testing the Live ISO of a distro before installing to another partition?
Thanks, Michael.
I've recently bought a 500 GB Notebook Hard Drive and a USB 3/SATA III Enclosure for it.
I want to backup Windows System Images to an NTFS partition and I want to be able to have multiple EXT4 partitions and a SWAP partition for booting Linux Distros on a GPT/UEFI Laptop with Secure Boot disabled.
It looks like I should be able to do all this with GParted.
I just need logically ordered instructions to follow.
In which order should the partitions be made?
How do I make the Hard Drive bootable for the EXT4 partitions?
Does this require a /boot/efi partition as I see on the Internal Hard Drive?
What about partitions for testing the Live ISO of a distro before installing to another partition?
Thanks, Michael.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Partition Strategy for External HDD for Linux/Windows?
My 250Gb sata hdd is in a ext Enclosure.
it's partitioned as ~160GB NTFS / ~80GB ext3.
- M$ will see only the NTFS partition, whereas Linux will see both partitions. ..
it was partitioned off with Gparted.
- the back end of the existing partition was shrunk back,
and the ext3 partition was then created in the vacant space.
- it shouldn't need a /boot/efi partition.
"What about partitions for testing the Live ISO of a distro before installing to another partition?"
- best testing any Live ISOs in a VB
it's partitioned as ~160GB NTFS / ~80GB ext3.
- M$ will see only the NTFS partition, whereas Linux will see both partitions. ..
it was partitioned off with Gparted.
- the back end of the existing partition was shrunk back,
and the ext3 partition was then created in the vacant space.
- it shouldn't need a /boot/efi partition.
"What about partitions for testing the Live ISO of a distro before installing to another partition?"
- best testing any Live ISOs in a VB
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
Re: Partition Strategy for External HDD for Linux/Windows?
Wouldn't a /boot/efi partition be needed for booting from multiple distros installed on the hard drive?Pierre wrote:- it shouldn't need a /boot/efi partition.
Wouldn't a bootloader be required to enable you to select which distro to boot?
Thanks, Michael.
- austin.texas
- Level 20
- Posts: 12003
- Joined: Tue Nov 17, 2009 3:57 pm
- Location: at /home
Re: Partition Strategy for External HDD for Linux/Windows?
Since you want to boot various versions of linux, you have to decide if you want the installations to be UEFI or non-UEFI.
If you are going with UEFI, use gparted to create a GPT partition table. The first partition you create will be the ESP (EFI System partition), 300MB to 500MB, FAT32, boot flag. Then create your 20GB partitions for installation of various flavors of linux. Then your NTFS partition you need, and a swap partition (you only need one).
Linux on UEFI: A Quick Installation Guide
http://www.rodsbooks.com/linux-uefi/
If you are going with UEFI, use gparted to create a GPT partition table. The first partition you create will be the ESP (EFI System partition), 300MB to 500MB, FAT32, boot flag. Then create your 20GB partitions for installation of various flavors of linux. Then your NTFS partition you need, and a swap partition (you only need one).
Linux on UEFI: A Quick Installation Guide
http://www.rodsbooks.com/linux-uefi/
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
Linux Linx 2018
- austin.texas
- Level 20
- Posts: 12003
- Joined: Tue Nov 17, 2009 3:57 pm
- Location: at /home
Re: Partition Strategy for External HDD for Linux/Windows?
Testing of live .isos is not done on a partition, usually. The normal way to test a distro is to burn a DVD or create a usb drive.mtbvfr wrote:What about partitions for testing the Live ISO of a distro before installing to another partition?
If you really want to use a partition to test .iso files without burning a DVD, here is how you do that.
Boot into Mint (installed on your drive) and install the grml-rescueboot program.
sudo apt-get install grml-rescueboot
Then make sure that the /boot/grml folder exists. If it does not exist, create it with the command.
sudo mkdir /boot/grml
Place your Mint ISO in the /boot/grml folder.
For example, if the ISO is located in the user's Downloads folder, the command would be:
sudo cp ~/Downloads/Mintfilename.iso /boot/grml/
Update GRUB
sudo update-grub
This automatically adds a menuentry to the GRUB menu for any ISO files located in the /boot/grml folder.
The created menuentry, when selected, provides submenu options on how to boot the ISO, including the "Try Mint" and "Install" options.
Now reboot, and choose the iso menuentry, and it will run just like booting the live DVD.
http://wiki.grml.org/doku.php?id=rescueboot
grml-rescueboot does not support lvm and md/raid devices
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
Linux Linx 2018
Re: Partition Strategy for External HDD for Linux/Windows?
Hi Folks,
Just getting back to this. Unfortunately, things haven't gone as smoothly as hoped for.
So, I created a GPT partition table and then I created the following partitions.
EFI System partition.
SWAP partition.
Linux OS partition No. 1.
Linux OS partition No. 2.
Linux OS partition No. 3.
Linux OS partition No. 4.
Linux Data partition.
Windows Data partition.
I installed Linux Mint 17 Cinnamon on the Linux1 partition and chose the External Hard Drive as the Device for the Bootloader Installation.
I shutdown the Laptop.
Next, I started the Laptop. I did not do a Restart after the installation finished because I needed to remove the Live USB Flash Drive that I used for the installation.
When GRUB was started I was given the following options:
Linux Mint 17
Linux Mint 17 (Recovery Mode)
Windows Bootloader
Linux Mint 16
Linux Mint 16 (Advanced options)
System Setup
I chose the First option. However, at that point, I didn't know if the GRUB Menu had been activated from the External Drive or the Internal Drive.
I now have an "ubuntu" Boot item, in the Startup options of my UEFI BIOS, which I don't recall seeing before but it must have been there because there is an /boot/efi/EFI/ubuntu folder on the Internal Hard Drive on the partition where Linux Mint 16 was installed. This folder has a date of 19/5/2014 which is around when I installed Mint 16. However, the files it contains are all dated with today's date (5/9/2014). These files are the following.
grub.cfg
grubx64.efi
MokManager.efi
shimx64.efi
The above grub.cfg file contains the following:
The above indicates that it is referencing the new grub.cfg file located in the /boot/grub folder on the Linux1 parition for the Mint 17 installation.
The new grub.cfg file contains the following which correlates with the options I detailed above:
Prior to this installation, when the Laptop was started, Grub would give me the the following options.
Linux Mint 16
Linux Mint 16 (Recovery Mode)
Windows Bootloader
System Setup
If the External Drive is not connected when the Laptop is started the following is displayed on the screen.
From this I conclude that the "ubuntu" item, in the UEFI BIOS Startup Boot options, is looking for the grub.cfg file, that I found residing in the /boot/grub folder of the Linux1 partition, which is pointed to by the grub.cfg file in the /boot/efi/EFI/ubuntu folder of the partition that Mint 16 was installed on.
I want the Hard Drives to each use their own GRUB configuration so that installations on either drive do not affect installations on the other.
And OOPS, I just realised I forgot to set the Boot Flag on the EFI System partition on the External Hard Drive. Would this have caused the grub.cfg file, in the /boot/efi/EFI/ubuntu folder, to be modified to point to the grub.cfg file in the /boot/grub folder of the Linux1 partition?
The EFI System Partition, on the External hard drive appears to have not been used at all during this saga.
I can easily wipe the Linux1 partition to prepare that for another installation attempt.
I have found another grub.cfg file in the /boot/grub folder on the Mint 16 partition on the Internal hard drive. This contains the options that I was previously seeing when the Laptop was started.
So, how do I "reset" the grub.cfg files? What is the correct way?
Do I edit the grub.cfg file, in the /boot/efi/EFI/ubuntu folder on the Mint 16 partition on the Internal hard drive, to point to the grub.cfg file in the /boot/grub folder on the same partition?.
The Mint 16 partition has a uuid of "75ff7f3e-b55a-cf01-60ed-3d3eb55acf01". Do I simply use that to replace the uuid (c196a72e-4ff3-406c-a236-0ddc774a5ec0), of the Linux1 partition, in the grub.cfg file, in the /boot/efi/EFI/ubuntu folder?
Do I also need to change "hd1,gpt3" to "hd0,gpt5"?
Thanks, Michael.
Just getting back to this. Unfortunately, things haven't gone as smoothly as hoped for.
So, I created a GPT partition table and then I created the following partitions.
EFI System partition.
Code: Select all
Free space preceeding (MiB): 1
New size(MiB): 500
Free space following (MiB): 476439
Align to: MiB
Create as: Primary Partition
File system: fat32
Label: BootEfi
Code: Select all
Free space preceeding (MiB): 0
New size(MiB): 9536
Free space following (MiB): 466903
Align to: MiB
Create as: Primary Partition
File system: linux-swap
Label: SWAP
Code: Select all
Free space preceeding (MiB): 0
New size(MiB): 19073
Free space following (MiB): 447830
Align to: MiB
Create as: Primary Partition
File system: ext4
Label: Linux1
Code: Select all
Free space preceeding (MiB): 0
New size(MiB): 19073
Free space following (MiB): 428757
Align to: MiB
Create as: Primary Partition
File system: ext4
Label: Linux2
Code: Select all
Free space preceeding (MiB): 0
New size(MiB): 19073
Free space following (MiB): 409684
Align to: MiB
Create as: Primary Partition
File system: ext4
Label: Linux3
Code: Select all
Free space preceeding (MiB): 0
New size(MiB): 19073
Free space following (MiB): 390611
Align to: MiB
Create as: Primary Partition
File system: ext4
Label: Linux4
Code: Select all
Free space preceeding (MiB): 0
New size(MiB): 294685
Free space following (MiB): 95926
Align to: MiB
Create as: Primary Partition
File system: ext4
Label: LinuxDataExt
Code: Select all
Free space preceeding (MiB): 0
New size(MiB): 95926
Free space following (MiB): 0
Align to: MiB
Create as: Primary Partition
File system: ntfs
Label: WinDataExt
I shutdown the Laptop.
Next, I started the Laptop. I did not do a Restart after the installation finished because I needed to remove the Live USB Flash Drive that I used for the installation.
When GRUB was started I was given the following options:
Linux Mint 17
Linux Mint 17 (Recovery Mode)
Windows Bootloader
Linux Mint 16
Linux Mint 16 (Advanced options)
System Setup
I chose the First option. However, at that point, I didn't know if the GRUB Menu had been activated from the External Drive or the Internal Drive.
I now have an "ubuntu" Boot item, in the Startup options of my UEFI BIOS, which I don't recall seeing before but it must have been there because there is an /boot/efi/EFI/ubuntu folder on the Internal Hard Drive on the partition where Linux Mint 16 was installed. This folder has a date of 19/5/2014 which is around when I installed Mint 16. However, the files it contains are all dated with today's date (5/9/2014). These files are the following.
grub.cfg
grubx64.efi
MokManager.efi
shimx64.efi
The above grub.cfg file contains the following:
Code: Select all
search.fs_uuid c196a72e-4ff3-406c-a236-0ddc774a5ec0 root hd1,gpt3
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
The new grub.cfg file contains the following which correlates with the options I detailed above:
Code: Select all
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 c196a72e-4ff3-406c-a236-0ddc774a5ec0
else
search --no-floppy --fs-uuid --set=root c196a72e-4ff3-406c-a236-0ddc774a5ec0
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=-1
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=10
fi
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/06_mint_theme ###
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
### END /etc/grub.d/06_mint_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="$1"
if [ "$1" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Linux Mint 17 Cinnamon 64-bit, 3.13.0-24-generic (/dev/sdb3)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 c196a72e-4ff3-406c-a236-0ddc774a5ec0
else
search --no-floppy --fs-uuid --set=root c196a72e-4ff3-406c-a236-0ddc774a5ec0
fi
linux /boot/vmlinuz-3.13.0-24-generic root=UUID=c196a72e-4ff3-406c-a236-0ddc774a5ec0 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.13.0-24-generic
}
menuentry 'Linux Mint 17 Cinnamon 64-bit, 3.13.0-24-generic (/dev/sdb3) -- recovery mode' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_gpt
insmod ext2
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 c196a72e-4ff3-406c-a236-0ddc774a5ec0
else
search --no-floppy --fs-uuid --set=root c196a72e-4ff3-406c-a236-0ddc774a5ec0
fi
echo 'Loading Linux 3.13.0-24-generic ...'
linux /boot/vmlinuz-3.13.0-24-generic root=UUID=c196a72e-4ff3-406c-a236-0ddc774a5ec0 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.13.0-24-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-C8D6-383E' {
insmod part_gpt
insmod fat
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 C8D6-383E
else
search --no-floppy --fs-uuid --set=root C8D6-383E
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry 'Linux Mint 16 Petra (16) (on /dev/sda5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-75ff7f3e-b55a-cf01-60ed-3d3eb55acf01' {
insmod part_gpt
insmod ext2
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5 75ff7f3e-b55a-cf01-60ed-3d3eb55acf01
else
search --no-floppy --fs-uuid --set=root 75ff7f3e-b55a-cf01-60ed-3d3eb55acf01
fi
linux /boot/vmlinuz-3.11.0-12-generic root=UUID=75ff7f3e-b55a-cf01-60ed-3d3eb55acf01 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.11.0-12-generic
}
submenu 'Advanced options for Linux Mint 16 Petra (16) (on /dev/sda5)' $menuentry_id_option 'osprober-gnulinux-advanced-75ff7f3e-b55a-cf01-60ed-3d3eb55acf01' {
menuentry 'Linux Mint 16 KDE 64-bit, 3.11.0-12-generic (/dev/sda5) (on /dev/sda5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.11.0-12-generic--75ff7f3e-b55a-cf01-60ed-3d3eb55acf01' {
insmod part_gpt
insmod ext2
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5 75ff7f3e-b55a-cf01-60ed-3d3eb55acf01
else
search --no-floppy --fs-uuid --set=root 75ff7f3e-b55a-cf01-60ed-3d3eb55acf01
fi
linux /boot/vmlinuz-3.11.0-12-generic root=UUID=75ff7f3e-b55a-cf01-60ed-3d3eb55acf01 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.11.0-12-generic
}
menuentry 'Linux Mint 16 KDE 64-bit, 3.11.0-12-generic (/dev/sda5) -- recovery mode (on /dev/sda5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.11.0-12-generic-root=UUID=75ff7f3e-b55a-cf01-60ed-3d3eb55acf01 ro recovery nomodeset-75ff7f3e-b55a-cf01-60ed-3d3eb55acf01' {
insmod part_gpt
insmod ext2
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5 75ff7f3e-b55a-cf01-60ed-3d3eb55acf01
else
search --no-floppy --fs-uuid --set=root 75ff7f3e-b55a-cf01-60ed-3d3eb55acf01
fi
linux /boot/vmlinuz-3.11.0-12-generic root=UUID=75ff7f3e-b55a-cf01-60ed-3d3eb55acf01 ro recovery nomodeset
initrd /boot/initrd.img-3.11.0-12-generic
}
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
set timeout=10
fi
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Linux Mint 16
Linux Mint 16 (Recovery Mode)
Windows Bootloader
System Setup
If the External Drive is not connected when the Laptop is started the following is displayed on the screen.
Code: Select all
GNU GRUB version 2.02~beta2-9ubuntu1
Minimal BASH-like line editing is supported. for the first word, TAB lists possible command completions. Anywhere else TAB lists possible device or file completions.
grub>
I want the Hard Drives to each use their own GRUB configuration so that installations on either drive do not affect installations on the other.
And OOPS, I just realised I forgot to set the Boot Flag on the EFI System partition on the External Hard Drive. Would this have caused the grub.cfg file, in the /boot/efi/EFI/ubuntu folder, to be modified to point to the grub.cfg file in the /boot/grub folder of the Linux1 partition?
The EFI System Partition, on the External hard drive appears to have not been used at all during this saga.
I can easily wipe the Linux1 partition to prepare that for another installation attempt.
I have found another grub.cfg file in the /boot/grub folder on the Mint 16 partition on the Internal hard drive. This contains the options that I was previously seeing when the Laptop was started.
Code: Select all
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5 75ff7f3e-b55a-cf01-60ed-3d3eb55acf01
else
search --no-floppy --fs-uuid --set=root 75ff7f3e-b55a-cf01-60ed-3d3eb55acf01
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 0,0,0; then
clear
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/06_mint_theme ###
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
### END /etc/grub.d/06_mint_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="$1"
if [ "$1" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Linux Mint 16 KDE 64-bit, 3.11.0-12-generic (/dev/sda5)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5 75ff7f3e-b55a-cf01-60ed-3d3eb55acf01
else
search --no-floppy --fs-uuid --set=root 75ff7f3e-b55a-cf01-60ed-3d3eb55acf01
fi
linux /boot/vmlinuz-3.11.0-12-generic root=UUID=75ff7f3e-b55a-cf01-60ed-3d3eb55acf01 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.11.0-12-generic
}
menuentry 'Linux Mint 16 KDE 64-bit, 3.11.0-12-generic (/dev/sda5) -- recovery mode' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5 75ff7f3e-b55a-cf01-60ed-3d3eb55acf01
else
search --no-floppy --fs-uuid --set=root 75ff7f3e-b55a-cf01-60ed-3d3eb55acf01
fi
echo 'Loading Linux 3.11.0-12-generic ...'
linux /boot/vmlinuz-3.11.0-12-generic root=UUID=75ff7f3e-b55a-cf01-60ed-3d3eb55acf01 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.11.0-12-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Boot Manager (UEFI on /dev/sda2)" --class windows --class os {
insmod part_gpt
insmod fat
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 C8D6-383E
else
search --no-floppy --fs-uuid --set=root C8D6-383E
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Do I edit the grub.cfg file, in the /boot/efi/EFI/ubuntu folder on the Mint 16 partition on the Internal hard drive, to point to the grub.cfg file in the /boot/grub folder on the same partition?.
The Mint 16 partition has a uuid of "75ff7f3e-b55a-cf01-60ed-3d3eb55acf01". Do I simply use that to replace the uuid (c196a72e-4ff3-406c-a236-0ddc774a5ec0), of the Linux1 partition, in the grub.cfg file, in the /boot/efi/EFI/ubuntu folder?
Do I also need to change "hd1,gpt3" to "hd0,gpt5"?
Thanks, Michael.
Re: Partition Strategy for External HDD for Linux/Windows?
Thanks for this tip! Still very much a Linux noobie here.austin.texas wrote:If you really want to use a partition to test .iso files without burning a DVD, here is how you do that.
Boot into Mint (installed on your drive) and install the grml-rescueboot program.
sudo apt-get install grml-rescueboot
Then make sure that the /boot/grml folder exists. If it does not exist, create it with the command.
sudo mkdir /boot/grml
Place your Mint ISO in the /boot/grml folder.
For example, if the ISO is located in the user's Downloads folder, the command would be:
sudo cp ~/Downloads/Mintfilename.iso /boot/grml/
Update GRUB
sudo update-grub
This automatically adds a menuentry to the GRUB menu for any ISO files located in the /boot/grml folder.
The created menuentry, when selected, provides submenu options on how to boot the ISO, including the "Try Mint" and "Install" options.
Now reboot, and choose the iso menuentry, and it will run just like booting the live DVD.
http://wiki.grml.org/doku.php?id=rescueboot
grml-rescueboot does not support lvm and md/raid devices
I will give it a go sometime after I've got the latest drama (see above) solved.
Hasta pronto, Michael.
- austin.texas
- Level 20
- Posts: 12003
- Joined: Tue Nov 17, 2009 3:57 pm
- Location: at /home
Re: Partition Strategy for External HDD for Linux/Windows?
I believe you have diagnosed the problem correctly.mtbvfr wrote: I just realised I forgot to set the Boot Flag on the EFI System partition on the External Hard Drive. Would this have caused the grub.cfg file, in the /boot/efi/EFI/ubuntu folder, to be modified to point to the grub.cfg file in the /boot/grub folder of the Linux1 partition?
The EFI System Partition, on the External hard drive appears to have not been used at all during this saga.
I can easily wipe the Linux1 partition to prepare that for another installation attempt.
Is it possible to disable the internal drive, and then reinstall Mint 17 to the external drive? (After you set the boot flag, of course.)
Then when you have that successfully booting, re-connect the internal drive, boot into Mint 17 and run sudo update-grub which should put both Windows and Mint 16 on the GRUB menu.
If you can then boot into Mint 16, run the sudo update-grub from there to put Mint 17 on that GRUB menu (the internal drive).
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
Linux Linx 2018
Re: Partition Strategy for External HDD for Linux/Windows?
I don't have the inclination, nor the time at present, to mess about with the removal of the internal drive.austin.texas wrote:I believe you have diagnosed the problem correctly.
Is it possible to disable the internal drive, and then reinstall Mint 17 to the external drive? (After you set the boot flag, of course.)
Then when you have that successfully booting, re-connect the internal drive, boot into Mint 17 and run sudo update-grub which should put both Windows and Mint 16 on the GRUB menu.
If you can then boot into Mint 16, run the sudo update-grub from there to put Mint 17 on that GRUB menu (the internal drive).
Both Windows and Mint 16 are already on the GRUB menu as they were before I "installed" Mint 17. You can see this in the 2 listings in my previous post above. The second of these listings represents what I was seeing when the Laptop was booting before the installation of Mint 17 to the External Hard Drive.
I want the Hard Drives to each use their own GRUB configuration so that installations on either drive do not affect installations on the other.
Can I edit the grub.cfg file, in the /boot/efi/EFI/ubuntu folder on the Mint 16 partition on the Internal hard drive, to point to the grub.cfg file in the /boot/grub folder on the same partition?
The Mint 16 partition has a uuid of "75ff7f3e-b55a-cf01-60ed-3d3eb55acf01". Do I simply use that to replace the uuid (c196a72e-4ff3-406c-a236-0ddc774a5ec0), of the Linux1 partition, in the grub.cfg file, in the /boot/efi/EFI/ubuntu folder?
Do I also need to change "hd1,gpt3" to "hd0,gpt5"?
If I can simply edit /boot/efi/EFI/ubuntu/grub.cfg, then, I hope to be able to do the following.
Erase the contents of the Linux1 partition, set the Boot Flag on the on the EFI System partition and then reinstall Mint 17 to the Linux1 partition.
Thanks, Michael.
- austin.texas
- Level 20
- Posts: 12003
- Joined: Tue Nov 17, 2009 3:57 pm
- Location: at /home
Re: Partition Strategy for External HDD for Linux/Windows?
The command sudo update-grub does all that for you.mtbvfr wrote:Can I edit the grub.cfg file, in the /boot/efi/EFI/ubuntu folder on the Mint 16 partition on the Internal hard drive, to point to the grub.cfg file in the /boot/grub folder on the same partition?
The Mint 16 partition has a uuid of "75ff7f3e-b55a-cf01-60ed-3d3eb55acf01". Do I simply use that to replace the uuid (c196a72e-4ff3-406c-a236-0ddc774a5ec0), of the Linux1 partition, in the grub.cfg file, in the /boot/efi/EFI/ubuntu folder?
Do I also need to change "hd1,gpt3" to "hd0,gpt5"?
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
Linux Linx 2018
Re: Partition Strategy for External HDD for Linux/Windows?
I dismounted the External Hard Drive and entered "sudo update-grub" in the Terminal but nothing changed in the /boot/efi/EFI/ubuntu/grub.cfg file.austin.texas wrote:The command sudo update-grub does all that for you.mtbvfr wrote:Can I edit the grub.cfg file, in the /boot/efi/EFI/ubuntu folder on the Mint 16 partition on the Internal hard drive, to point to the grub.cfg file in the /boot/grub folder on the same partition?
The Mint 16 partition has a uuid of "75ff7f3e-b55a-cf01-60ed-3d3eb55acf01". Do I simply use that to replace the uuid (c196a72e-4ff3-406c-a236-0ddc774a5ec0), of the Linux1 partition, in the grub.cfg file, in the /boot/efi/EFI/ubuntu folder?
Do I also need to change "hd1,gpt3" to "hd0,gpt5"?
- austin.texas
- Level 20
- Posts: 12003
- Joined: Tue Nov 17, 2009 3:57 pm
- Location: at /home
Re: Partition Strategy for External HDD for Linux/Windows?
What ???mtbvfr wrote:[I dismounted the External Hard Drive and entered "sudo update-grub" in the Terminal but nothing changed in the /boot/efi/EFI/ubuntu/grub.cfg file.
If you want Mint 17 on the external drive to appear on the internal drive's GRUB menu, how is that going to happen if the external drive is dismounted?
Connect both drives, boot into Mint 17 and run sudo update-grub which should put both Windows and Mint 16 on the GRUB menu.
That should fix the external drive's GRUB menu.
Then boot into Mint 16, run the sudo update-grub from there to put Mint 17 on that GRUB menu (the internal drive).
That will fix up the internal drive's GRUB menu.
If there is a problem with the external drive's GRUB then, it will be because the initial install was faulty, and still needs some tweaking. Try this first, and see.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
Linux Linx 2018
Re: Partition Strategy for External HDD for Linux/Windows?
Both Windows and Mint 16 are already on the GRUB menu.austin.texas wrote:What ???
If you want Mint 17 on the external drive to appear on the internal drive's GRUB menu, how is that going to happen if the external drive is dismounted?
Connect both drives, boot into Mint 17 and run sudo update-grub which should put both Windows and Mint 16 on the GRUB menu.
That should fix the external drive's GRUB menu.
Then boot into Mint 16, run the sudo update-grub from there to put Mint 17 on that GRUB menu (the internal drive).
That will fix up the internal drive's GRUB menu.
If there is a problem with the external drive's GRUB then, it will be because the initial install was faulty, and still needs some tweaking. Try this first, and see.
The problem is as follows.
If the External Hard Drive is not connected when the Laptop is booted then the following is shown on the screen (there are no Boot options to choose from).
Code: Select all
GNU GRUB version 2.02~beta2-9ubuntu1
Minimal BASH-like line editing is supported. for the first word, TAB lists possible command completions. Anywhere else TAB lists possible device or file completions.
grub>
Code: Select all
Linux Mint 16
Linux Mint 16 (Recovery Mode)
Windows Bootloader
System Setup
Code: Select all
Linux Mint 17
Linux Mint 17 (Recovery Mode)
Windows Bootloader
Linux Mint 16
Linux Mint 16 (Advanced options)
System Setup
Code: Select all
Linux Mint 16
Linux Mint 16 (Recovery Mode)
Windows Bootloader
System Setup
Should the grub.cfg file, in the /boot/efi/EFI/ubuntu folder, be edited as I suggested or should this file be replaced with the grub.cfg file in the /boot/grub folder on the Mint 16 partition?
What would have been the original configuration for Mint 16 regarding the grub.cfg file? Would there have only been one grub.cfg file? If so, would it have been residing in the /boot/efi/EFI/ubuntu folder?
Thanks, Michael.
- austin.texas
- Level 20
- Posts: 12003
- Joined: Tue Nov 17, 2009 3:57 pm
- Location: at /home
Re: Partition Strategy for External HDD for Linux/Windows?
Sorry sudo update-grub did not work for you.
You can try manually editing, or try the rEFInd boot manager - http://www.rodsbooks.com/efi-bootloaders/refind.html
You can try manually editing, or try the rEFInd boot manager - http://www.rodsbooks.com/efi-bootloaders/refind.html
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
Linux Linx 2018