Full New Users Installation guide

From Manjaro-Arm
Jump to: navigation, search

There are currently two major methods to installing Manjaro-Arm. Depending on the device, there may be a an Image available which makes things considerably easier. Not all devices support images or Manjaro-Arm may not have images available for that device. If that is the case, the Tarball method is available. Both methods are rather straightforward and focused on the people that have few experiences with Linux. Follow closely and everything should work fine.

Image Method

Overview

This is the simplest method. These instructions are created for use on a Linux Machine however should work fine on OSX. If using Windows, please look for some sort of image writer that will work for your system.

Obtaining the SD Card

We recommend an SDcard that is at least 4GB and a class 4 or higher. Manjaro-Arm can be installed with less of course but your experience may not be as intended from the Manjaro-Arm team.

Preparing the SD Card

Dumping an image to the SDCard writes over everything on it (for the size of the image) however, it is always recommended to clean the SD Card before dumping to it to prevent any strange errors. You can use any partition manager you wish to do this or simply zero out the device using DD:

$ sudo dd if=/dev/zero of=/dev/mmcblk0
 

Downloading the Release

You can find the official releases, community releases, and all previous releases at http://manjaro-arm.org/downloads/. Be sure to select the correct device and release version. Download the file and save it somewhere you remember. We will refer to it next as /path/to/image.img

Use DD to dump the image to the SDCard

Assuming the SDCard is named mmcblk0 (it can also be sdX or something else, just be sure you dump it to the correct one), and the image is /path/to/image.img (Something like /home/<user>/Downloads/Manjaro-Arm-Minimal-rpi2.img)

You can use the following command to dump the image.

$ sudo dd if=/path/to/image.img of=/dev/mmcblk0
 

Be sure to change any of these paths to reflect your actual image and hardware.

Booting the device and growing the Filesystem

We package the images to be as small as possible. Inside the image you will find 2 partitions /boot and /. This is sufficient to run the device however, in order to have a swap partition, one will need to be created manually. By default, these partitions are just barely bigger than the data that is stored on them leaving very little room for usage so the first step after booting is to grow those partitions out to fill the remainder of the SDCard.

Remove the SDCard from the computer and insert it into your device. Plug in device and initiate the boot process. Once booted, open a terminal or use SSH to access the device and run the following command.

$ sudo resize-sd
 

Follow the prompts on the screen. This script will unmount the / partition and resize it to fill the rest of the SDCard, after it finishes it will remake the partition without deleting data to fill the partition. What you will be left with is a 100mb /boot partition and a / partition that fills the remaining space on the card.

Creating a Swap partition / Swap file

Instructions coming soon.

Tarball Method

Overview

Installing something without a graphical installer can be difficult or overwhelming. With Manjaro-Arm it is important to know that most of the hard work has been done. The overall process is simple and straight forward. You will essentially extract an archive of files known as a tarball to the MicroSD card for you Single Board Computer, and move some things around.

The way to install Manjaro is to copy an archive to a device, called a SD Card, and then modify its contents, but before you do that, you need to prepare your environment and your SD Card

  1. Make the partitions
  2. Make the filesystems
  3. Mount the filesystems

Then you can extract the archive, and finally clean up and boot.

Obtaining the SD Card

Your MicroSD Card should be at least 4GB and a class 4 or better. Ideally, a class 10 / class U1 / class U3 card of a size 8GB or greater will be used.

Preparing your Environment

Create root and boot directories in your $HOME on your Linux machine

$ cd ~
$ mkdir root
$ mkdir boot
 

These are going to be the directories you will later use for mounting.

Making the Partitions With FDisk

Finding the Device

The first step is to find the device.

Insert your MicroSD card into an adapter on your Linux computer. Execute lsblk to see if the device is registered. The output should look something like this:

$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0      2:0    1    4K  0 disk 
sda      8:0    0   30G  0 disk 
├─sda1   8:1    0 25.7G  0 part /
└─sda2   8:2    0  4.3G  0 part [SWAP]
sr0     11:0    1  1.8G  0 rom  
mmcblk1 179:0    1   16G  0 disk
 

Typically the device will show up as /dev/mmcblkXX. If for some reason, it shows up as /dev/sdX, it is fine and everything will work as expected.

The device number is above is 1 Note the device number (mmcblk1); you will need it later.

Using FDisk to Make Partitions

Once you have found the device, it is time to set up the card for the two required partitions:

  1. /boot
  2. / (root).

These commands will need to be done as root (not using sudo):

