|

Making GPT Partition Table and Creating Partitions Using parted in Linux

My best favorite disk partition table manipulation tools are cfdisk/fdisk on Linux. However, for large disks, cfdisk/fdisk (of the versions by this post is written) will just give up with a message suggesting GPT partition table format and using GNU parted like

WARNING: The size of this disk is 6.0 TB (6001042391040 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID 
partition table format (GPT).

If you continue using fdisk/cfdisk, you will only create msdos partition table and use only less than 2TB space.

However, the parted‘s interface is not that easy to use at the first try. After some struggling with parted, I finally make a partition on the new 6TB RAID 0 storage array. Here is the process.

pc ~ # parted /dev/sdc
GNU Parted 2.3
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel GPT
Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? Yes
(parted) mkpart primary 2048s 100%
(parted) q
Information: You may need to update /etc/fstab.

Why “2048s” is used here? Please check this blog post.

For the command mkpart primary 2048s 100%, an alternative command is

mkpart PARTITION_LABEL ext4 primary 2048s 100%

which makes a partition with label PARTITION_LABEL.

The partition can be easily accessed later at path /dev/disk/by-partlable/PARTITION_LABEL which will be useful for writing fstab entry or other usages that need to directly use a partition block device.

The new partition /dev/sdc1 is created:

pc ~ # ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sda4  /dev/sda5  /dev/sdb  /dev/sdb1  /dev/sdc  /dev/sdc1

Check the information again:

pc ~ # parted /dev/sdc print
Model: ORICO H/ W RAID0 (scsi)
Disk /dev/sdc: 6001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  6001GB  6001GB               primary

Alternative to parted: if you don’t want to use parted, you may try cgdisk which is a curses-based GPT manipulator that feel very similar to cfdisk.

Similar Posts

  • SetProxy: 一个设置IE代理的命令行小工具

    IE的代理设置用起来并不方便,我自己而言就要经常更改代理服务器,相信很多人有跟我相同的需要。使用C++编写了一个小程序SetProxy调用Win32 API来设置代理服务器IP,用起来方便多了。 编译后为一个可运行console程序,将它放在\windows\system32目录下,使用时只要运行 SetProxy IP:port 就可以把IP设置好,如果要关闭代理,只需运行 SetProxy “” 命令行中运行,界面较土,但用着方便。可以考虑设置几个快捷方式在桌面或者工具栏,点击即设置代理,其它方式发挥想象。 程序下载地址. 源代码也放在这里,希望有需要的人可以用得上 ;) 源代码下载地址. 这是一份有些年头的代码, 如果你在较新的编译器下编译这个项目, 请先做[[setproxy-一个设置ie代理的小工具#comment-995|这里所述的小修改]]. — Eric on Apr. 9, 2014. Read more: Making Emacs Start Up Faster Profiling Vim to Find Out Which Plugin Makes Vim Slow Handling Sparse Files on Linux Spring Shell Technology For Java development Vim Tutorial for Beginners: vimtutor…

  • HP Compaq BIOS Crisis Recovery from a Failed BIOS Flashing Using a USB Flash Disk

    I tried to flash my HP Compaq CQ35-240TX’s BIOS to F.15 but unfortunately failed. The computer turned to white screen. When I restarted (powered off then boot again), this is no response any more: the hard disk and caps lock’s LED keep blinding. I thought “Oh my God! I must send it to HP to…

  • |

    Parameterised AngularJS Routing in Asp.net MVC using $routeProvider

    In this post, asp.net development India based professionals will brief you about the interesting feature of AngularJS, that I Routing. You will learn the method to split the single page into multiple views. For more info, read the article. In this article we are going to see one of the most useful feature of AngularJS…

  • How to edit eps file?

    I have made some eps figures for my paper but now I wanna modify them. How to edit them now? You may try inkscape on Linux: https://inkscape.org/en/ It can edit eps files. Read more: How to make eps files using gnuplot How to Convert JPG Images to EPS An Online JPG to EPS Converter How…

  • Fedora 中文字体设置

    Fedora 一直有中文字体难看的问题, 尤其是在英文环境中. 使用本文中的配置方法可以得到令人满意的中文效果. 此方案中使用字体都为开源且在Fedora源中自带. 此方案对 Fedora 9 – 20 有效. 对于后续版本支持我会确认并更新此文章. 此方案对Gnome, KDE都有效. Firefox 中也有中文难看的问题, 后面会提到. 快速配置方法 如果你想马上配置好,请使用如下命令。此方法测试使用效果良好。 # yum install cjkuni-ukai-fonts cjkuni-uming-fonts # wget https://raw.githubusercontent.com/zma/config_files/master/others/local.conf \ -O /etc/fonts/local.conf 相关英文字体配置可以参考:Improving Fedora Font Rendering with Open Software and Fonts Only. Fedora 系统中文字体的配置方案 使用uming和ukai字体,即AR PL UMing CN等. 中文字体和等宽字体效果如图所示(点击看大图, Firefox 中文字体设置在后面会提到). 方法如下: 安装字体 首先安装这两个字体: cjkuni-ukai-fonts cjkuni-uming-fonts (在Fedora…

6 Comments

  1. For the command

    `mkpart primary 2048s 100%`

    an alternative command is

    `mkpart PARTITION_LABEL ext4 primary 2048s 100%`

    which makes a partition with label PARTITION_LABEL.

    The partition can be easily accessed later at path

    `/dev/disk/by-partlable/PARTITION_LABEL`

    which will be useful for writing `fstab` entry or other usages that need to directly use a partition block device.

  2. Number Start End Size File system Name Flags
    1 1049kB 6001GB 6001GB primary

    There is not file system showing at the end? How do I get something like ext4 or ntfs there?

  3. For GPT partitions, do NOT use “primary” in the mkpart command.

    # parted -s /dev/sd$d mkpart “$partlabel” ntfs primary 2048s 100%
    Error: Invalid number.

    This works:

    # parted -s /dev/sd$d mkpart “$partlabel” ntfs 2048s 100%

Leave a Reply

Your email address will not be published. Required fields are marked *