You are not logged in.

#1 2014-06-11 03:41:08

James_Epp
Member
From: Manitoba, Canada
Registered: 2014-05-07
Posts: 14

[SOLVED] GRUB, GPT, and BIOS to 4TB Disk

A couple of weeks ago I could install everything above perfectly to a 4TB disk. It would boot up perfectly. No glitches. All 4TB available.

Now, it is not working, using the exact same installation steps as prior, including:

  • Formatting partitions using gdisk (duh)

  • The 2MB partition (duh)

  • ch-rooting into /mnt (duh)

  • grub-install --target=i386-pc --recheck --debug /dev/sda (duh)

  • grub-mkconfig -o /boot/grub/grub.cfg (duh)

Once you reboot from setup, I experience the following funtionality:

error: attempt to read or write outside of disk 'hd0'.
Enabling rescue mode...
grub rescue> ls
(hd0) (hd0,gpt2) (hd0,gpt1)
grub rescue> ls (hd0,gpt2)
(hd0,gpt2): Filesystem is ext2

However, if I format the second partition of the drive (/dev/sda2) with 2TB or less, the problem is resolved.

Yes, I am using 64-bit versions.

What's going on, maaan?

Last edited by James_Epp (2014-06-12 22:35:39)

Offline

#2 2014-06-11 03:49:17

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

Re: [SOLVED] GRUB, GPT, and BIOS to 4TB Disk

Well gdisk doesn't format partitions, it creates partition tables. Did you ever actually format them (mkfs)? If so, give us the layout and filesystem types.

Offline

#3 2014-06-11 03:52:46

James_Epp
Member
From: Manitoba, Canada
Registered: 2014-05-07
Posts: 14

Re: [SOLVED] GRUB, GPT, and BIOS to 4TB Disk

I have a script I use. Here it is. I removed some parts including AUR (nothing fancy, just expac, cower, pacaur) Please don't mock me for my poor scripting skills.

cd /
umount -R /mnt

# disk_partitioning
gdisk /dev/sda <<EOF_clear
x
z
y
y

EOF_clear

gdisk /dev/sda <<EOF_disk
o
y
n


+2M
EF02

n




w
y

EOF_disk

# format_and_mount
mkfs.ext4 /dev/sda2
mount /dev/sda2 /mnt

# base_and_fstab
pacstrap -i /mnt base --noconfirm
genfstab -U -p /mnt >> /mnt/etc/fstab

# basic_programs
pacman -S grub wget samba p7zip inetutils net-tools cronie gptfdisk openssh --noconfirm --root /mnt --dbpath /mnt/var/lib/pacman --cachedir /mnt/var/cache/pacman/pkg


arch-chroot /mnt <<EOF_config

# language
rm /etc/locale.gen
echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 >> /etc/locale.conf
export LANG=en_US.UTF-8

# clock
ln -s /usr/share/zoneinfo/Canada/Central /etc/localtime
hwclock --systohc --utc

# basic_networking
echo archlinux-server >> /etc/hostname
systemctl enable dhcpcd.service

# root_password
passwd
password
password

# nano_persistence
echo export EDITOR=nano >> /etc/bash.bashrc
echo export VISUAL=nano >> /etc/bash.bashrc

# grub_configuration
grub-install --target=i386-pc --recheck --debug /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

EOF_config

cd /
umount -R /mnt
reboot

Offline

#4 2014-06-11 04:37:32

James_Epp
Member
From: Manitoba, Canada
Registered: 2014-05-07
Posts: 14

Re: [SOLVED] GRUB, GPT, and BIOS to 4TB Disk

I'm slightly surprised that this actually worked.

While in volatile environment I ran a pacman -Syu and then ran my script. Must have made some kind of difference, because now we're booting. I was using 2014.05, so if I used 2014.06 it probably would have worked. I'm just too lazy to download, extract, and reflect changes on my pxe server. :S

Derp.

Offline

#5 2014-06-11 04:38:52

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

Re: [SOLVED] GRUB, GPT, and BIOS to 4TB Disk