$ sudo su
# fdisk /dev/mmcblkX (replace X with the device number, not the partition number)
  type 'o' to clear the partition table
  type 'p' to ensure there is no partition listed
  type 'n' to create a new partition
  type 'p' to select primary partition
  type '1' to make it partition one
  press enter to set the default first sector
  type '+64M' to make the partition 64 MBytes
  type 't' and then 'c' to change the partition type to W95 FAT32
  type 'n' then 'p' to create a new primary partition
  press enter to select the default partition 2
  press enter twice to select the default start and end sectors (it will take up the space left on the device)
  type 'w' to write the partition table and exit

Making the Filesystems

Now that the partitions are made on your device, you need to create filesystems in them to hold your data. These commands will need to be done as root (not using sudo):

# mkfs.vfat /dev/mmcblkXp1 (replace the X with device number, the p1 stands for partition 1 [the 64MB partition we made for /boot])
# mkfs.ext4 /dev/mmcblkXp2 (replace the X with device number, the p2 stands for partition 2 [the / or root partition we will be using])

If the last command gives you any kind of message saying that the partition already has a filesystem on it, go ahead and overwrite it.

Making the Partitions with GParted

Finding the Device

The first step is to find the device.

Insert your MicroSD card into an adapter on your Linux computer. Execute lsblk to see if the device is registered. The output should look something like this:

$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0      2:0    1    4K  0 disk 
sda      8:0    0   30G  0 disk 
├─sda1   8:1    0 25.7G  0 part /
└─sda2   8:2    0  4.3G  0 part [SWAP]
sr0     11:0    1  1.8G  0 rom  
mmcblk1 179:0    1   16G  0 disk
 

Typically the device will show up as /dev/mmcblkXX. If for some reason, it shows up as /dev/sdX, it is fine and everything will work as expected.

The device number is above is 1 Note the device number (mmcblk1); you will need it later.

Creating Partitions and Filesystems in Gparted

Open GParted, and select your SD card using the selector in the top right-hand corner. MAKE SURE THIS IS YOUR SDCARD!!

1. Select "Device" from the window buttons at the top of the screen (you know, the ones that say Edit, View, Device....)
2. Select "Create Partition Table" from the dropdown menu.
3. Confirm that you would like to use a MS-DOS partition table.
4. Confirm that you would like to format your SD card.
5. Once GParted has finished creating the table, it will show one "Unallocated" partition below.
6. Select the unallocated partition, right click, and select "New". 
7. In the box that says "New size (MiB):" replace what is there with the number 64.
8. Now click on the box right below the previous box. The box you just clicked on should change size to be a lot bigger. 
9. From the "Filesystem" dropdown menu, select ext4 if it is not already selected.
10. Click "Add".
11. Repeat steps 6-10, but skip steps 7-8.
12. Click the green "Apply" button, and wait for GParted to finish.

Mounting the Filesystems

You are almost finished. Now that you have made the filesystems, you need to mount them to the boot and root directories you made before you can copy the data over.

You will need to continue to run as root (not using sudo):

# mount /dev/mmcblkXp1 boot (change the X to the device number for your card)
# mount /dev/mmcblkXp2 root

Creating Swap File

As root use fallocate to create a swap file the size of your choosing (M = Megabytes, G = Gigabytes). For example, creating a 512 MB swap file:

# fallocate -l 512M root/swapfile

Set the right permissions (a world-readable swap file is a huge local vulnerability)

# chmod 600 root/swapfile

After creating the correctly sized file, format it to swap:

# mkswap root/swapfile

Edit /etc/fstab to add an entry for the swap file:

   /swapfile none swap defaults 0 0

Once the system has booted, enable the swap file:

# swapon /swapfile

Downloading and Extracting the Archive

Download the release archive for your device here.

Use the BSD tar command to extract the tarball to the root/ (mmcblkXp2):

# bsdtar -xpf ManjaroArm.tar.gz -C root/

Cleaning up and Booting

After the Tarball is extracted, you need to move the boot files over to the boot partition

# mv root/boot/* boot/

You can go ahead and unmount the sdcard and remove it.

# umount boot/ root/
# exit <to return to standard user>

Once the MicroSD is inserted into your Single Board Computer, apply the power and let it boot. After a short time, your device should be booted.

If you are using it headless (no display, mouse, or keyboard) the ssh server is already started on boot you can access your device by ssh

$ ssh manjaro@<ip>
password is manjaro

or as root

$ ssh root@<ip>
password is root