「新しいハードウェアに移行する」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(前段を翻訳)
17行目: 17行目:
 
​上から下へのアプローチは、''下から上へ'' のアプローチよりも元のシステムをより正確に再現します。
 
​上から下へのアプローチは、''下から上へ'' のアプローチよりも元のシステムをより正確に再現します。
   
  +
== 新しいハードウェアに適応 ==
== Adapt to new hardware ==
 
   
  +
{{Warning|どちらのアプローチでも、古いものとハードウェアの違いを考慮し、それに応じてインストールされているドライバーと構成を変更する必要があります。}}
{{Warning|For both approaches we have to account for differences between the old and hardware and change the installed drivers and configuration accordingly.}}
 
   
  +
始める前に、新しいハードウェアの側面を調査し、違いのリストを作成します。 一般的な違いは
Before you begin, research aspects of the new hardware and make a list of differences. Common differences are
 
   
=== Hard drive vs. SSD ===
+
=== ハードドライブと SSD ===
   
  +
[[SSD]] を参照してください
See the article [[SSD]].
 
   
=== CPU vendor ===
+
=== CPU ベンダー ===
   
  +
CPU を別のベンダーの CPU(Intel から AMD など)に切り替える場合は、[[マイクロコード]] 構成を変更してください。
If you switch the CPU, to a CPU from another vendor (e.g. Intel to AMD), change the [[Microcode]] configuration.
 
   
=== GPU vendor ===
+
=== GPU ベンダー ===
   
  +
