You are not logged in.

#1 2023-12-27 13:18:55

cdwijs
Member
Registered: 2010-04-24
Posts: 289

problems installing grub to create dual boot windows 7 / Arch linux

I'm trying to install grub, and dual boot Windows 7 / Arch Linux.

I used ventoy to boot the Arch linux iso, and it looks like I'm booted in UEFI-64 bit mode. I have chrooted into the target partition.

[root@archiso /]# cat /sys/firmware/efi/fw_platform_size
64

This is my partition table:

[root@archiso /]# fdisk /dev/sda
Disk /dev/sda: 298.09 GiB, 320072933376 bytes, 625142448 sectors
Disk model: Hitachi HTS54323
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbea0366b

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048  31459327  31457280    15G 27 Hidden NTFS WinRE
/dev/sda2  *     31459328  31664127    204800   100M  7 HPFS/NTFS/exFAT
/dev/sda3        31664128 420341759 388677632 185.3G  7 HPFS/NTFS/exFAT
/dev/sda4       420341760 625142447 204800688  97.7G  5 Extended
/dev/sda5       420343808 421392383   1048576   512M  7 HPFS/NTFS/exFAT
/dev/sda6       421394432 625142447 203748016  97.2G 83 Linux

sda1,2,3 are made by the Windows 7 installer. I've made sda3 smaller, and then added sda4,5,6
I've mounted sda5 to /boot and sda2 to /esp

[root@archiso /]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda6        98G  2.2G   94G   3% /
efivarfs         92K   59K   29K  68% /sys/firmware/efi/efivars
udev            2.8G     0  2.8G   0% /dev
shm             2.9G     0  2.9G   0% /dev/shm
run             2.9G     0  2.9G   0% /run
tmp             2.9G     0  2.9G   0% /tmp
run             2.9G  9.3M  2.9G   1% /etc/resolv.conf
/dev/sda5       511M  110M  402M  22% /boot
/dev/sda2       100M   26M   75M  26% /esp

/esp contains these files:

[root@archiso /]# ls /esp/
 Boot  'System Volume Information'   bootmgr
[root@archiso /]# ls /esp/Boot/
BCD	 BCD.LOG1  BOOTSTAT.DAT  cs-CZ	de-DE  en-US  fi-FI  hu-HU  ja-JP  memtest.exe	nl-NL  pt-BR  ru-RU  tr-TR  zh-HK
BCD.LOG  BCD.LOG2  Fonts	 da-DK	el-GR  es-ES  fr-FR  it-IT  ko-KR  nb-NO	pl-PL  pt-PT  sv-SE  zh-CN  zh-TW

/boot contains these files:

# find /boot
/boot
/boot/vmlinuz-linux
/boot/initramfs-linux.img
/boot/initramfs-linux-fallback.img
/boot/grub
/boot/grub/x86_64-efi
/boot/grub/x86_64-efi/acpi.mod
<snip>
/boot/grub/x86_64-efi/zstd.mod
/boot/grub/x86_64-efi/moddep.lst
/boot/grub/x86_64-efi/command.lst
/boot/grub/x86_64-efi/fs.lst
/boot/grub/x86_64-efi/partmap.lst
/boot/grub/x86_64-efi/parttool.lst
/boot/grub/x86_64-efi/video.lst
/boot/grub/x86_64-efi/crypto.lst
/boot/grub/x86_64-efi/terminal.lst
/boot/grub/x86_64-efi/modinfo.sh
/boot/grub/x86_64-efi/core.efi
/boot/grub/x86_64-efi/grub.efi
/boot/grub/locale
/boot/grub/locale/ca.mo
<snip>
/boot/grub/locale/en@piglatin.mo
/boot/grub/themes
/boot/grub/themes/starfield
<snip>
/boot/grub/themes/starfield/theme.txt
/boot/grub/fonts
/boot/grub/fonts/unicode.pf2
/boot/grub/grubenv
/boot/grub/grub.cfg
/boot/EFI
/boot/EFI/GRUB
/boot/EFI/GRUB/grubx64.efi
/boot/EFI/arch_grub
/boot/EFI/arch_grub/grubx64.efi
/boot/$RECYCLE.BIN
/boot/$RECYCLE.BIN/desktop.ini

reinstall grub and efibootmgr

# pacman -S grub efibootmgr
warning: grub-2:2.12-1 is up to date -- reinstalling
warning: efibootmgr-18-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (2) efibootmgr-18-2  grub-2:2.12-1

