Arch linux mac mini

Arch Linux on a Mac Mini

This post briefly outlines the process of setting up a dual boot OSX and Arch Linux on a Mac Mini. This is mostly for my reference in the likely event that I will be doing anything similar in some years, so it assumes some competence; fortunately, the Arch Wiki’s Beginner’s Guide probably fills in any gaps I left out. Obligatory Disclaimer: Use at your own risk or not at all.

This is almost the same as any other installation of Arch Linux, with a few changes that took some hours of frustration to figure out because of the EFI booter. My method is to create the partitions in Disk Utility, install rEFInd, and then install the grub bootloader into /dev/sda1.

Setup done in OSX

  1. First, install rEFInd. This worked out of the box for me, and makes it possible to boot via USB.
  2. Create a Arch Linux installer USB by dd -ing (or anything else) the latest installation medium onto a USB drive.
  3. Set up the partitions; I find it easier (and less dangerous) to just use the OSX Disk Utility to do this. See, for example, the procedure here. My OSX installations appear to come with three partitions, a small one called “EFI”, a main “OS X HD” partition, and then a small “Recovery HD”, like so:
NAME LABEL TYPE SIZE sda disk 931.5G |-sda1 EFI part 200M |-sda2 OS X HD part 927.9G `-sda3 Recovery HD part 619.9M

(This output is from lsblk, and is not what Disk Utility looks like).
I like to create a partition for my Arch Linux system (which I name “Arch”) and a fifth partition just for the /home directory (which I name Home”). This leaves me to something like

NAME LABEL TYPE SIZE sda disk 931.5G |-sda1 EFI part 200M |-sda2 OS X HD part 476.9G |-sda3 Recovery HD part 619.9M |-sda4 Arch part 179G `-sda5 Home part 272G

Booting into the USB and finishing up the partitions

Now that the partitions and rEFInd is set up, and the USB is written, we can proceed with the actual installation.
At this point, one can basically follow the standard procedure with a few changes.

  1. Reboot the device into the USB. Since rEFInd is installed, it should give you the option of booting into the USB.
  2. Establish an Internet as required.
  3. We’ve already created the partitions in Disk Utility above, so there is no need to change the partitions themselves now. However, it is necessary to format the newcly created partitions above. In my case, the relevant commands are
# mkfs.ext4 /dev/sda4 # mkfs.ext4 /dev/sda5
# mount /dev/sda4 /mnt # mkdir /mnt/home # mount /dev/sda5 /mnt/home # mkdir /mnt/boot # mount /dev/sda1 /mnt/boot
# genfstab -U -p /mnt >> /mnt/etc/fstab

Configuring the base system and installing the bootloader

  1. Now we can chroot into the system and follow all the directions, up to (but not including) installing the bootloader.
  2. I could not get gummiboot to work but maybe you will have better luck. Fortunately, with /dev/sda1/ mounted as /boot , I got GRUB to work nicely.
# pacman -S grub # grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --recheck # grub-mkconfig -o /boot/grub/grub.cfg

If all goes well, upon rebooting, rEFInd will now boot into the complete Arch Linux system.

Share:

Источник

LaurentFough / arch-mac-mini.md

We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [1]. We will keep all data on an external hard drive, so we do not need huge amount of space for the linux system. We will install from an USB thumb drive (will need at least 1GB in size), newer Minis do not have CD roms.

Prepare the disk in Mac OS X (El Capitan)

  • Open Disk Utility and select the disk (not partition), click Partition (top tool bar)
  • There are at least 3 partitions: EFI, OS X, Recovery. Only OS X will be shown.
  • Repartition your disk as follows:
    1. OS X (size: ~ tens of GB, type HFS+, for OS X)
    2. Arch tmp (size: ~ 10 GB, FAT, will be removed later)