GPU を別のベンダーのGPUに変更した場合([https://wiki.archlinux.jp/index.php/ATI AMD] から [https://wiki.archlinux.jp/index.php/NVIDIA NVIDIA] など)、グラフィックスドライバーを変更します。
If you changed the GPU to a GPU from another vendor (e.g. from [[Amd]] to [[NVIDIA]]) change the graphics driver.
 
   
=== UEFI vs. MBR boot code booting ===
+
=== UEFI MBR のブートコードの起動 ===
   
  +
UEFI を使用してより新しいメインボードに切り替える場合は、"MBR ブートコード" ブートから [[UEFI]] ブートに切り替えることが望ましいか必要な場合があります。 この場合、新しい [https://wiki.archlinux.jp/index.php/EFI_%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E3%83%91%E3%83%BC%E3%83%86%E3%82%A3%E3%82%B7%E3%83%A7%E3%83%B3 EFIシステムパーティション] が必要です。
If you switch to a more recent mainboard with UEFI, it might be preferable or required to switch from "MBR boot code" booting to [[UEFI]] booting. In this case a new [[EFI system partition]] is needed.
 
   
 
== Bottom to top ==
 
== Bottom to top ==

2020年12月4日 (金) 03:04時点における版

関連記事

​この記事では、 Arch Linux システムを新しいハードウェアに移動するために必要な手順について説明します。​目標は、ハードウェアに依存しないインストール済みソフトウェアと構成に関して、同じ ArchLinux インストールを実現することです。

警告: 次の手順の中には危険なものもあります。続行する前に、重要なデータをすべて古いシステムにバックアップしておくことをお勧めします。

​インストールの移行には、2つの異なるアプローチがあります:

  1. ​下から上へ :新しいハードウェアに新しい Arch Linux システムをインストールし、インストールしたパッケージと設定ファイルを、例えば ドットファイル で記述されているように復元します。
  2. 上から下へ :古いハードドライブを新しいハードドライブにクローンするか、古いハードドライブを新しいシステムに配置します。​必要に応じて構成ファイルを変更します。

​上から下へのアプローチは、下から上へ のアプローチよりも元のシステムをより正確に再現します。

新しいハードウェアに適応

警告: どちらのアプローチでも、古いものとハードウェアの違いを考慮し、それに応じてインストールされているドライバーと構成を変更する必要があります。

始める前に、新しいハードウェアの側面を調査し、違いのリストを作成します。 一般的な違いは

ハードドライブと SSD

SSD を参照してください

CPU ベンダー

CPU を別のベンダーの CPU(Intel から AMD など)に切り替える場合は、マイクロコード 構成を変更してください。

GPU ベンダー

GPU を別のベンダーのGPUに変更した場合(AMD から NVIDIA など)、グラフィックスドライバーを変更します。

UEFI と MBR のブートコードの起動

UEFI を使用してより新しいメインボードに切り替える場合は、"MBR ブートコード" ブートから UEFI ブートに切り替えることが望ましいか必要な場合があります。 この場合、新しい EFIシステムパーティション が必要です。

Bottom to top

On the old system

We define here a minimal configuration that carries over from the old to the new system which differentiates this approach from the Installation guide. Think about the configuration files from /etc and dotfiles in /home that you want to copy to the new system, as well as user data files. If you will not have access to the old system from the new system then backup up all the files that you want to copy over.

List of installed packages

$ pacman -Qqen > pkglist.txt
$ pacman -Qqem > pkglist_aur.txt

gives you a nice list of explicitly installed packages from the repositories and from the AUR. Include it in your backup if you make one.

You may also use the following script to give you a better overview of the binaries and libraries installed unbeknownst to pacman (e. g. installed via Steam, Desura or using their own install methods):

find / -regextype posix-extended -regex "/(sys|srv|proc)|.*/\.ccache/.*" -prune -o -type f \
-exec bash -c 'file "{}" | grep -E "(32|64)-bit"' \; | \
awk -F: '{print $1}' | \
while read -r bin; \
do pacman -Qo "$bin" &>/dev/null || echo "$bin"; \
done

pacman cache

Consider backing up /var/cache/pacman/pkg/ if you do not change architectures (for example from x86 to x86_64).

On the new system

Installation guide first half

For basics about installing a new system, refer to the Installation guide. Follow the first half of the installation guide up to but excluding the pacstrap command.

Copy pacman cache

Copy the pacman cache found at /var/cache/pacman/pkg/ from the old to the new system, or from the backup to the new system.

Installation guide second half

Continue with the installation guide from, and including the pacstrap command, up to the end, but do not reboot. Do not skip the pacstrap command as it does additional work besides the installation of packages.

Install previously installed software

Edit pkglist.txt (and pkglist_aur.txt) and remove drivers that are not needed on the new system. Then install any other previously installed software with

# pacman -S --needed - < pkglist.txt

Top to bottom

There are two options for the Top to Bottom approach, you can either keep the drive where the system is already installed, and modify its contents, or you can copy the system to a new drive. If you keep the drive, and modify it, then place it back into the old system, the modifications will likely prevent the old system from booting.

Clean up the old system

It is also worth to clean up your system before cloning it, as described in System maintenance#Clean the filesystem. Make sure that the old system is still working as expected after the cleanup before moving on.

Copy the system to a new drive

ノート: If you are planning to keep the hard drive where the system is already installed, you can skip this section.

There are two fundamental methods for copying the system to a new drive, disk cloning and file copying.

Disk cloning

It is required to use a live linux system rather than the old Arch Linux system; for example you could use the Arch Linux USB flash installation media. The partition layout and filesystems of the old system will be reproduced.

File copying

Transport options

There are many different methods for how to transport the data between the two drives:

  • Connect origin and destination HDDs to the same computer, either the old or the new one. Data link: old HDD -> computer -> new HDD.
  • Make use of temporary storage devices like external HDDs, or cloud backups. Data link: old HDD -> old computer -> storage -> new computer -> new HDD. For an overview see the article System backup.
  • Transfer data over network, for example with rsync. Data link: old HDD -> old computer -> network -> new computer -> new HDD.

For the first two options, consider that you might need adapters to connect the HDDs (PATA->SATA, USB-HDD-Cases, etc.), and choose a connection that is sufficiently fast.

The last two options require you to use a live linux system on the new computer, as it is not possible to boot from the new hard drive at this point.

fstab の更新

警告: この手順を実行する前に、古いシステムでこのドライブを使用しないようにしてください。 fstab ファイルを変更すると、古い構成でシステムが起動しなくなる可能性があります。

​Arch Linux インストールイメージを使用している場合は、新しいルートパーティションを /mnt にマウントし、通常のインストールと同様に必要な他のパーティションをマウントします ファイルシステムのマウント を参照してください。)

/mnt/etc/fstab の最後に、#end of old fstab のような任意のコメントを挿入します。 fstab に記載されているように、新しい fstab ファイルを生成し、現在の fstab ファイルに追加します。​一般に、 genfstab によって作成された fstab ファイルは必ず確認してください。​この場合、コメントの前に古い fstab エントリをチェックし、それらが古くなっているか重複しているかを確認してから削除し、古いエントリが残っている場合は残しておきます。​たとえば、ネットワークドライブのマウントエントリを保持できます。​一般に、永続的なブロックデバイスの命名 を使用することをお勧めします。

Reinstall the boot loader

You might need to reinstall and/or reconfigure the boot loader for the following reasons:

  • Different disks, partition layout, or filesystem
  • Adding UEFI boot entries into the new mainboard NVRAM
  • Migration from "MBR boot code" booting to UEFI booting
  • Migration from USB to SATA/NVMe
  • Updating the kernel commandline
    • In case of a different GPU, update the framebuffer mode
    • Update the Microcode initramfs image

If you are using a Arch Linux live environment, then before reinstalling the boot loader, change root into the new system:

# arch-chroot /mnt

Refer to the article on your boot loader for instructions on how to (re)install it.

Regenerate kernel image

It is recommended to regenerate the initramfs image with mkinitcpio, although initially the fallback initramfs image may work.

Reconfigure audio

  • alsamixer volume
    • save settings

Reconfigure network

If the old installation and the migrated installation shall coexist in the same network, set a new hostname with hostnamectl.

Also consider configuration changes that are required after a change in hostname:

  • /etc/hosts
  • other apps using hostname: synergy, nut (network ups tools)
  • grep -Ri 'hostname' /etc (as the root user)should give some hints on the files to be updated

The network interface names may change when using dhcpcd with named network interfaces.

  • $ dmesg | grep 'renamed from eth' might help to find the new interface name
  • remove old: disable dhcpcd@enpXs0.service
  • activate new: enable dhcpcd@enpXs0.service

See also