MochiuWiki : SUSE, EC, PCB
案内
メインページ
最近の更新
おまかせ表示
MediaWiki についてのヘルプ
ツール
リンク元
関連ページの更新状況
特別ページ
ページ情報
We ask for
Donations
検索
個人用ツール
ログイン
Toggle dark mode
名前空間
ページ
議論
表示
閲覧
ソースを閲覧
履歴を表示
SSDからRaspbianを起動する方法のソースを表示
提供: MochiuWiki : SUSE, EC, PCB
←
SSDからRaspbianを起動する方法
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループのいずれかに属する利用者のみが実行できます:
管理者
、new-group。
このページのソースの閲覧やコピーができます。
== 概要 == <br><br> == SDカード必要 SSD起動ディスク化 == ===== デバイス名の確認 ===== 以下のコマンドを実行する。<br> sudo fdisk -l | grep /dev/sda --結果-- Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 2048 3656250 3654203 1.8G e W95 FAT16 (LBA) /dev/mmcblk0p2 3656251 123494399 119838149 57.1G 5 Extended /dev/mmcblk0p5 3661824 3727357 65534 32M 83 Linux /dev/mmcblk0p6 3727360 3868671 141312 69M c W95 FAT32 (LBA) /dev/mmcblk0p7 3874816 123494399 119619584 57G 83 Linux Disk /dev/sda: 111.8 GiB, 120034121728 bytes, 234441644 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x3d0e23d3 <br> ===== パーティションの作成 ===== SSDのパーティションを作成するため、以下のコマンドを実行する。<br> sudo fdisk /dev/sda <br> 続いて、以下のように入力していく。<br> # パーティションテーブルの設定を行う sudo fdisk /dev/sda # d でパーティションを削除する Command (m for help): d Selected partition 1 Partition 1 has been deleted. # p で現在の状態を確認 Command (m for help): p Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: F3BA4D9C-C2F7-43FF-837C-D3BFBFBF5C1D # n でパーティションを作成(何も入力しない場合は全てデフォルトとなる) Command (m for help): n Partition number (1-128, default 1): 1 First sector (34-7814037134, default 2048): 2048 Last sector, +sectors or +size{K,M,G,T,P} (2048-7814037134, default 7814037134): Created a new partition 1 of type 'Linux filesystem' and of size 3.7 TiB. # p で作成したパーティションを確認する Command (m for help): p Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: F3BA4D9C-C2F7-43FF-837C-D3BFBFBF5C1D Device Start End Sectors Size Type /dev/sda1 2048 7814037134 7814035087 3.7T Linux filesystem # w で変更を書き込む Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. <br> ===== 作成したパーティションの確認 ===== 上記で作成したパーティションを確認するため、以下のコマンドを実行する。<br> sudo fdisk -l --結果-- ...省略 Disk /dev/sda: 111.8 GiB, 120034121728 bytes, 234441644 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x2a6be21a Device Boot Start End Sectors Size Id Type /dev/sda1 2048 234441643 234439596 111.8G 83 Linux <br> lsblk --結果-- NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 111.8G 0 disk └─sda1 8:1 0 111.8G 0 part mmcblk0 179:0 0 58.9G 0 disk ├─mmcblk0p1 179:1 0 1.8G 0 part ├─mmcblk0p2 179:2 0 1K 0 part ├─mmcblk0p5 179:5 0 32M 0 part /media/pi/SETTINGS ├─mmcblk0p6 179:6 0 69M 0 part /boot └─mmcblk0p7 179:7 0 57G 0 part / <br> ===== パーティションのフォーマット(ext4) ===== SSDに作成したパーティションをフォーマットするため、以下のコマンドを実行する。<br> sudo mkfs.ext4 /dev/sda1 mke2fs 1.43.4 (31-Jan-2017) Found a dos partition table in /dev/sda1 Proceed anyway? (y,N) y '''←"y"を入力''' Creating filesystem with 29305205 4k blocks and 7331840 inodes Filesystem UUID: bf3db726-f1fa-4a6c-a64b-fe48bbfa9a99 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872 Allocating group tables: done Writing inode tables: done Creating journal (131072 blocks): done Writing superblocks and filesystem accounting information: done <br> ===== 自動マウントの設定 ===== /etc/fstabにSSDを登録することにより、起動時に自動マウントすることができる。<br> また、SSDのフルパスではなく、UUIDを登録しておくことにより、SSDのフルパスが変更されてもマウントすることが可能となる。<br> <br> マウントポイントを作成する。(ここでは、/mnt/ssd1とする)<br> sudo mkdir /mnt/ssd1 <br> SSDのUUID(ブロックデバイスの情報)を調べる。<br> sudo blkid /dev/sda1 --結果-- /dev/sda1: UUID="fbab8a4f-3211-4b03-b53a-1579c93054aa" TYPE="ext4" <br> fstabを編集する。<br> fstabでの設定に誤りがある場合、再起動時にemergency modeで起動される。(必ずfstabファイルのバックアップを取ること)<br> また、nofailオプションを指定することで、エラーの設定項目を無視して起動できる。<br> <br> fstabファイルのバックアップを作成する。<br> cd /etc sudo cp fstab fstab.org <br> fstabファイルを編集してマウント設定を追加する。<br> sudo nano /etc/fstab # デバイス名 マウントポイント ファイルシステム オプション dump指定 fsck指定 UUID=fbab8a4f-3211-4b03-b53a-1579c93054aa /mnt/ssd1 ext4 nofail 0 0 <br> Raspbian OSを再起動する。<br> sudo reboot <br> 正常にSSDが自動マウントされていることを確認する。<br> df | grep /mnt/ssd1 --結果-- /dev/sda 3845578572 69632 3650141680 1% /mnt/ssd1 <br><br> __FORCETOC__ [[カテゴリ:Raspberry_Pi]]
SSDからRaspbianを起動する方法
に戻る。
案内
メインページ
最近の更新
おまかせ表示
MediaWiki についてのヘルプ
ツール
リンク元
関連ページの更新状況
特別ページ
ページ情報
We ask for
Donations
Collapse