2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Jetson NanoのSDカードを拡張する

Last updated at Posted at 2020-03-29

ダウンロードしたイメージはSDカードの容量をフルに活用していない場合があるので、コマンドにてパーティションを拡張する。ラズパイではraspi-configを呼び出してGUIでできますが今のところコマンドでやる方法です。

ディスク空き容量を調べる

$df -h

対象のパーティションを削除する

$sudo fdisk /dev/mmcblk0

パーティションテーブルを表示

コマンドpを入力

パーティションを削除する

コマンドdを入力

削除はパーティション番号は1

パーティションナンバーは1

新しいパーティションを作成

コマンドnを入力

新しいパーティション番号は1

パーティションナンバーは1

パーティションの変更を保存して終了する

コマンドwを入力

再起動します。

$sudo reboot

セクターサイズが最大化できずエラーが出る場合は、
一旦、fdiskを停止して、partedをインストールして

sudo parted /dev/mmcblk0

変更前のディスク容量が表示されて100%と入力する。

etson@nano-4gb-jp461:~$ sudo parted /dev/mmcblk0
GNU Parted 3.2
Using /dev/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Warning: Not all of the space available to /dev/mmcblk0 appears to be used, you can fix the GPT to use all of the
space (an extra 125001728 blocks) or continue with the current setting? 
Fix/Ignore? fix                                                           
Model: SD SR128 (sd/mmc)
Disk /dev/mmcblk0: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 2      1049kB  1180kB  131kB                TBC
 3      2097kB  2556kB  459kB                RP1
 4      3146kB  3736kB  590kB                EBT
 5      4194kB  4260kB  65.5kB               WB0
 6      5243kB  5439kB  197kB                BPF
 7      6291kB  6685kB  393kB                BPF-DTB
 8      7340kB  7406kB  65.5kB               FX
 9      8389kB  8847kB  459kB                TOS
10      9437kB  9896kB  459kB                DTB
11      10.5MB  11.3MB  786kB                LNX
12      11.5MB  11.6MB  65.5kB               EKS
13      12.6MB  12.8MB  197kB                BMP
14      13.6MB  13.8MB  131kB                RP4
 1      14.7MB  63.9GB  63.8GB  ext4         APP

(parted) resizepart 1
Warning: Partition /dev/mmcblk0p1 is being used. Are you sure you want to continue?
Yes/No? Yes                                                               
                                        
End?  [63.9GB]? 100%                                                      
(parted) q                                                                
Information: You may need to update /etc/fstab.

再び、fdiskで実行するする。

ディスク空き容量を調べる

$df -h

パーティション変更の後、ファイルシステムのサイズを拡張する

$sudo resize2fs /dev/mmcblk0p1

空き容量が増えたのか確認する。

$df -h
2
0
0

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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?