You are not logged in.

#1 2015-04-13 07:26:33

STREBLO
Member
Registered: 2015-02-15
Posts: 135

[SOLVED] Install from existing Linux

I wanted to install Arch on an empty SSD I have. I already have arch installed on a HD and I wanted to try the Install from existing Linux method. I was a bit unsure of how exactly this was done as the wiki doesn't delve into how exactly you would use another drive.

From what I understand you mount the drive you want to install onto, /dev/sdd in my case, and chroot into it, then do your install there as you do with the livecd/usb.

Using method 1: Using the Bootstrap Image, I have a few questions.
I partition my /dev/sdd using gdisk into EFI partition /boot, /home, /swap and /.

Mount my drive in /mnt/arch:

# mkdir /mnt/arch
# mount /dev/sdx1 /mnt/arch

Next, mount /boot, /home

# mount /dev/sdd2 /mnt/arch/boot/
# mount /dev/sdd3 /mnt/arch/home/

I Download the bootstrap image from a mirror:

 $ curl -O https://mirrors.kernel.org/archlinux/iso/2015.03.01/archlinux-bootstrap-2015.03.01-x86_64.tar.gz

Extract the tarball:

 # cd /tmp
 # tar xzf <path-to-bootstrap-image>/archlinux-bootstrap-2015.03.01-x86_64.tar.gz

Select a repository server:

 # nano /tmp/root.x86_64/etc/pacman.d/mirrorlist

Enter the chroot
If bash 4 or later is installed:

 # /tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/

Else run the following commands:

  # cd /tmp/root.x86_64
  # cp /etc/resolv.conf etc
  # mount -t proc /proc proc
  # mount --rbind /sys sys
  # mount --rbind /dev dev
  # mount --rbind /run run
    (assuming /run exists on the system)
  # chroot /tmp/root.x86_64 /bin/bash

I'm a bit confused where in these steps i'm supposed so specify my mounted drive. Where it says "Enter the chroot" would I just do:

# arch-chroot /mnt/arch

and then:

 # /tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/

After that, do I just continue with the regular install?

Do I just skip this entire segment from the guide? (I have bash 4)
Else run the following commands:

  # cd /tmp/root.x86_64
  # cp /etc/resolv.conf etc
  # mount -t proc /proc proc
  # mount --rbind /sys sys
  # mount --rbind /dev dev
  # mount --rbind /run run
    (assuming /run exists on the system)
  # chroot /tmp/root.x86_64 /bin/bash

Last edited by STREBLO (2015-06-27 00:55:24)

Offline

#2 2015-04-13 09:14:45

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] Install from existing Linux

