LoginSignup
2

More than 5 years have passed since last update.

PIXEL for PC を内蔵HDDからブート

Posted at

raspbianOSであるPIXELのHDDへのインストール方法。

公式からの引用だと

  1. Boot it from USB/DVD
  2. Transfer the entire stick to your drive:
    1. “sudo bash”
    2. “dd if=/dev/sdb of=/dev/sda bs=1M”
  3. Reboot without the stick, should boot from internal HDD_
    1. “reboot”
  4. Resize the Partition:
    1. “sudo bash”
    2. “fdisk /dev/sda”
    3. print partitions with “p”
    4. write down the beginning of partition 2
    5. delete partition 2 with “d”, then “2”
    6. create a new parition with “n”, primary partition, starting at the location from 4.4
    7. write with “w”
  5. Reboot:
    1. “reboot”
  6. Resize the filesystem on /dev/sda2 to fill the disk:
    1. “sudo bash”
    2. “resize2fs /dev/sda2”

ということで順にやってみる。

PIXELは公式からisoで落としてUSBメモリに入れた前提です。

まずはインストール先のPCをUSBから起動する設定にします。電源入れてからF2とかDELとかのあれ。

無事起動したらターミナルを開きます。起動しなかった人は大体はUSBメモリへの入れ方が間違えてます。

いきなりddコマンドは超怖いのでとりあえずsudo fdisk -lあたりでディスクを調べます。

Disk /dev/sda: ディスク容量 GiB, ・・・ bytes, ・・・ sectors

こんな表示と

Disk /dev/sdb: ディスク容量 GiB, ・・・ bytes, ・・・ sectors

がでたら容量でどちらがUSBメモリか判断します。そうじゃない方がHDDです。
だいたいsdbがUSBメモリのはず。

んで無事上記のとおりだったらdd if=/dev/sdb of=/dev/sda bs=1Mでsdbをsdaにクローンします。

当然HDDの中身は消えます。お気に入り動画は避難しておきましょう。

無事完了したら、とりあえず起動できる形です。パーティションサイズも同じでいいなら終了。閉廷。
USBメモリ抜いてHDDから起動で終わりです。

パーティションサイズを変更したい人はfdisk /dev/sdaでfdiskに入ります。

pを入力しエンター。/dev/sda2の次の数字をメモ。私は2709504でした。
dを入れてパーティション2を選ぶとパーティション2が消えます。
nで新しくパーティションを作ります。プライマリpで。パーティション番号は2。
開始位置はpを押したときにメモした数字です。

wでパーティションを書き込みます。exitしてsudo rebootで再起動。

再起動後resize2fs /dev/sda2でフィニッシュです。

古いパソコンにインストールしたんだが、メモリが少ないと動作が厳しいです。
特にブラウザ。重い。。。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2