Monday, April 9, 2012

Acer Aspire 5755G - 04 - Gentoo: Prepare disks and chroot

The first trouble:
I couldn't boot from my Gentoo thumb. It couldn't find the thumb while mounting root.
So if you have some troubles booting from a thumbdrive, get the Live DVD. It's slow, noisy and runs flawless.

The second trouble:
Fdisk reported "Partition does not start on physical sector boundary" after creating the Linux partitions.
I've really never seen that issue before and was quite confused.

I took the radical way again to figure out what was going on:

  • I've started a X root session
    As root: startx -- :1
  • Opened gparted
  • Deleted all Linux partitions again
  • Created an extended container
  • Recreated the Linux partitions in it
  • Saved the whole thing
  • Reboot

That finally did it and the error messages went away.

My partition table looked like this after a long fight: navi lia # parted /dev/sda GNU Parted 3.1 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print Model: ATA TOSHIBA MK1059GS (scsi) Disk /dev/sda: 1000GB Sector size (logical/physical): 512B/4096B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 16.1GB 16.1GB primary ntfs diag 2 16.1GB 16.2GB 105MB primary ntfs boot 3 16.2GB 311GB 295GB primary ntfs 4 311GB 1000GB 689GB extended 5 311GB 312GB 105MB logical ext2 6 312GB 322GB 10.5GB logical linux-swap(v1) 7 322GB 637GB 315GB logical 8 637GB 1000GB 364GB logical ntfs

The first three partition are still owned by Windows.
I'm using an extra ext2 partition for grub2 because I had lots of troubles with it on a btrfs partition.

The swapdrive is important for TuxOnIce. It must be as big as your RAM or it won't be able to hold the RAM image on hibernating.

My root partition is a btrfs. I haven't had any troubles with it in the past and it seems to run stable.
And finally the ntfs partition for the shared files (formated in Windows).

The rest of this post follows the Gentoo install guide up to the point where the new Gentoo will be chrooted.

Some filesystems need to be created on the Linux partitions: mkfs.ext2 /dev/sda5 mkswap /dev/sda6 mkfs.btrfs -L gentoo /dev/sda7

Btrfs needs some subvolumes: mkdir -p /mnt/pool mount -t btrfs /dev/sda7 /mnt/pool cd /mnt/pool btrfs subvolume create root btrfs subvolume create var btrfs subvolume create portage btrfs subvolume create home

The partitions have to be mounted: mount -t btrfs -o subvol=root /mnt/gentoo mkdir -p /mnt/gentoo/boot mkdir -p /mnt/gentoo/var mkdir -p /mnt/gentoo/usr/portage mkdir -p /mnt/gentoo/home mount -t btrfs -o subvol=var,compress /mnt/gentoo/var mount -t btrfs -o subvol=portage,compress /mnt/gentoo/usr/portage Important: Do not mount boot at this point. The grub2 configuration script might not recognize it correctly. The boot partition has to be mounted after chrooting into gentoo.

Now it's time to get the Gentoo sources and portage snapshot from a mirror. But take care to get the stage3-amd64 if you want a 64bit system. Yes, Intel 64bit uses also the Gentoo amd64 package.

Sources unpack: cd /mnt/gentoo tar xjpf stage3* cd /mnt/gentoo/usr time tar xjf portage-latest*

Prepare for chroot: mount -t proc proc /mnt/gentoo/proc mount --rbind /dev /mnt/gentoo/dev cp -L /etc/resolv.conf /mnt/gentoo/etc/ chroot /mnt/gentoo /bin/bash env-update && source /etc/profile

Now the boot partition needs to be mounted. Do this from a second terminal as root in the live DVD: mount -t ext2 /dev/sda5 /mnt/gentoo/boot

Well, that's so far for this post. The next steps will be explained in chapter 05.

No comments:

Post a Comment