Create LiveUSB that we will boot from

  • Download the .iso from download page
  • Open Terminal
  • $ diskutil list and find out its name (let’s say it is /dev/disk2 )
  • $ diskutil unmountDisk /dev/disk2 to unmount the drive
  • # dd if=/path/to/arch-linux-image.iso of=/dev/rdisk2 bs=1m (we replaced disk with rdisk which is the «raw» disk in OS X and a lot faster, it is not a typo)
  • $ diskutil eject /dev/disk2
  • Connect to network
    • $ wifi-menu to setup wireless networking (assuming DHCP is available)
    • $ timedatectl set-ntp true
    • Check its status $ timedatectl status
    • # cgdisk
    • Remove the Arch tmp partition we created earlier.
    • Remember to create 128 MB gap after OS X partitions, by typing +128M for the start of the partition.
    • Add new Arch boot partition (~ 100 MB)
    • Add new Arch root partition (fill the space)
    • Swap file can be created later if needed
    • # mkfs.ext2 /dev/
    • # mkfs.ext4 /dev/
    • # mount /dev/ /mnt
    • # mkdir /mnt/boot
    • # mount /dev/ /mnt/boot
    • # vim /etc/pacman.d/mirrorlist it will be used pac the next step, so take good care of it here
    • # pacstrap /mnt base
    • # genfstab -U -p /mnt >> /mnt/etc/fstab
    • # arch-chroot /mnt /bin/bash
    • # echo > /etc/hostname
    • # ln -s /usr/share/zoneinfo// /etc/localtime
    • # nano /etc/locale.gen uncomment locales you want
    • # locale-gen
    • # echo LANG= > /etc/locale.conf
    • TODO: setup wireless networking
    • # mkinitcpio -p linux
    • # passwd
    • # pacman -S gptfdisk
    • # mkdir /boot/efi
    • # mount /dev/
    • # pacman -S grub efibootmgr
    • # grub-install —target=x86_64-efi —efi-directory=/boot/efi —bootloader-id=arch
    • # grub-mkconfig -o /boot/grub/grub.cfg
    # Set bluetooth power up ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up" 

    Let’s assume wlan is out interface for this setup.

    • Install b43-firmware from AUR
    • pacman -S wpa_supplicant
    • # vim /etc/wpa_supplicant/wpa_supplicant-wlan.conf
    ctrl_interface=/run/wpa_supplicant update_config=1 
    > scan > scan_results > add_network > set_network 0 ssid "MYSSID" > set_network 0 psk "passphrase" > enable_network 0 > save_config 

    Use systemd to start the service:

    • # ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /usr/lib/dhcpcd/dhcpcd-hooks/
    • # systemctl enable dhcpcd@wlan

    Источник

    andrsd / arch-mac-mini.md

    We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [1]. We will keep all data on an external hard drive, so we do not need huge amount of space for the linux system. We will install from an USB thumb drive (will need at least 1GB in size), newer Minis do not have CD roms.

    Prepare the disk in Mac OS X (El Capitan)

    • Open Disk Utility and select the disk (not partition), click Partition (top tool bar)
    • There are at least 3 partitions: EFI, OS X, Recovery. Only OS X will be shown.
    • Repartition your disk as follows:
      1. OS X (size: ~ tens of GB, type HFS+, for OS X)
      2. Arch tmp (size: ~ 10 GB, FAT, will be removed later)

    Create LiveUSB that we will boot from

    • Download the .iso from download page
    • Open Terminal
    • $ diskutil list and find out its name (let’s say it is /dev/disk2 )
    • $ diskutil unmountDisk /dev/disk2 to unmount the drive
    • # dd if=/path/to/arch-linux-image.iso of=/dev/rdisk2 bs=1m (we replaced disk with rdisk which is the «raw» disk in OS X and a lot faster, it is not a typo)
    • $ diskutil eject /dev/disk2
    • Connect to network
      • $ wifi-menu to setup wireless networking (assuming DHCP is available)
      • $ timedatectl set-ntp true
      • Check its status $ timedatectl status
      • # cgdisk
      • Remove the Arch tmp partition we created earlier.
      • Remember to create 128 MB gap after OS X partitions, by typing +128M for the start of the partition.
      • Add new Arch boot partition (~ 100 MB)
      • Add new Arch root partition (fill the space)
      • Swap file can be created later if needed
      • # mkfs.ext2 /dev/
      • # mkfs.ext4 /dev/
      • # mount /dev/ /mnt
      • # mkdir /mnt/boot
      • # mount /dev/ /mnt/boot
      • # vim /etc/pacman.d/mirrorlist it will be used pac the next step, so take good care of it here
      • # pacstrap /mnt base
      • # genfstab -U -p /mnt >> /mnt/etc/fstab
      • # arch-chroot /mnt /bin/bash
      • # echo > /etc/hostname
      • # ln -s /usr/share/zoneinfo// /etc/localtime
      • # nano /etc/locale.gen uncomment locales you want
      • # locale-gen
      • # echo LANG= > /etc/locale.conf
      • TODO: setup wireless networking
      • # mkinitcpio -p linux
      • # passwd
      • # pacman -S gptfdisk
      • # mkdir /boot/efi
      • # mount /dev/
      • # pacman -S grub efibootmgr
      • # grub-install —target=x86_64-efi —efi-directory=/boot/efi —bootloader-id=arch
      • # grub-mkconfig -o /boot/grub/grub.cfg
      # Set bluetooth power up ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up" 

      Let’s assume wlan is out interface for this setup.

      • Install b43-firmware from AUR
      • pacman -S wpa_supplicant
      • # vim /etc/wpa_supplicant/wpa_supplicant-wlan.conf
      ctrl_interface=/run/wpa_supplicant update_config=1 
      > scan > scan_results > add_network > set_network 0 ssid "MYSSID" > set_network 0 psk "passphrase" > enable_network 0 > save_config 

      Use systemd to start the service:

      • # ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /usr/lib/dhcpcd/dhcpcd-hooks/
      • # systemctl enable dhcpcd@wlan

      Источник

      Arch Linux on a Mac Mini

      This post briefly outlines the process of setting up a dual boot OSX and Arch Linux on a Mac Mini. This is mostly for my reference in the likely event that I will be doing anything similar in some years, so it assumes some competence; fortunately, the Arch Wiki’s Beginner’s Guide probably fills in any gaps I left out. Obligatory Disclaimer: Use at your own risk or not at all.

      This is almost the same as any other installation of Arch Linux, with a few changes that took some hours of frustration to figure out because of the EFI booter. My method is to create the partitions in Disk Utility, install rEFInd, and then install the grub bootloader into /dev/sda1.

      Setup done in OSX

      1. First, install rEFInd. This worked out of the box for me, and makes it possible to boot via USB.
      2. Create a Arch Linux installer USB by dd -ing (or anything else) the latest installation medium onto a USB drive.
      3. Set up the partitions; I find it easier (and less dangerous) to just use the OSX Disk Utility to do this. See, for example, the procedure here. My OSX installations appear to come with three partitions, a small one called “EFI”, a main “OS X HD” partition, and then a small “Recovery HD”, like so:
      NAME LABEL TYPE SIZE sda disk 931.5G |-sda1 EFI part 200M |-sda2 OS X HD part 927.9G `-sda3 Recovery HD part 619.9M

      (This output is from lsblk, and is not what Disk Utility looks like).
      I like to create a partition for my Arch Linux system (which I name “Arch”) and a fifth partition just for the /home directory (which I name Home”). This leaves me to something like

      NAME LABEL TYPE SIZE sda disk 931.5G |-sda1 EFI part 200M |-sda2 OS X HD part 476.9G |-sda3 Recovery HD part 619.9M |-sda4 Arch part 179G `-sda5 Home part 272G

      Booting into the USB and finishing up the partitions

      Now that the partitions and rEFInd is set up, and the USB is written, we can proceed with the actual installation.
      At this point, one can basically follow the standard procedure with a few changes.

      1. Reboot the device into the USB. Since rEFInd is installed, it should give you the option of booting into the USB.
      2. Establish an Internet as required.
      3. We’ve already created the partitions in Disk Utility above, so there is no need to change the partitions themselves now. However, it is necessary to format the newcly created partitions above. In my case, the relevant commands are
      # mkfs.ext4 /dev/sda4 # mkfs.ext4 /dev/sda5
      # mount /dev/sda4 /mnt # mkdir /mnt/home # mount /dev/sda5 /mnt/home # mkdir /mnt/boot # mount /dev/sda1 /mnt/boot
      # genfstab -U -p /mnt >> /mnt/etc/fstab

      Configuring the base system and installing the bootloader

      1. Now we can chroot into the system and follow all the directions, up to (but not including) installing the bootloader.
      2. I could not get gummiboot to work but maybe you will have better luck. Fortunately, with /dev/sda1/ mounted as /boot , I got GRUB to work nicely.
      # pacman -S grub # grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --recheck # grub-mkconfig -o /boot/grub/grub.cfg

      If all goes well, upon rebooting, rEFInd will now boot into the complete Arch Linux system.

      Share:

      Источник

      Читайте также:  Послать команду выключения linux
Оцените статью
Adblock
detector