Sounds to me like you just need to make a separate /boot partition. Probably has to do with just where the kernel gets installed on the huge partition.

Last edited by Scimmia (2014-06-11 04:39:38)

Offline

#6 2014-06-11 04:43:21

James_Epp
Member
From: Manitoba, Canada
Registered: 2014-05-07
Posts: 14

Re: [SOLVED] GRUB, GPT, and BIOS to 4TB Disk

I could see how that might eliminate some issues. However, I think as long as I continue to stick with the fresh snapshots I should be same from now on.

Thanks for the interest!

Offline

#7 2014-06-12 21:57:08

James_Epp
Member
From: Manitoba, Canada
Registered: 2014-05-07
Posts: 14

Re: [SOLVED] GRUB, GPT, and BIOS to 4TB Disk

The problem has come back. I tried adding some more fail-safes to my script to make it work again, but it isn't doing the job:

pacman -Syyu --noconfirm

cd /
umount -R /mnt

# disk_partitioning
sgdisk --zap-all /dev/sda
gdisk /dev/sda <<EOF_clear
x
z
y
y

EOF_clear

gdisk /dev/sda <<EOF_disk
o
y
n


+2M
EF02

n




w
y

EOF_disk

gdisk /dev/sda <<EOF_attribute
x
a
1
2

w
y

EOF_attribute

# format_and_mount
mkfs.ext4 -F /dev/sda2
mount /dev/sda2 /mnt

# base_and_fstab
pacstrap -i /mnt base --noconfirm
genfstab -U -p /mnt >> /mnt/etc/fstab

# basic_programs
pacman -S grub wget samba p7zip inetutils net-tools cronie gptfdisk openssh --noconfirm --root /mnt --dbpath /mnt/var/lib/pacman --cachedir /mnt/var/cache/pacman/pkg


arch-chroot /mnt <<EOF_config

# language
rm /etc/locale.gen
echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 >> /etc/locale.conf
export LANG=en_US.UTF-8

# clock
ln -s /usr/share/zoneinfo/Canada/Central /etc/localtime
hwclock --systohc --utc

# basic_networking
echo archlinux-server >> /etc/hostname
systemctl enable dhcpcd.service

# root_password
passwd
password
password

# nano_persistence
echo export EDITOR=nano >> /etc/bash.bashrc
echo export VISUAL=nano >> /etc/bash.bashrc

# grub_configuration
grub-install --target=i386-pc --recheck --debug /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

EOF_config

cd /
umount -R /mnt
reboot

Offline

#8 2014-06-12 22:27:30

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

Re: [SOLVED] GRUB, GPT, and BIOS to 4TB Disk

Of course it did. If I'm right and it has to do with where the file gets written on the disk, each kernel upgrade or each install could work or break it at random.

As I said, separate partition for /boot.

Last edited by Scimmia (2014-06-12 22:28:46)

Offline

#9 2014-06-12 22:33:49

James_Epp
Member
From: Manitoba, Canada
Registered: 2014-05-07
Posts: 14

Re: [SOLVED] GRUB, GPT, and BIOS to 4TB Disk

Resolved using the following beginning of my script up until # base_and_fstab, taking Scimmia's idea of a separate boot partition. The board doesn't have AHCI support, so that could be half the cause, from what I'm told in IRC converations.

pacman -Syyu --noconfirm

cd /
umount -R /mnt

# disk_partitioning
sgdisk --zap-all /dev/sda
gdisk /dev/sda <<EOF_clear
x
z
y
y

EOF_clear

gdisk /dev/sda <<EOF_disk
o
y
n


+2M
EF02

n


+128M


n




w
y

EOF_disk

gdisk /dev/sda <<EOF_attribute
x
a
1
2

w
y

EOF_attribute

# format_and_mount
mkfs.ext4 -F /dev/sda2
mkfs.ext4 -F /dev/sda3

mount /dev/sda3 /mnt
mkdir /mnt/boot
mount /dev/sda2 /mnt/boot

Offline

Board footer

Powered by FluxBB