GPT ãã£ã¹ã¯ã®ç®¡çã« gdisk
ã䜿ãããã«ãªããparted
ãšã®éããããçšåºŠããã£ãŠããã®ã§æ¯èŒãªãããã¡ãã£ãšæžããŠã¿ããããšæããŸããã
çšéã«ãããŸãããå人çã«ã¯ gdisk
ã®æ¹ã䜿ããããã®ã§ã¯ãªãããšæããŸãã
æ¬èšäºã§äœ¿çšããŠããããŒãžã§ã³ã以äžã«èšèŒããŸããç°å¢ã«ãã£ãŠåäœãç°ãªãå¯èœæ§ããããŸãã®ã§è©³ããã¯ããã¥ã¢ã«ãåç §ããŠãã ããã
- Linux Mint 17
- GPT fdisk (gdisk) version 0.8.8
- parted (GNU parted) 2.3
çšèªã«é¢ããŠã¯äœ¿ãæ¹ãééã£ãŠããéšåãããããšæããŸãããŸããããã§äœ¿çšããŠãã HDD ã¯ããç ŽæããŠãã WD20EARS ã䜿çšããŠããããã»ã¯ã¿æ°ãªã©ã«ç°åžžããããããããŸããã
parted
察話ã¢ãŒãã§æäœãããšãã®æµãã§ãã
parted /dev/sdb
GNU Parted 2.3 Using /dev/sdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) mklabel gpt Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? y (parted) mkpart Partition name? []? File system type? [ext2]? Start? 0G End? 32G (parted) p Model: WDC WD20 EARS-00MVWB0 (scsi) Disk /dev/sdb: 2000GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 1049kB 32.0GB 32.0GB ext4 (parted) q Information: You may need to update /etc/fstab.
mklabel
㧠gpt
ããã㯠msdos
ãªããŒãã£ã·ã§ã³ã©ãã«ãäœæããmkpart
ã§ããŒãã£ã·ã§ã³ãäœæããŠãããŸãããã©ãŒããããåæã«å¯èœãª mkpartfs
ããããŸãããã¡ãã¯éæšå¥šãšãªã£ãŠããŸãã
ããã©ã«ãã§ã¯ã¢ã©ã€ã¡ã³ãã¿ã€ã㯠optimal
ããŠããã㯠compact
ïŒMB æå®ãšå¯èªæ§ã®é«ã衚瀺ïŒã«ãªã£ãŠããŸãããã®å Žåãéå§äœçœ®ã« 0
ãæå®ãããšã¢ã©ã€ã¡ã³ããæ£ãããªããšãããšã©ãŒã«ãªããŸãããã㯠1
ãæå®ããããunit
ã³ãã³ãã§åäœã GB
ã %
ãªã©ã«å€æŽããããéå§äœçœ®ã®æå®ã 0G
ããã㯠0%
ãªã©ã§æå®ãããšããšã§éå§äœçœ®ã 2048s ã«ãªããšã©ãŒãåºãªããªããŸããã¢ã©ã€ã¡ã³ãã¿ã€ãã¯èµ·åæã®ãªãã·ã§ã³ -a minimal
çã§å€æŽãã§ããŸãã
parted
ã§ã¯ -s
ãªãã·ã§ã³ã䜿ã£ãŠé察話ã¢ãŒãã§åŠçããããšãã§ããŸãããã®ãªãã·ã§ã³ã¯ sed -e
ã®ããã«1åã®ã³ãã³ãã§è€æ°ã®åŠçãåããŠæžãããšãã§ãã次㮠-s
ãŸã§ã parted
ã®ã³ãã³ãã«ãªããŸããïŒå¯Ÿè©±ã¢ãŒãã§ã¯ååç¡ãã®ããŒãã£ã·ã§ã³ãäœæã§ããŸããããã®ã¢ãŒãã§ã¯ã§ããªããããããŸãããæžåŒäžæâŠïŒ
# GPT ããŒãã£ã·ã§ã³ã©ãã«ã®äœæ parted /dev/sdb -s mklabel gpt # æ°ããããŒãã£ã·ã§ã³ãäœæ parted /dev/sdb -s mkpart untitled ext2 0G 32G # ãŠããããã»ã¯ã¿ã«å€æŽããŠããŒãã£ã·ã§ã³ããŒãã«ã衚瀺 parted /dev/sdb -s p -s unit s -s p
第1ããŒãã£ã·ã§ã³ã 2048s ããå§ãŸããŸããïŒãã£ã¹ã¯æ å ±ã¯çç¥ããŠããŸãïŒ
Number Start End Size File system Name Flags 1 1049kB 32.0GB 32.0GB ext4 untitled Number Start End Size File system Name Flags 1 2048s 62500863s 62498816s ext4 untitled
-a minimal
ã§ã¢ã©ã€ã¡ã³ãã¿ã€ããå€æŽããå Žå㯠34s ããå§ãŸããŸããçµäºäœçœ®ã¯ãŽã£ãã 32 GB ã«ãªã£ãŠããŸããããã§æ£ããããã©ãŒãã³ã¹ãåŸããããã©ããã¯ããããŸããã
Number Start End Size File system Name Flags 1 17.4kB 32.0GB 32.0GB untitled Number Start End Size File system Name Flags 1 34s 62500000s 62499967s untitled
man ã«ã¯æžãããŠããŸããã parted
㯠IEC ã§ã®æå®ã«ã察å¿ããŠãããGi
ã GiB
çã§æå®ã§ããŸãããã¡ãã®æ¹ã df -h
ãããšãã«èŠæ ãããããããããŸããã
parted /dev/sdb \ -s mklabel gpt \ -s mkpart untitled ext2 0Gi 32Gi \ -s mkpart untitled ext2 32Gi 100% \ -s p \ -s unit Gi -s p \ -s unit s -s p
Number Start End Size File system Name Flags 1 1049kB 34.4GB 34.4GB ext4 untitled 2 34.4GB 2000GB 1966GB ext4 untitled Number Start End Size File system Name Flags 1 0.00GiB 32.0GiB 32.0GiB ext4 untitled 2 32.0GiB 1863GiB 1831GiB ext4 untitled Number Start End Size File system Name Flags 1 2048s 67108863s 67106816s ext4 untitled 2 67108864s 3907028991s 3839920128s ext4 untitled
ããŒãã£ã·ã§ã³ã©ãã«ã msdos
ã§äœæããå Žåãmkpart
ã®ç¬¬1åŒæ°ã¯ããŒãã£ã·ã§ã³åã§ã¯ãªãããŒãã£ã·ã§ã³ã¿ã€ãïŒprimary|logical|extendedïŒã®æå®ã«ãªããŸããgdisk
ã®æ¹ã§æžããŸãã parted
ã¯ããŒãã£ã·ã§ã³æ°ãå¢ãããšèšç®ãé¢åã«ãªã£ãŠããŸãã
parted /dev/sdb \ -s mklabel msdos \ -s mkpart primary 0G 32G \ -s mkpart extended 32G 100% \ -s mkpart logical 32G 64G \ -s mkpart logical 64G 96G \ -s p free
Number Start End Size Type File system Flags 32.3kB 1049kB 1016kB Free Space 1 1049kB 32.0GB 32.0GB primary ext4 2 32.0GB 2000GB 1968GB extended lba 5 32.0GB 64.0GB 32.0GB logical 6 64.0GB 96.0GB 32.0GB logical 96.0GB 2000GB 1904GB Free Space 2000GB 2000GB 90.1kB Free Space
LVM çšããŒãã£ã·ã§ã³äœæãªããããªæãã§ãããããã¹ã¯ãªããã¢ãŒãã ãšããŒãã£ã·ã§ã³åãä»ããªããšãããªãã®ãé¢åã§ããâŠã
parted /dev/sdb -s mklabel gpt -s mkpart untitled ext2 0% 100% -s set 1 lvm on
ã¹ã¯ãªããã¢ãŒãã§ã¯ -8G
ãšãã£ãæå®ããªãã·ã§ã³ãšåéãããããããªã®ã§åŸæ¹çžå¯Ÿäœçœ®æå®ïŒïŒïŒã¯ã§ããªãããã§ãã
gdisk
fdisk
ã® GPT çãªã®ã§ fdisk
ã䜿çšããããšããã人ãªãæäœæ¹æ³ã¯ã»ãšãã©åãã ãšæããŸããCurses çã® cgdisk
ãã¹ã¯ãªããçã® sgdisk
ããããŸãã
以äžã¯ gdisk
ã§ãã£ã¹ã¯ã®åæåãšããŒãã£ã·ã§ã³ã®äœæãè¡ããšãã®æµãã§ãã
gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.8 Partition table scan: MBR: not present BSD: not present APM: not present GPT: not present Creating new GPT entries. Command (? for help): o This option deletes all partitions and creates a new protective MBR. Proceed? (Y/N): y Command (? for help): n Partition number (1-128, default 1): First sector (34-15523806, default = 2048) or {+-}size{KMGTP}: Last sector (2048-15523806, default = 15523806) or {+-}size{KMGTP}: Current type is 'Linux filesystem' Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'Linux filesystem' Command (? for help): p Disk /dev/sdb: 3907029168 sectors, 1.8 TiB Logical sector size: 512 bytes Disk identifier (GUID): 89E13014-DADD-4DF3-A8BF-3C23AC8DD233 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 3907029134 Partitions will be aligned on 2048-sector boundaries Total free space is 3839920237 sectors (1.8 TiB) Number Start (sector) End (sector) Size Code Name 1 2048 67110911 32.0 GiB 8300 Linux filesystem Command (? for help): w Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!! Do you want to proceed? (Y/N): y OK; writing new GUID partition table (GPT) to /dev/sdb. The operation has completed successfully.
gdisk
ã®è¯ããšããã¯éå§ã»çµäºäœçœ®ã®ç¯å²ãšèŠå®å€ã衚瀺ããŠãããããçµäºäœçœ®ã +1G
ã®ããã«çžå¯Ÿæå®ã§ããããšã§ããparted
ã§ã¯çµäºäœçœ®ãçŽæ¥æå®ãããããäŸãã°ããŒãã£ã·ã§ã³ãµã€ãºã 32 GiB ã«ãŽã£ããåããããå Žåã¯äºåã«èšç®ããŠããå¿
èŠããããããŒãã£ã·ã§ã³ãå¢ããã°å¢ããã»ã©é¢åã«ãªã£ãŠãããŸãã gdisk
㯠+
ãä»ããŠãµã€ãºæå®ããã ããªã®ã§ãšãŠãç°¡åã§ãã
ãããŠéèŠãªã®ã parted
ã¯ã³ãã³ãçµæãããã«æžã蟌ã¿ãŸãããgdisk
ã§ã¯ w
ã³ãã³ããå®è¡ããåŸãæçµç¢ºèªã«åçããŠããæžã蟌ã¿ãè¡ãããšã§ãïŒãããŸã§ã¯ p
ã³ãã³ãã§åŠçäºå®ã衚瀺ã§ããŸãïŒã誀ã£ãŠæ¢åããŒãã£ã·ã§ã³ãç ŽæããŠããŸãå¿é
ãå°ãªããŠæžã¿ãŸãã
x
ã r
ã§ãšãã¹ããŒãã¢ãŒãã«å
¥ããã¢ã©ã€ã¡ã³ãå€ã GUID ãå€æŽãããããŒãã£ã·ã§ã³ããŒãã«ã®ããã¯ã¢ãããªã©ãã§ããŸãã
察話ã¢ãŒãã§ã¯ "Linux filesystem" ã®ããã«ããŒãã£ã·ã§ã³åãèªåèšå®ãããŸãïŒc
ã³ãã³ãã§äœãå
¥åããªããã°åé€ã§ããŸãïŒãsgdisk
ã cgdisk
ã§ã¯ååãä»ããŸããã
次ã«ãgdisk
ã®ã³ãã³ãã©ã€ã³åãã³ãã³ã sgdisk
ã§ããsgdisk
ã§ã¯ -n <ããŒãã£ã·ã§ã³çªå·>:<éå§>:<çµäº>
ãšããæžåŒã§ããŒãã£ã·ã§ã³çªå·ãšãµã€ãºãæå®ããŸããéå§ãšçµäºã®å€ã¯å¯Ÿè©±ã¢ãŒãåæ§ã«çç¥å¯èœã§ããparted -s
ãšåæ§ã« -n
ãªã©ã®ãªãã·ã§ã³ãè€æ°å䜿çšã§ããŸãã
# ããŒãã£ã·ã§ã³ã©ãã«ã®å®å šç Žå£ sgdisk -Z /dev/sdb # GPT ã©ãã«ã®æžã蟌ã¿ïŒçç¥å¯ïŒ sgdisk -o /dev/sdb # 第1ããŒãã£ã·ã§ã³ã«å é ïŒ2048sïŒãã 32 GiB å䜿çšã第2ããŒãã£ã·ã§ã³ã«ç©ºãé åå šãŠäœ¿çšãååã "Free Space" ã« sgdisk \ -n 1::+32G \ -n 2::: \ -c 2:"Free Space" /dev/sdb # ããŒãã£ã·ã§ã³ããŒãã«ã衚瀺 sgdisk -p /dev/sdb
Number Start (sector) End (sector) Size Code Name 1 2048 67110911 32.0 GiB 8300 2 67110912 3907029134 1.8 TiB 8300 Free Space
parted
ã§çµäºäœçœ®ã 32 GiB ã«ããå Žåãšæ¯èŒããŠã¿ãŸããparted
ã¯çµ¶å¯Ÿäœçœ®æå®ãªã®ã§ç¬¬1ããŒãã£ã·ã§ã³ã®ãµã€ãºãã¢ã©ã€ã¡ã³ãå㧠1 MiB å°ãªããªããŸãã
gdisk
Number Start End Size File system Name Flags 1 1.00MiB 32769MiB 32768MiB ext4 2 32769MiB 1907729MiB 1874960MiB Free Space
parted
Number Start End Size File system Name Flags 1 1.00MiB 32768MiB 32767MiB ext4 2 32768MiB 1907729MiB 1874961MiB ext4
LVM çšã¯ãããªæãã§ãããããparted
ã«æ¯ã¹ãŠã·ã³ãã«ã§ãã
sgdisk -o -n 1::: -t 1:8e00 /dev/sdb
ãéã³ã§ãããgdisk
ã§ããã¢ããã¥ã¡ã³ãã§åçãäºæž¬ããŠããŒãã£ã·ã§ã³äœæãã§ããããã§ãã
gdisk /dev/sdb <<! o y n w y !
parted
ã«ã€ããŠã¯ä»¥äžã®ç¹ã«ãããŠèª€ãããããããããŸããããšãããããã®èŸºã¯ gdisk
ã䜿ãã°å
šãŠè§£æ±ºããã®ã§æéããã£ãããŸã調ã¹ãããšæããŸãã
parted
ã®ã¹ã¯ãªããã¢ãŒãã§ã¯ããŒãã£ã·ã§ã³åãå¿ ãèšå®ãããparted
ã®ã¹ã¯ãªããã¢ãŒãã§ã¯-
äœçœ®æå®ã§ããªãparted
ã§ã¯çµäºäœçœ®ãçžå¯Ÿæå®ã§ããªã
ä»åè©ŠããŠã¿ã parted
ãš gdisk
ã®æ¯èŒè¡šã§ããgdisk
ã®ããã¯ã¢ããé¢é£ã¯ãŸã ããã¥ã¢ã«ãçèªããŠããªãã®ã§ä¿®åŸ©æ©èœããããã©ããã¯ããããŸããã
parted | gdisk | |
---|---|---|
ã¢ã©ã€ã¡ã³ãèª¿æŽ | â | â |
ã¢ã©ã€ã¡ã³ãæå®æ¹æ³ | none cylinder minimal optimal |
1-65536s ïŒããã©ã«ãïŒ2048sïŒ |
éå§ã»çµäºäœçœ®æå® | èŠ | äžèŠ |
絶察äœçœ®æå® | â | â |
éå§äœçœ®ããã®çžå¯Ÿäœçœ®æå® | à | â |
ãã£ã¹ã¯åŸæ¹ããã®çžå¯Ÿäœçœ®æå® | â | â |
SI æå® | â | Ã |
IEC æå® | â | â |
% æå® | â | Ã |
MBR å¯Ÿå¿ | â | à |
ã³ãã³ãã©ã€ã³ïŒã¹ã¯ãªããïŒã¢ãŒã | â | sgdisk ã§å¯Ÿå¿ |
ããŒãã£ã·ã§ã³ã®ãªãµã€ãº | â | â |
ããŒãã£ã·ã§ã³ããŒãã«ã®ããã¯ã¢ããã»ãªã¹ã㢠| à | â |
ããŒãã€ã·ã§ã³ã®ä¿®åŸ© | â | ïŒ |
èªåã¯ä»ã®ãšãããããªæãã§äœ¿ãåããŠããŸãã
- ããŒãã£ã·ã§ã³ãçæ³ã®ãµã€ãºã§ç¶ºéºã«äžŠã¹ãããªã
gdisk
- SI ã§ãµã€ãºãæå®ãããã2çå4çåãšãããããªã
parted
ä»åã32 GiB ãšãã£ããµã€ãºã®æå®äŸãæžããŸãããããããã£ããµã€ãºã¯ããŸãããããã§ããŸããããšããã®ã¯å€§æµã®ã¹ãã¬ãŒãžã¯ 10 ã® n ä¹ãšãããµã€ãºã§è¡šèšãããŠããã®ã§ãäŸãã° 32 GiBïŒ34.4 GBïŒã®ããŒãã£ã·ã§ã³ã¯ 32 GB ã® USB ãã©ãã·ã¥ã¡ã¢ãªã«ã¯åãŸãããã¹ãã¬ãŒãžã®ç§»è¡ãããã¯ã¢ããã®éã«ç¡é§ãªäœæ¥ãçããå¯èœæ§ããããŸãããã®ããšãèãããš IEC æå®ã® gdisk
ã¯äœ¿ãé£ããããããŸããã
ãŸãããŒãã£ã·ã§ã³ã®åºåãæ¹ã¯å人ã®èªç±ã§ãã®ã§âŠãSI ãš IEC ã®èšç®ã¯ numfmt
ã³ãã³ããçšãããšæ¥œã§ãïŒcoreutils
ããã±ãŒãžã«å«ãŸããŠããŸãïŒã
æäœãééãããšç°¡åã«ããŒãã£ã·ã§ã³ãå¹ã£é£ã¶ã®ã§äœ¿ãæ¹ãããããããªããšãã¯ä»®æ³ãã·ã³ãªã©ã§ç·Žç¿ããããšãããããããŸãã