自宅の Windows と Linux を共存させている PC で再起動時にブートがうまく行かない現象に悩まされています。
(この PC には M.2 と SSD を計 3つ積んでいて、基本的には Grub でブートデバイスを切り替えている)
具体的には、Windows で再起動するとなんか成功しない。メーカーロゴで止まる。
Ctrl+Alt+Delete で強制再起動すると、何事もなかったように起動するけど、面倒。
ふとしたきっかけで、USB メモリに入れた Linux をブートして、その Grub でブートデバイスを選ぶように変えようと思いました...
※この記事は、Slax Linux を USBメモリに入れるまでの話。
要件
- 1GB の USB に入る Linux
高速な USBメモリの手持ちががこれしかない。 - systemd を採用
もう SysVinit 覚えてない。
Slax Linux
で、白羽の矢が立ったのが Slax Linux 。
Slax based on Debian LInux と Slax based on Slackware Linux に分かれており、普段使っている Debian 版を選定。
なお、他に検討したのは以下の OS。
(過去使ったことはあるけども、いずれも systemd ではなかったので今回見送り)
-
Puppy
Puppy Linux Home -
Plamo Linux
plamolinux.org
Download
なんか分かりづらいけども、トップページからダウンロードできた。
※ダウンロードにはメールアドレスが必要。
Slax Linux - your pocket operating system
- Slax based on Slackware Linux
- Slax based on Debian Linux
- 64bit
- 32bit
※メールに送られてくるリンクで slax-64bit-debian-12.2.0.iso がダウンロードできた。
(今回は Slax based on Debian を選択)
設定
マウント
/media/cdrom を使ってないので間借り。
$ sudo mount -o loop /home/{username}/ダウンロード/slax-64bit-debian-12.2.0.iso /media/cdrom
mount: /media/cdrom0: WARNING: source write-protected, mounted read-only.
$ ls /media/cdrom
readme.txt slax
USB ブート設定
readme.txt 確認すると、USB 起動設定の手順が記載されている。
(USB にコピーして、ブート設定する)
/slax/ディレクトリ全体をUSBドライブにコピ- 次にUSBドライブの
/slax/boot/ディレクトリに移動 - ブートディレクトリにいる間にファイル
bootinst.batダブルクリックで実行
※bootinst.shも用意されているので、Linux はこちらを実行。
$ cat /media/cdrom/readme.txt
Thank you for using slax!
If you are reading this from a CD, it is already bootable.
Steps to make it bootable from your USB device are following:
1) Copy the entire /slax/ directory to your USB drive.
If you are using Windows, you will get for example E:\slax\
You probably already did this - just make sure you are on your
USB drive now and not on your local harddisk.
2) Now navigate to directory /slax/boot/ on your USB drive.
In Windows, it will be E:\slax\boot\ for example.
Use explorer or any other file manager for this task.
3) While you're in the boot directory, locate file bootinst.bat
Run it by doubleclicking it. It will setup your USB to boot.
-- That's it. Your USB device is now ready to boot slax.
-- You can safely delete this file (readme.txt), it's not needed.
- Windows 用の
bootinst.batと Linux 用のbootinst.shが用意されている$ cd /media/{username}/slax_usb/slax/boot/ $ sudo sh bootinst.sh $ ls /media/{username}/slax/slax/boot/ | grep bootinst bootinst.bat bootinst.sh
USB にコピーした後、移動してシェル実行すると、必要なファイル群が設置される。
$ cd /media/{username}/slax_usb/slax/boot/
$ sudo sh bootinst.sh
$ ls -1 /media/{username}/slax_usb/EFI/Boot/
bootx64.efi
ldlinux.e64
libcom32.c32
libutil.c32
menu.c32
syslinux.cfg
syslinux.efi
vesamenu.c32
この USB メモリを使うと Slack がブートされる。
なんと、GUI だった...
あと、見たところ、以前あったと思われる Slax Software Center がなくなっている模様。
アプリの追加導入はソースコンパイルしかないのだろうか?
と思ったら、今回ダウンロードしたのは Slax based on Debian なので apt をサポートしている模様。嬉しい。
Customize - Slax Linux
Adding software with apt
Slax based on Debian fully supports apt command, which is a powerful command-line tool suitable for tasks such as installation of new software packages or upgrading of existing ones.
Adding software with slackpkg
Slax based on Slackware supports slackpkg command with slackpkg+ extension, which provides the ability to install precompiled software from official Slackware repository as well as several other unofficial repositories, especially slackonly repo which includes precompiled packages created for slackbuilds.org.
続きは後日。