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

提供: ArchWiki
ナビゲーションに移動 検索に移動
(Kgx がページ「Migrate installation to new hardware」を「ArchWiki:新しいハードウェアに移行する」に移動しました: タイトルを変更)
(→‎新しいシステムで: 翻訳を修正)
 
(2人の利用者による、間の30版が非表示)
1行目: 1行目:
[[Category:System recovery]]
+
[[Category:システムリカバリ]]
 
[[en:Migrate installation to new hardware]]
 
[[en:Migrate installation to new hardware]]
 
[[es:Migrate installation to new hardware]]
 
[[es:Migrate installation to new hardware]]
 
{{Related articles start}}
 
{{Related articles start}}
  +
{{Related|再インストールせずにアーキテクチャを移行}}
{{Related|Migrating between architectures}}
 
{{Related|Moving an existing install into (or out of) a virtual machine}}
+
{{Related|既存環境を仮想マシンに (から) 移動}}
 
{{Related articles end}}
 
{{Related articles end}}
This article discusses the steps required for moving an Arch Linux system to new hardware. The goal is to achieve the same ArchLinux installation, in terms of the installed software and configuration that is independent of the hardware.
 
   
  +
​この記事では、 Arch Linux システムを新しいハードウェアに移動するために必要な手順について説明します。​目標は、ハードウェアに依存しないインストール済みソフトウェアと設定に関して、同じ環境を構築し実現することです。
{{Warning|Some of the following instructions can be dangerous: you are advised to backup all of your important data on the old system before continuing.}}
 
   
  +
{{Warning|次の手順の中には危険なものもあります。続行する前に、重要なデータをすべて古いシステムにバックアップしておくことをお勧めします。}}
There are two different approaches to migrating an installation:
 
   
  +
​インストールの移行には、2つの異なるアプローチがあります:
# ''Bottom to top'': Install a fresh Arch Linux system on the new hardware, afterwards restore the installed packages and configuration files, e.g. as described in [[dotfiles]].
 
# ''Top to bottom'': Clone the old harddrive to the new harddrive, or place the old harddrive into the new system; modify configuration files where necessary.
 
The ''top to bottom'' approach gives a more exact reproduction of the original system than the ''bottom to top'' approach.
 
   
  +
# ''​古いマシンから新しいマシンへ'' :新しいハードウェアに新しい Arch Linux システムをインストールし、インストールしたパッケージと設定ファイルを、例えば [https://wiki.archlinux.jp/index.php/%E3%83%89%E3%83%83%E3%83%88%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB ドットファイル] で記述されているように復元します。
== Adapt to new hardware ==
 
  +
# ​''新しいマシンから古いマシンへ'' :古いハードドライブを新しいハードドライブにクローンするか、古いハードドライブを新しいシステムに配置します。​必要に応じて設定ファイルを変更します。
   
  +
