$ sudo gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.3
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************
Command (? for help): p
Disk /dev/sda: 222541648 sectors, 106.1 GiB
Model: HDPG-SU
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): AC32DF32-E043-4434-B723-1FF632EE84BE
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 222541614
Partitions will be aligned on 2048-sector boundaries
Total free space is 3853 sectors (1.9 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 222539775 106.1 GiB 0700 Microsoft basic data
Command (? for help): o ←「o」と入力しEnter
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): Y ←「Y」と入力しEnter
Command (? for help): n ←「n」と入力しEnter
Partition number (1-128, default 1): ←そのままEnter
First sector (34-222541614, default = 2048) or {+-}size{KMGTP}: ←そのままEnter
Last sector (2048-222541614, default = 222541614) or {+-}size{KMGTP}: ←そのままEnter
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): ←そのままEnter
Changed type of partition to 'Linux filesystem'
Command (? for help): p ←「p」と入力しEnter
Disk /dev/sda: 222541648 sectors, 106.1 GiB
Model: HDPG-SU
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): AC32DF32-E043-4434-B723-1FF632EE84BE
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 222541614
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 2048 222541614 106.1 GiB 8300 Linux filesystem
Command (? for help): w ←「w」と入力しEnter
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y ←「Y」と入力しEnter
OK; writing new GUID partition table (GPT) to /dev/sda.
The operation has completed successfully.
$
proc /proc proc defaults 0 0
PARTUUID=e6bfd811-01 /boot vfat defaults 0 2
PARTUUID=e6bfd811-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
# 以下を追加(UUIDは先ほど調べたものに置き換えてください)
UUID=e0949b66-ba09-476b-a57b-1bccb3279ad8 /rpinas ext4 defaults 0 2
Raspberry Pi OSでは、デフォルトユーザのpiユーザのUIDとGIDはどちらも1000に設定されていると思いますが、念の為確認しておきます。
UIDとGIDはidコマンドで調べられます。
コンソール
$ id
uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),105(input),109(netdev),117(lpadmin),995(docker),997(gpio),998(i2c),999(spi)