You chroot into bootstrapped Arch and from there you mount destination partitions and install onto them Arch (that is, you follow the installation/beginner's guide).

If you have bash 4, you only have to run "/tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/", which takes care of mounting /proc and others.

Offline

#3 2015-04-13 09:54:31

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Install from existing Linux

Ok, i managed to get chrooted in, I just finished the step

# /tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/

Now it says:

sh-4.3# cat README 
To install Arch Linux from another distribution, a root server rescue system or 
a live system, follow the instructions at
https://wiki.archlinux.org/index.php/Install_from_Existing_Linux. A short version
is provided below:

* Make sure your system is running Linux 2.6.32 or later.
* Extract this tarball. If you have enough memory, you can extract it into a 
  tmpfs file system. In the example below, we'll assume that you extracted it in
  /tmp.
* Enter the chroot:
  + If you have bash 4 or later installed, run
    # /tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/
  + If you don't have bash 4, run the following commands:
    # cp /etc/resolv.conf /tmp/root.x86_64/etc
    # mount --rbind /proc /tmp/root.x86_64/proc
    # mount --rbind /sys /tmp/root.x86_64/sys
    # mount --rbind /dev /tmp/root.x86_64/dev
    (if /run exists on your system:
      # mount --rbind /run /tmp/root.x86_64/run
    )
    # chroot /tmp/root.x86_64/
* In the chroot
  + Initialize the pacman keyring:
    # pacman-key --init
    # pacman-key --populate archlinux
  + Mount the destination partition under /mnt
* Follow the Arch Linux installation guide
   https://wiki.archlinux.org/index.php/Installation_Guide#Install_the_base_system
  starting at the "Install the base system" step.

So I guess i'm at the step:

* Follow the Arch Linux installation guide
   https://wiki.archlinux.org/index.php/Installation_Guide#Install_the_base_system
  starting at the "Install the base system" step.

But when I now try to use pacstrap like it says I get:

sh-4.3# pacstrap -i /mnt base base-devel
==> ERROR: /mnt is not a mountpoint!

Am i supposed to change /mnt?

Offline

#4 2015-04-13 10:03:00

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Install from existing Linux

lucke wrote:

You chroot into bootstrapped Arch and from there you mount destination partitions and install onto them Arch (that is, you follow the installation/beginner's guide).

If you have bash 4, you only have to run "/tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/", which takes care of mounting /proc and others.

Wait, what? I' supposed to chroot then mount? I followed Change root and it says:

"The root partition of the Linux system that you are trying to chroot into needs to be mounted first."

So I mounted root, boot and home then I chrooted. Did I screw up? Here's what I did:

 106  mkfs.ext4 /dev/sdd2
  107  mkfs.ext4 /dev/sdd3
  108  mount /dev/sdd2 /mnt/arch
  109  mount /dev/sdd1 /mnt/arch/boot/
  110  mkdir /mnt/arch/boot
  111  mkdir /mnt/arch/home
  112  mount /dev/sdd1 /mnt/arch/boot/
  113  mount /dev/sdd3 /mnt/arch/home/
  121  curl -O https://mirrors.kernel.org/archlinux/iso/2015.03.01/archlinux-bootstrap-2015.03.01-x86_64.tar.gz
  122  cd /tmp
  123  tar xzf /home/john/Computer\ Stuff/Arch/Archie-reinstall/archlinux-bootstrap-2015.03.01-x86_64.tar.gz 
  124  nano /tmp/root.x86_64/etc/pacman.d/mirrorlist
  125  /tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/
sh-4.3# pacstrap -i /mnt base base-devel
==> ERROR: /mnt is not a mountpoint!

Last edited by STREBLO (2015-04-13 10:06:10)

Offline

#5 2015-04-13 10:08:12

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: [SOLVED] Install from existing Linux

If you run from an existing arch installation, then you should be able to do something like this:

pacman -S arch-install-scripts
mkdir -p /mnt/new
mount /dev/sXX /mnt/new
# repeat mkdir, mount as you need
pacstrap -c -G -i /mnt/new base

Edit: The error message in your code is a simple typo. You mount to /mnt/arch, so you'll have to use /mnt/arch in your pacstrap command.

Last edited by progandy (2015-04-13 17:10:09)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2015-04-13 10:30:08

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Install from existing Linux

progandy wrote:

If you run from an existing arch installation, then you should be able to do something like this:

pacman -S arch-install-scripts
mkdir -p /mnt/new
mount /dev/sXX /mnt/new
( mkdir && mount ) *
pacstrap -c -G -i /mnt/new base

Edit: The error message in your code is a simple typo. You mount to /mnt/arch, so you'll have to use /mnt/arch in your pacstrap command.

I tried that, I still got an error hmm

What does ( mkdir && mount ) * do?

Offline

#7 2015-04-13 10:31:31

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] Install from existing Linux

Unpack archlnux-bootstrap and run "ls /tmp/root.x86_64" - you should see a regular Unix directory structure there (/etc, /bin and so on). When you chroot into that, it is as if you were running a live medium. Then you can proceed similarly as you would when using a live medium, thus mount partitions (or partition first), run pacstrap and so on.

Offline

#8 2015-04-13 10:36:54

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Install from existing Linux

lucke wrote:

Unpack archlnux-bootstrap and run "ls /tmp/root.x86_64" - you should see a regular Unix directory structure there (/etc, /bin and so on). When you chroot into that, it is as if you were running a live medium. Then you can proceed similarly as you would when using a live medium, thus mount partitions (or partition first), run pacstrap and so on.

Ohhh, so I did get the order wrong. Why does it say the opposite here ?

Offline

#9 2015-04-13 10:39:37

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] Install from existing Linux

That article is about rescuing Arch - thus you boot from some live medium and chroot into your Arch's installation to fix it.

Offline

#10 2015-04-13 10:54:37

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] Install from existing Linux

Thanks dude, that got it working.

Offline

#11 2015-04-13 12:38:17

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Install from existing Linux

Please remember to mark the thread as solved https://bbs.archlinux.org/viewtopic.php?id=130309

Offline

Board footer

Powered by FluxBB