​新しいマシンから古いマシンへのアプローチは、''古いマシンから新しいマシンへ'' のアプローチよりも元のシステムをより正確に再現します。
{{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
 
   
  +
{{Warning|どちらのアプローチでも、古いマシンとのハードウェアの違いを考慮し、それに応じてインストールされているドライバーと設定を変更する必要があります。}}
=== Hard drive vs. SSD ===
 
   
  +
始める前に、新しいハードウェアの側面を調査し、相違リストを作成します。 一般的な違いは
See the article [[SSD]].
 
   
=== CPU vendor ===
+
=== ハードドライブと SSD ===
   
  +
[[SSD]] を参照してください
If you switch the CPU, to a CPU from another vendor (e.g. Intel to AMD), change the [[Microcode]] configuration.
 
   
=== GPU vendor ===
+
=== CPU ベンダー ===
   
  +
CPU を別のベンダーの CPU (Intel から AMD など) に切り替える場合は、[[マイクロコード]] 設定を変更してください。
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 ===
+
=== GPU ベンダー ===
   
  +
GPU を別のベンダーのGPUに変更した場合 ([https://wiki.archlinux.jp/index.php/ATI AMD] から [https://wiki.archlinux.jp/index.php/NVIDIA NVIDIA] など)、グラフィックスドライバーを変更します。
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.
 
   
  +
=== UEFI と MBR のブートコードの起動 ===
== Bottom to top ==
 
   
  +
UEFI を使用してより新しいメインボードに切り替える場合は、"MBR ブートコード" から [[UEFI]] ブートに切り替えることが望ましいか必要な場合があります。 この場合、新しい [[EFI システムパーティション]] が必要です。
=== 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 {{ic|/etc}} and dotfiles in {{ic|/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 ====
 
  +
  +
ここでは、このアプローチをインストールガイドと区別する、古いシステムから新しいシステムに引き継がれる最小限の設定を定義します。新しいシステムにコピーする {{ic|/etc}} の設定成ファイルと {{ic|/home}} のドットファイル、およびユーザーデータファイルについて考えてみます。新しいシステムから古いシステムにアクセスできない場合は、コピーするすべてのファイルをバックアップしてください。
  +
  +
====インストールされているパッケージのリスト====
   
 
$ pacman -Qqen > pkglist.txt
 
$ pacman -Qqen > pkglist.txt
 
$ pacman -Qqem > pkglist_aur.txt
 
$ pacman -Qqem > pkglist_aur.txt
   
  +
リポジトリと [[AUR]] から明示的にインストールされたパッケージの一覧が表示されます。作成する場合は、バックアップに含めてください。
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.
 
   
  +
以下のスクリプトを使って pacman が知らないうちにインストールされたバイナリやライブラリ(例:Steam や Desura 経由、独自のインストール方法でインストールされたもの)の概要を把握することもできます。
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 \
 
find / -regextype posix-extended -regex "/(sys|srv|proc)|.*/\.ccache/.*" -prune -o -type f \
60行目: 62行目:
 
done
 
done
   
==== pacman cache ====
+
==== pacman キャッシュ====
   
  +
アーキテクチャを変更しない場合(たとえば、x86 から​ ​x86_64 )は、 {{ic|/var/cache/pacman/pkg/}} のバックアップを検討してください。
Consider backing up {{ic|/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 ====
+
==== インストールガイド前半 ====
   
  +
新しいシステムのインストールの基本については、[[インストールガイド]] を参照してください。 pacstrap コマンドを除いて、インストールガイドの前半に従ってください。
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 ====
+
==== pacman キャッシュをコピーする ====
   
  +
{{ic|/var/cache/pacman/pkg/}} にある pacman キャッシュを古いシステムから新しいシステムに、またはバックアップから新しいシステムにコピーします。
Copy the pacman cache found at {{ic|/var/cache/pacman/pkg/}} from the old to the new system, or from the backup to the new system.
 
   
==== Installation guide second half ====
+
==== インストールガイド後半 ====
   
  +
pacstrap コマンドを含めてインストールガイドを最後まで続けますが、再起動はしないでください。pacstrap コマンドはパッケージのインストール以外に追加の作業を行うため、スキップしないでください。
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 ====
 
   
  +
pkglist.txt (および pkglist_aur.txt) を編集し、新しいシステムで不要なドライバーを削除します。次に、以前にインストールされた他のソフトウェアをインストールします
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
 
# pacman -S --needed - < pkglist.txt
   
  +
== 新しいマシンから古いマシンへ ==
== Top to bottom ==
 
  +
  +
新しいマシンから古いマシンへのアプローチには2つのオプションがあります。システムがすでにインストールされているドライブを保持してその内容を変更するか、システムを新しいドライブにコピーすることができます。ドライブを保持し、変更してから古いシステムに戻すと、変更によって古いシステムが起動できなくなる可能性があります。
   
  +
=== 古いシステムをクリーンアップします ===
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.
 
   
  +
[https://wiki.archlinux.jp/index.php/%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E3%83%A1%E3%83%B3%E3%83%86%E3%83%8A%E3%83%B3%E3%82%B9#.E3.83.95.E3.82.A1.E3.82.A4.E3.83.AB.E3.82.B7.E3.82.B9.E3.83.86.E3.83.A0.E3.81.AE.E6.8E.83.E9.99.A4 ファイルシステムの掃除] で説明されているように、クローンを作成する前にシステムをクリーンアップすることも価値があります。クリーンアップ後、先に進む前に、古いシステムが引き続き期待どおりに機能していることを確認してください。
=== 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.
 
   
  +
{{Note|システムがすでにインストールされている場所にハードドライブを保持することを計画している場合は、このセクションをスキップできます。}}
=== Copy the system to a new drive ===
 
   
  +
システムを新しいドライブにコピーするには、[[ディスクのクローン]] とファイルコピーの2つの基本的な方法があります。
{{Note|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.
 
   
  +
古い ArchLinux システムではなく、ライブ Linux システムを使用する必要があります。たとえば、Arch Linux [[USB インストールメディア]] を使用できます。古いシステムのパーティションレイアウトとファイルシステムが再現されます。
==== 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 ====
 
  +
* ファイルシステムごとに、 [[rsync]] または権限や属性などを保持するその他のツールを使用して、古いドライブから新しいドライブにファイルをコピーします。[[rsync#システムのフルバックアップ]]、 [[rsync#ファイルシステムのクローニング]] を参照してください。
   
  +
==== トランスポートオプション ====
* Create new [[partitions]] and [[filesystems]] on the new drive. You can use the opportunity to chose a different partition layout and/or filesystems than before.
 
* For each filesystem, copy the files from the old to the new drive, using [[rsync]] or other tools that preserve permissions, attributes, etc., see [[rsync#Full system backup]], [[rsync#File system cloning]] for further details.
 
   
  +
2つのドライブ間でデータを転送する方法には、さまざまな方法があります。
==== Transport options ====
 
   
  +
*オリジン HDD とデスティネーション HDD を同じコンピューター (古いコンピューターまたは新しいコンピューター) に接続します。データリンク:古い HDD -> コンピューター -> 新しい HDD。
There are many different methods for how to transport the data between the two drives:
 
  +
*外付け HDD やクラウドバックアップなどの一時ストレージデバイスを利用します。データリンク:古い HDD -> 古いコンピューター -> ストレージ -> 新しいコンピューター -> 新しい HDD。概要については、記事 [https://wiki.archlinux.jp/index.php/Rsync_%E3%81%AB%E3%82%88%E3%82%8B%E3%83%95%E3%83%AB%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E3%83%90%E3%83%83%E3%82%AF%E3%82%A2%E3%83%83%E3%83%97 システムバックアップ] を参照してください。
  +
* [[rsync]] などを使用して、ネットワーク経由でデータを転送します。データリンク:古い HDD -> 古いコンピューター -> ネットワーク -> 新しいコンピューター -> 新しい HDD。
   
  +
最初の2つのオプションについては、HDD を接続するためのアダプター (PATA -> SATA、USB-HDD-Cases など) が必要になる可能性があることを考慮し、十分に高速な接続を選択してください。
* 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.
 
   
  +
最後の2つのオプションでは、この時点では新しいハードドライブから起動できないため、新しいコンピューターでライブ Linux システムを使用する必要があります。
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.
 
   
  +
=== fstab の更新 ===
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.
 
 
=== Update fstab ===
 
   
  +
{{Warning|
{{Warning|Before doing this step please make sure that you do not wish to use this drive in the old system, as changing the [[fstab]] file will likely prevent the system from booting in the old configuration.}}
 
  +
* この手順を実行する前に、古いシステムでこのドライブを使用しないようにしてください。 fstab ファイルを変更すると、古い構成でシステムが起動しなくなる可能性があります。
  +
* [[ディスクのクローン]] を使用し、複製元のドライブと同じマシンで最近複製したドライブを使用している場合、パーティションテーブルの UUID、パーティションの UUID、およびファイルシステムの UUID がドライブ間で競合を引き起こします。複製されたドライブのこれらすべてを新しいランダム値に変更してください。GPT とそのパーティションには、[[GPT fdisk#パーティションテーブルのバックアップとリストア|sgdisk]] を使用し、ファイルシステムには [[ファイルシステム#ファイルシステムのタイプ|適切なユーザースペースユーティリティ]] を使用します。}}
   
  +
​Arch Linux インストールイメージを使用している場合は、新しいルートパーティションを /mnt にマウントし、通常のインストールと同様に必要な他のパーティションをマウントします [[インストールガイド#ファイルシステムのマウント|ファイルシステムのマウント]] を参照してください。
If you are using an Arch Linux Installation Image, mount the new root partition to {{ic|/mnt}}, and any other partitions required like you would in a normal install (see [[Installation guide#Mount the file systems]]).
 
   
  +
​{{ic|/mnt/etc/fstab}} の最後に、{{ic|#end of old fstab}} のような任意のコメントを挿入します。 [[インストールガイド#fstab の生成|fstab]] に記載されているように、新しい fstab ファイルを生成し、現在の fstab ファイルに追加します。​一般に、 genfstab によって作成された fstab ファイルは必ず確認してください。​この場合、コメントの前に古い fstab エントリをチェックし、それらが古くなっているか重複しているかを確認してから削除し、古いエントリが残っている場合は残しておきます。​たとえば、ネットワークドライブのマウントエントリを保持できます。​一般に、[[永続的なブロックデバイスの命名]] を使用することをお勧めします。
Insert an arbitrary comment such as {{ic|#end of old fstab}} at the end of your {{ic|/mnt/etc/fstab}}. Generate a new fstab file as indicated on [[Installation guide#Fstab]], appending it to the current fstab file. In general, always review the fstab file created by genfstab. In this case, check the older fstab entries before the comment, if they are outdated or duplicates then delete them, and if the old entries remain useful then keep them. For example, mount entries for network drives can be kept. In general it is recommended to use [[Persistent block device naming]].
 
   
  +
=== ブートローダーを再インストールします ===
=== 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
 
  +
* [[UEFI]] ブートエントリを新しいメインボード NVRAM に追加
* Adding [[UEFI]] boot entries into the new mainboard NVRAM
 
  +
* "MBR ブートコード" ブートから UEFI ブートへの移行
* Migration from "MBR boot code" booting to UEFI booting
 
* Migration from USB to SATA/NVMe
+
* USB からSATA/NVMe への移行
  +
* カーネルコマンドラインの更新
* Updating the kernel commandline
 
  +
** 異なる GPU の場合は、フレームバッファーモードを更新します
** In case of a different GPU, update the framebuffer mode
 
** Update the [[Microcode]] initramfs image
+
** [[マイクロコード]] initramfs イメージを更新します
   
  +
Arch Linux ライブ環境を使用している場合は、ブートローダーを再インストールする前に、[https://wiki.archlinux.jp/index.php/Chroot changeroot] を新しいシステムにインストールします。
If you are using a Arch Linux live environment, then before reinstalling the boot loader, [[change root]] into the new system:
 
   
 
# arch-chroot /mnt
 
# arch-chroot /mnt
   
  +
(再)インストールする方法については、[[ブートローダー]] の記事を参照してください。
Refer to the article on your [[boot loader]] for instructions on how to (re)install it.
 
   
  +
=== カーネルイメージを再生成します ===
=== Regenerate kernel image ===
 
   
  +
[[mkinitcpio]] を使用して initramfs イメージを再生成することをお勧めしますが、最初はフォールバック initramfs イメージが機能する場合があります。
It is recommended to regenerate the initramfs image with [[mkinitcpio]], although initially the fallback initramfs image may work.
 
   
  +
=== オーディオを再構成します ===
=== Reconfigure audio ===
 
   
 
* alsamixer volume
 
* alsamixer volume
  +
** 設定を保存する
** save settings
 
   
  +
=== ネットワークを再構成します ===
=== Reconfigure network ===
 
   
  +
古いインストールと移行されたインストールが同じネットワーク内に共存する場合は、[[ネットワーク設定#ホスト名の設定|hostnamectl]] を使用して新しいホスト名を設定します。
If the old installation and the migrated installation shall coexist in the same network, set a new hostname with [[Network configuration#Set the hostname|hostnamectl]].
 
   
  +
ホスト名の変更後に必要となる設定変更についても考慮してください。
Also consider configuration changes that are required after a change in hostname:
 
   
* /etc/hosts
+
* {{ic|/etc/hosts}}
* other apps using hostname: synergy, nut (network ups tools)
+
* ホスト名を使用する他のアプリケーション: synergynut (network ups ツール)
  +
* (root ユーザーとして) {{Ic|grep -Ri 'hostname' /etc}} は、更新するファイルに関するヒントを提供します。
* {{Ic|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.
 
   
* {{ic|$ dmesg {{!}} grep 'renamed from eth'}} might help to find the new interface name
+
# journalctl -k --grep='renamed from eth'
* remove old: [[disable]] {{ic|dhcpcd@enp''X''s0.service}}
 
* activate new: [[enable]] {{ic|dhcpcd@enp''X''s0.service}}
 
   
== See also ==
+
== 参照 ==
   
 
* [http://positon.org/clone-a-linux-system-install-to-another-computer Howto clone a linux system]
 
* [http://positon.org/clone-a-linux-system-install-to-another-computer Howto clone a linux system]
* [https://bbs.archlinux.org/viewtopic.php?id=71038]
+
* [https://bbs.archlinux.org/viewtopic.php?id=71038 Copy Arch Install to new PC? フォーラムスレッド]
* [https://bbs.archlinux.org/viewtopic.php?pid=543214]
+
* [https://bbs.archlinux.org/viewtopic.php?pid=543214 Install on HD for transplant into another machine? フォーラムスレッド]

2023年12月27日 (水) 09:09時点における最新版

関連記事

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

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

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

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

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

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

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

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

ハードドライブと SSD

SSD を参照してください

CPU ベンダー

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

GPU ベンダー

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

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

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

古いマシンから新しいマシンへ

古いシステムの場合

ここでは、このアプローチをインストールガイドと区別する、古いシステムから新しいシステムに引き継がれる最小限の設定を定義します。新しいシステムにコピーする /etc の設定成ファイルと /home のドットファイル、およびユーザーデータファイルについて考えてみます。新しいシステムから古いシステムにアクセスできない場合は、コピーするすべてのファイルをバックアップしてください。

インストールされているパッケージのリスト

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

リポジトリと AUR から明示的にインストールされたパッケージの一覧が表示されます。作成する場合は、バックアップに含めてください。

以下のスクリプトを使って pacman が知らないうちにインストールされたバイナリやライブラリ(例:Steam や Desura 経由、独自のインストール方法でインストールされたもの)の概要を把握することもできます。

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 キャッシュ

アーキテクチャを変更しない場合(たとえば、x86 から​ ​x86_64 )は、 /var/cache/pacman/pkg/ のバックアップを検討してください。

新しいシステムについて

インストールガイド前半

新しいシステムのインストールの基本については、インストールガイド を参照してください。 pacstrap コマンドを除いて、インストールガイドの前半に従ってください。

pacman キャッシュをコピーする

/var/cache/pacman/pkg/ にある pacman キャッシュを古いシステムから新しいシステムに、またはバックアップから新しいシステムにコピーします。

インストールガイド後半

pacstrap コマンドを含めてインストールガイドを最後まで続けますが、再起動はしないでください。pacstrap コマンドはパッケージのインストール以外に追加の作業を行うため、スキップしないでください。

以前にインストールしたソフトウェアをインストールする

pkglist.txt (および pkglist_aur.txt) を編集し、新しいシステムで不要なドライバーを削除します。次に、以前にインストールされた他のソフトウェアをインストールします

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

新しいマシンから古いマシンへ

新しいマシンから古いマシンへのアプローチには2つのオプションがあります。システムがすでにインストールされているドライブを保持してその内容を変更するか、システムを新しいドライブにコピーすることができます。ドライブを保持し、変更してから古いシステムに戻すと、変更によって古いシステムが起動できなくなる可能性があります。

古いシステムをクリーンアップします

ファイルシステムの掃除 で説明されているように、クローンを作成する前にシステムをクリーンアップすることも価値があります。クリーンアップ後、先に進む前に、古いシステムが引き続き期待どおりに機能していることを確認してください。

システムを新しいドライブにコピーします

ノート: システムがすでにインストールされている場所にハードドライブを保持することを計画している場合は、このセクションをスキップできます。

システムを新しいドライブにコピーするには、ディスクのクローン とファイルコピーの2つの基本的な方法があります。

ディスクのクローン作成

古い ArchLinux システムではなく、ライブ Linux システムを使用する必要があります。たとえば、Arch Linux USB インストールメディア を使用できます。古いシステムのパーティションレイアウトとファイルシステムが再現されます。

ファイルのコピー

トランスポートオプション

2つのドライブ間でデータを転送する方法には、さまざまな方法があります。

  • オリジン HDD とデスティネーション HDD を同じコンピューター (古いコンピューターまたは新しいコンピューター) に接続します。データリンク:古い HDD -> コンピューター -> 新しい HDD。
  • 外付け HDD やクラウドバックアップなどの一時ストレージデバイスを利用します。データリンク:古い HDD -> 古いコンピューター -> ストレージ -> 新しいコンピューター -> 新しい HDD。概要については、記事 システムバックアップ を参照してください。
  • rsync などを使用して、ネットワーク経由でデータを転送します。データリンク:古い HDD -> 古いコンピューター -> ネットワーク -> 新しいコンピューター -> 新しい HDD。

最初の2つのオプションについては、HDD を接続するためのアダプター (PATA -> SATA、USB-HDD-Cases など) が必要になる可能性があることを考慮し、十分に高速な接続を選択してください。

最後の2つのオプションでは、この時点では新しいハードドライブから起動できないため、新しいコンピューターでライブ Linux システムを使用する必要があります。

fstab の更新

警告:
  • この手順を実行する前に、古いシステムでこのドライブを使用しないようにしてください。 fstab ファイルを変更すると、古い構成でシステムが起動しなくなる可能性があります。
  • ディスクのクローン を使用し、複製元のドライブと同じマシンで最近複製したドライブを使用している場合、パーティションテーブルの UUID、パーティションの UUID、およびファイルシステムの UUID がドライブ間で競合を引き起こします。複製されたドライブのこれらすべてを新しいランダム値に変更してください。GPT とそのパーティションには、sgdisk を使用し、ファイルシステムには 適切なユーザースペースユーティリティ を使用します。

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

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

ブートローダーを再インストールします

次の理由により、ブートローダー を再インストールまたは再構成する必要がある場合があります。

  • 異なるディスク、パーティションレイアウト、またはファイルシステム
  • UEFI ブートエントリを新しいメインボード NVRAM に追加
  • "MBR ブートコード" ブートから UEFI ブートへの移行
  • USB からSATA/NVMe への移行
  • カーネルコマンドラインの更新
    • 異なる GPU の場合は、フレームバッファーモードを更新します
    • マイクロコード initramfs イメージを更新します

Arch Linux ライブ環境を使用している場合は、ブートローダーを再インストールする前に、changeroot を新しいシステムにインストールします。

# arch-chroot /mnt

(再)インストールする方法については、ブートローダー の記事を参照してください。

カーネルイメージを再生成します

mkinitcpio を使用して initramfs イメージを再生成することをお勧めしますが、最初はフォールバック initramfs イメージが機能する場合があります。

オーディオを再構成します

  • alsamixer volume
    • 設定を保存する

ネットワークを再構成します

古いインストールと移行されたインストールが同じネットワーク内に共存する場合は、hostnamectl を使用して新しいホスト名を設定します。

ホスト名の変更後に必要となる設定変更についても考慮してください。

  • /etc/hosts
  • ホスト名を使用する他のアプリケーション: synergy、nut (network ups ツール)
  • (root ユーザーとして) grep -Ri 'hostname' /etc は、更新するファイルに関するヒントを提供します。

ネットワークインターフェイス名は変更される可能性があり、ネットワークマネージャ の設定にハードコーディングされている場合は、その設定を更新する必要があります。次のコマンドを使用して、新しいネットワークインターフェイス名を確認します。

# journalctl -k --grep='renamed from eth'

参照