Total Installed Size:  33.65 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] 
(2/2) checking keys in keyring                                                                                       [######################################################################] 100%
(2/2) checking package integrity                                                                                     [######################################################################] 100%
(2/2) loading package files                                                                                          [######################################################################] 100%
(2/2) checking for file conflicts                                                                                    [######################################################################] 100%
(2/2) checking available disk space                                                                                  [######################################################################] 100%
:: Processing package changes...
(1/2) reinstalling grub                                                                                              [######################################################################] 100%
:: To use the new features provided in this GRUB update, it is recommended
   to install it to the MBR or UEFI. Due to potential configuration
   incompatibilities, it is advised to run both, installation and generation
   of configuration:
     # grub-install ...
     # grub-mkconfig -o /boot/grub/grub.cfg
(2/2) reinstalling efibootmgr                                                                                        [######################################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

Install grub:

[root@archiso /]# grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB
Installing for x86_64-efi platform.
grub-install: error: esp doesn't look like an EFI partition.

Hardware:
Packard Bell Easynote TE

[root@archiso /]# lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 7 Series/C216 Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C216 Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C216 Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM70 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C216 Chipset Family SMBus Controller (rev 04)
02:00.0 Ethernet controller: Broadcom Inc. and subsidiaries NetLink BCM57785 Gigabit Ethernet PCIe (rev 10)
02:00.1 SD Host controller: Broadcom Inc. and subsidiaries BCM57765/57785 SDXC/MMC Card Reader (rev 10)
02:00.2 System peripheral: Broadcom Inc. and subsidiaries BCM57765/57785 MS Card Reader (rev 10)
02:00.3 System peripheral: Broadcom Inc. and subsidiaries BCM57765/57785 xD-Picture Card Reader (rev 10)
03:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)
# cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 42
model name	: Intel(R) Celeron(R) CPU B820 @ 1.70GHz
stepping	: 7
microcode	: 0x25
cpu MHz		: 798.136
cache size	: 2048 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave lahf_lm epb pti tpr_shadow flexpriority ept vpid xsaveopt dtherm arat pln pts vnmi
vmx flags	: vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown
bogomips	: 3393.57
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 42
model name	: Intel(R) Celeron(R) CPU B820 @ 1.70GHz
stepping	: 7
microcode	: 0x25
cpu MHz		: 1085.826
cache size	: 2048 KB
physical id	: 0
siblings	: 2
core id		: 1
cpu cores	: 2
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave lahf_lm epb pti tpr_shadow flexpriority ept vpid xsaveopt dtherm arat pln pts vnmi
vmx flags	: vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown
bogomips	: 3393.57
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:
[root@archiso /]# lsmod
Module                  Size  Used by
vfat                   20480  1
fat                   106496  1 vfat
gcm                    28672  0
ccm                    20480  0
algif_aead             12288  0
crypto_null            16384  2 gcm,algif_aead
qrtr                   57344  4
des_generic            12288  0
libdes                 20480  1 des_generic
cbc                    12288  0
ecb                    12288  0
algif_skcipher         12288  0
cmac                   12288  0
md4                    12288  0
algif_hash             12288  0
af_alg                 36864  3 algif_hash,algif_skcipher,algif_aead
intel_rapl_msr         20480  0
intel_rapl_common      40960  1 intel_rapl_msr
x86_pkg_temp_thermal    16384  0
intel_powerclamp       20480  0
coretemp               16384  0
kvm_intel             425984  0
kvm                  1376256  1 kvm_intel
snd_hda_codec_hdmi     94208  1
irqbypass              12288  1 kvm
snd_hda_codec_realtek   196608  1
snd_hda_codec_generic   114688  1 snd_hda_codec_realtek
ledtrig_audio          12288  1 snd_hda_codec_generic
crct10dif_pclmul       12288  1
snd_hda_intel          65536  0
wl                   6512640  0
uvcvideo              176128  0
snd_intel_dspcfg       40960  1 snd_hda_intel
snd_intel_sdw_acpi     16384  1 snd_intel_dspcfg
polyval_generic        12288  0
snd_hda_codec         225280  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core          151552  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_hwdep              20480  1 snd_hda_codec
gf128mul               16384  1 polyval_generic
snd_pcm               204800  4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_core
snd_timer              53248  1 snd_pcm
snd                   155648  8 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm
soundcore              16384  1 snd
ghash_clmulni_intel    16384  0
videobuf2_vmalloc      20480  1 uvcvideo
ath9k                 221184  0
uvc                    12288  1 uvcvideo
videobuf2_memops       16384  1 videobuf2_vmalloc
videobuf2_v4l2         40960  1 uvcvideo
videodev              389120  2 videobuf2_v4l2,uvcvideo
videobuf2_common       94208  4 videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,videobuf2_memops
cryptd                 28672  1 ghash_clmulni_intel
mc                     90112  4 videodev,videobuf2_v4l2,uvcvideo,videobuf2_common
ath9k_common           49152  1 ath9k
sha1_ssse3             32768  0
ath9k_hw              585728  2 ath9k_common,ath9k
ath                    40960  3 ath9k_common,ath9k,ath9k_hw
iTCO_wdt               16384  0
mac80211             1572864  2 ath9k,ath9k_hw
pktcdvd                61440  0
rapl                   20480  0
intel_pmc_bxt          16384  1 iTCO_wdt
libarc4                12288  1 mac80211
iTCO_vendor_support    12288  1 iTCO_wdt
mei_hdcp               28672  0
at24                   28672  0
acer_wmi               36864  0
mei_pxp                16384  0
intel_cstate           20480  0
intel_uncore          258048  0
sparse_keymap          12288  1 acer_wmi
i2c_i801               40960  0
wmi_bmof               12288  0
mei_me                 57344  2
mei                   200704  5 mei_hdcp,mei_pxp,mei_me
lpc_ich                28672  0
i2c_smbus              20480  1 i2c_i801
pcspkr                 12288  0
mac_hid                12288  0
cfg80211             1335296  5 wl,ath9k_common,ath9k,ath,mac80211
rfkill                 40960  5 acer_wmi,ath9k,cfg80211
pkcs8_key_parser       12288  0
fuse                  208896  3
ip_tables              36864  0
x_tables               69632  1 ip_tables
overlay               225280  1
squashfs               94208  1
loop                   40960  2
isofs                  61440  0
dm_mod                225280  2
btrfs                2023424  1
blake2b_generic        24576  0
xor                    20480  1 btrfs
raid6_pq              122880  1 btrfs
libcrc32c              12288  1 btrfs
crc32c_generic         12288  0
i915                 4136960  2
drm_buddy              20480  1 i915
i2c_algo_bit           20480  1 i915
ttm                   110592  1 i915
sdhci_pci             102400  0
sr_mod                 28672  0
drm_display_helper    229376  1 i915
tg3                   221184  0
uas                    32768  0
crc32_pclmul           12288  0
cqhci                  45056  1 sdhci_pci
crc32c_intel           16384  2
sha512_ssse3           53248  0
cdrom                  81920  3 pktcdvd,isofs,sr_mod
cec                    86016  2 drm_display_helper,i915
usb_storage            90112  2 uas
sha256_ssse3           32768  0
sdhci                  98304  1 sdhci_pci
libphy                229376  1 tg3
mmc_core              270336  3 sdhci,cqhci,sdhci_pci
intel_gtt              28672  1 i915
serio_raw              16384  0
atkbd                  40960  0
libps2                 20480  1 atkbd
vivaldi_fmap           12288  1 atkbd
i8042                  53248  1 acer_wmi
video                  77824  2 acer_wmi,i915
serio                  28672  4 serio_raw,atkbd,i8042
wmi                    45056  3 video,acer_wmi,wmi_bmof

Kernel of the memory stick:

# uname -a
Linux archiso 6.6.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 29 Nov 2023 00:37:40 +0000 x86_64 GNU/Linux

Offline

#2 2023-12-27 13:22:39

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,599

Re: problems installing grub to create dual boot windows 7 / Arch linux

It appears Windows is installed in BIOS/CMS mode, not UEFI mode

Offline

#3 2023-12-27 13:45:42

cdwijs
Member
Registered: 2010-04-24
Posts: 289

Re: problems installing grub to create dual boot windows 7 / Arch linux

That's odd, on this page it says to make a 1MB partition:
https://wiki.archlinux.org/title/GRUB#BIOS_systems

Create a mebibyte partition (+1M with fdisk or gdisk) on the disk with no file system and with partition type GUID 21686148-6449-6E6F-744E-656564454649.

    Select partition type BIOS boot for fdisk.
    Select partition type code ef02 for gdisk.
    For parted set/activate the flag bios_grub on the partition.

In fdisk, I can choose from these types:

00 Empty            27 Hidden NTFS Win  82 Linux swap / So  c1 DRDOS/sec (FAT-
01 FAT12            39 Plan 9           83 Linux            c4 DRDOS/sec (FAT-
02 XENIX root       3c PartitionMagic   84 OS/2 hidden or   c6 DRDOS/sec (FAT-
03 XENIX usr        40 Venix 80286      85 Linux extended   c7 Syrinx         
04 FAT16 <32M       41 PPC PReP Boot    86 NTFS volume set  da Non-FS data    
05 Extended         42 SFS              87 NTFS volume set  db CP/M / CTOS / .
06 FAT16            4d QNX4.x           88 Linux plaintext  de Dell Utility   
07 HPFS/NTFS/exFAT  4e QNX4.x 2nd part  8e Linux LVM        df BootIt         
08 AIX              4f QNX4.x 3rd part  93 Amoeba           e1 DOS access     
09 AIX bootable     50 OnTrack DM       94 Amoeba BBT       e3 DOS R/O        
0a OS/2 Boot Manag  51 OnTrack DM6 Aux  9f BSD/OS           e4 SpeedStor      
0b W95 FAT32        52 CP/M             a0 IBM Thinkpad hi  ea Linux extended 
0c W95 FAT32 (LBA)  53 OnTrack DM6 Aux  a5 FreeBSD          eb BeOS fs        
0e W95 FAT16 (LBA)  54 OnTrackDM6       a6 OpenBSD          ee GPT            
0f W95 Ext'd (LBA)  55 EZ-Drive         a7 NeXTSTEP         ef EFI (FAT-12/16/
10 OPUS             56 Golden Bow       a8 Darwin UFS       f0 Linux/PA-RISC b
11 Hidden FAT12     5c Priam Edisk      a9 NetBSD           f1 SpeedStor      
12 Compaq diagnost  61 SpeedStor        ab Darwin boot      f4 SpeedStor      
14 Hidden FAT16 <3  63 GNU HURD or Sys  af HFS / HFS+       f2 DOS secondary  
16 Hidden FAT16     64 Novell Netware   b7 BSDI fs          f8 EBBR protective
17 Hidden HPFS/NTF  65 Novell Netware   b8 BSDI swap        fb VMware VMFS    
18 AST SmartSleep   70 DiskSecure Mult  bb Boot Wizard hid  fc VMware VMKCORE 
1b Hidden W95 FAT3  75 PC/IX            bc Acronis FAT32 L  fd Linux raid auto
1c Hidden W95 FAT3  80 Old Minix        be Solaris boot     fe LANstep        
1e Hidden W95 FAT1  81 Minix / old Lin  bf Solaris          ff BBT            
24 NEC DOS        

Aliases:
   linux          - 83
   swap           - 82
   extended       - 05
   uefi           - EF
   raid           - FD
   lvm            - 8E
   linuxex        - 85

partition type code ef02  can not be entered:

Command (m for help): t
Partition number (1-6, default 6): 
Hex code or alias (type L to list all): ef02

Changed type of partition 'XENIX root' to 'unknown'.

Command (m for help): p
Disk /dev/sda: 298.09 GiB, 320072933376 bytes, 625142448 sectors
Disk model: Hitachi HTS54323
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbea0366b

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048  31459327  31457280    15G 27 Hidden NTFS WinRE
/dev/sda2  *     31459328  31664127    204800   100M  7 HPFS/NTFS/exFAT
/dev/sda3        31664128 420341759 388677632 185.3G  7 HPFS/NTFS/exFAT
/dev/sda4       420341760 625142447 204800688  97.7G  5 Extended
/dev/sda5       421394432 625142447 203748016  97.2G 83 Linux
/dev/sda6       420343808 420345855      2048     1M  2 XENIX root

Filesystem/RAID signature on partition 6 will be wiped.
Partition table entries are not in disk order.

I can't find "BIOS boot" in the list of types above.

Offline

#4 2023-12-27 14:05:14

cdwijs
Member
Registered: 2010-04-24
Posts: 289

Re: problems installing grub to create dual boot windows 7 / Arch linux

I set the 1MB partition type to 00, added a new /boot partition, rebooted, reinstalled grub, installed grub to /dev/sda, this all worked without errors:
Now the system loads grub at startup, but there are no boot entries, only the "grub>" prompt is visible:

Command (m for help): p
Disk /dev/sda: 298.09 GiB, 320072933376 bytes, 625142448 sectors
Disk model: Hitachi HTS54323
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbea0366b

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048  31459327  31457280    15G 27 Hidden NTFS WinRE
/dev/sda2  *     31459328  31664127    204800   100M  7 HPFS/NTFS/exFAT
/dev/sda3        31664128 420341759 388677632 185.3G  7 HPFS/NTFS/exFAT
/dev/sda4       420341760 625142447 204800688  97.7G  5 Extended
/dev/sda5       421394432 625142447 203748016  97.2G 83 Linux
/dev/sda6       420343808 420345855      2048     1M  2 XENIX root

Filesystem/RAID signature on partition 6 will be wiped.
Partition table entries are not in disk order.

Command (m for help): 


Command (m for help): t
Partition number (1-6, default 6): 
Hex code or alias (type L to list all): 00
Type 0 means free space to many systems. Having partitions of type 0 is probably unwise.

Changed type of partition 'XENIX root' to 'Empty'.

Command (m for help): p
Disk /dev/sda: 298.09 GiB, 320072933376 bytes, 625142448 sectors
Disk model: Hitachi HTS54323
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbea0366b

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048  31459327  31457280    15G 27 Hidden NTFS WinRE
/dev/sda2  *     31459328  31664127    204800   100M  7 HPFS/NTFS/exFAT
/dev/sda3        31664128 420341759 388677632 185.3G  7 HPFS/NTFS/exFAT
/dev/sda4       420341760 625142447 204800688  97.7G  5 Extended
/dev/sda5       421394432 625142447 203748016  97.2G 83 Linux
/dev/sda6       420343808 420345855      2048     1M  0 Empty

Filesystem/RAID signature on partition 6 will be wiped.
Partition table entries are not in disk order.

Command (m for help): n
All primary partitions are in use.
Adding logical partition 7
First sector (420347904-421392383, default 420347904): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (420347904-421392383, default 421392383): 

Created a new partition 7 of type 'Linux' and of size 510 MiB.

Command (m for help): wq
The partition table has been altered.
Failed to remove partition 5 from system: Device or resource busy
Failed to remove partition 6 from system: Device or resource busy
Failed to add partition 5 to system: Device or resource busy
Failed to add partition 6 to system: Device or resource busy
Failed to add partition 7 to system: Device or resource busy

The kernel still uses the old partitions. The new table will be used at the next reboot. 
Syncing disks.

[root@archiso /]# reboot
Running in chroot, ignoring request.
[root@archiso /]# exit
exit
root@archiso ~ # reboot
root@archiso ~ # Connection to 192.168.x.y closed by remote host.
Connection to 192.168.x.y closed.
[cedric@cedric-work-laptop ~]$ ssh 192.168.x.y -l root
root@192.168.x.y's password: 
To install Arch Linux follow the installation guide:
https://wiki.archlinux.org/title/Installation_guide

For Wi-Fi, authenticate to the wireless network using the iwctl utility.
For mobile broadband (WWAN) modems, connect with the mmcli utility.
Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.

After connecting to the internet, the installation guide can be accessed
via the convenience script Installation_guide.

                                          
Last login: Wed Dec 27 13:53:25 2023
root@archiso ~ # fdisk /dev/sda

Welcome to fdisk (util-linux 2.39.2).
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: 298.09 GiB, 320072933376 bytes, 625142448 sectors
Disk model: Hitachi HTS54323
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbea0366b

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048  31459327  31457280    15G 27 Hidden NTFS WinRE
/dev/sda2  *     31459328  31664127    204800   100M  7 HPFS/NTFS/exFAT
/dev/sda3        31664128 420341759 388677632 185.3G  7 HPFS/NTFS/exFAT
/dev/sda4       420341760 625142447 204800688  97.7G  5 Extended
/dev/sda5       421394432 625142447 203748016  97.2G 83 Linux
/dev/sda6       420343808 420345855      2048     1M  0 Empty
/dev/sda7       420347904 421392383   1044480   510M 83 Linux

Partition table entries are not in disk order.

Command (m for help): q

root@archiso ~ # mount /dev/sda5 /mnt 
root@archiso ~ # mount /dev/sda7 /mnt/boot 
mount: /mnt/boot: wrong fs type, bad option, bad superblock on /dev/sda7, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
32 root@archiso ~ # mkfs.fat -F 32 /dev/sda7
mkfs.fat 4.2 (2021-01-31)
root@archiso ~ # mount /dev/sda7 /mnt/boot
root@archiso ~ # arch-chroot /mnt 
[root@archiso /]# pacman -S grub
warning: grub-2:2.12-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) grub-2:2.12-1

Total Installed Size:  33.57 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                                       [######################################################################] 100%
(1/1) checking package integrity                                                                                     [######################################################################] 100%
(1/1) loading package files                                                                                          [######################################################################] 100%
(1/1) checking for file conflicts                                                                                    [######################################################################] 100%
(1/1) checking available disk space                                                                                  [######################################################################] 100%
:: Processing package changes...
(1/1) reinstalling grub                                                                                              [######################################################################] 100%
:: To use the new features provided in this GRUB update, it is recommended
   to install it to the MBR or UEFI. Due to potential configuration
   incompatibilities, it is advised to run both, installation and generation
   of configuration:
     # grub-install ...
     # grub-mkconfig -o /boot/grub/grub.cfg
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
[root@archiso /]# grub-install --target=i386-pc /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
[root@archiso /]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Adding boot menu entry for UEFI Firmware Settings ...
done
[root@archiso /]#

Offline

#5 2023-12-27 14:26:19

cdwijs
Member
Registered: 2010-04-24
Posts: 289

Re: problems installing grub to create dual boot windows 7 / Arch linux

I had formatted my /boot partition, so grub didn't find any kernels in /boot anymore. Reinstalling linux solved that problem. Now /boot/grub/grub.cfg does contain entries for arch linux.

os-prober doesn't detect windows 7 yet.

[root@archiso esp]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Adding boot menu entry for UEFI Firmware Settings ...
done
[root@archiso esp]# nano /boot/grub/grub.cfg 
[root@archiso esp]# pacman -S linux
warning: linux-6.6.8.arch1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) linux-6.6.8.arch1-1

Total Installed Size:  128.78 MiB
Net Upgrade Size:        0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                                       [######################################################################] 100%
(1/1) checking package integrity                                                                                     [######################################################################] 100%
(1/1) loading package files                                                                                          [######################################################################] 100%
(1/1) checking for file conflicts                                                                                    [######################################################################] 100%
(1/1) checking available disk space                                                                                  [######################################################################] 100%
:: Processing package changes...
(1/1) reinstalling linux                                                                                             [######################################################################] 100%
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating module dependencies...
(3/3) Updating linux initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -g /boot/initramfs-linux.img --microcode /boot/*-ucode.img
==> Starting build: '6.6.8-arch1-1'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [kms]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [block]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> WARNING: No fsck helpers found. fsck will not be run on boot.
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux.img'
==> WARNING: errors were encountered during the build. The image may not be complete.
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -g /boot/initramfs-linux-fallback.img -S autodetect --microcode /boot/*-ucode.img
==> Starting build: '6.6.8-arch1-1'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [kms]
==> WARNING: Possibly missing firmware for module: 'ast'
  -> Running build hook: [keyboard]
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'aic94xx'
==> WARNING: Possibly missing firmware for module: 'bfa'
==> WARNING: Possibly missing firmware for module: 'qed'
==> WARNING: Possibly missing firmware for module: 'qla2xxx'
==> WARNING: Possibly missing firmware for module: 'qla1280'
==> WARNING: Possibly missing firmware for module: 'wd719x'
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux-fallback.img'
==> Image generation successful
error: command failed to execute correctly
[root@archiso esp]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda5        98G  2.2G   94G   3% /
efivarfs         92K   60K   28K  69% /sys/firmware/efi/efivars
udev            2.8G     0  2.8G   0% /dev
shm             2.9G     0  2.9G   0% /dev/shm
run             2.9G  8.0K  2.9G   1% /run
tmp             2.9G     0  2.9G   0% /tmp
run             2.9G   11M  2.9G   1% /etc/resolv.conf
/dev/sda7       509M  110M  400M  22% /boot
/dev/sda2       100M   26M   75M  26% /esp
/dev/sda3       186G  108G   79G  58% /mnt/windows
[root@archiso esp]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  initramfs-linux-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Adding boot menu entry for UEFI Firmware Settings ...
done
[root@archiso esp]# nano /boot/grub/grub.cfg

Offline

#6 2023-12-27 15:14:05

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,744
Website

Re: problems installing grub to create dual boot windows 7 / Arch linux

You need to mount the Windows system partition for os-prober to be able to find the bootloader and add an entry, it will have the "System Reserved" or "SYSTEM" label.

Find that with

ls -l /dev/disk/by-label/

Reference: https://wiki.archlinux.org/title/GRUB#Windows

Offline

#7 2023-12-27 18:41:37

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,599

Re: problems installing grub to create dual boot windows 7 / Arch linux

The BIOS boot partition is for GPT disks. You have a DOS/MBR disk.

Offline

Board footer

Powered by FluxBB