fdisk updates and GPT support (轉)

來源:互聯網
上載者:User

標籤:

fdisk updates and GPT support (轉)fdisk updates and GPT support (轉)

原文: (被牆了, 直接複製粘 [nian?]) 貼過來) http://blog.stgolabs.net/2012/09/fdisk-updates-and-gpt-support.html

fdisk 已經支援 GPT (2012-09-27) 了, 但是你現在 (2015-05-02) 用百度搜尋的時候還是會找到說不支援的博文. 國內的部落格大部分都是 copy 來 copy 去, 這種沒品質的 copy 應該收藏到 有道筆記 裡面, 而不是老是拿出來害大家.

很多像我這樣的小白 都是咽著 這些 "灰塵" 爬過來的

fdisk /dev/sda 進去之後按 m

Create a new label   g   create a new empty GPT partition table   G   create a new empty SGI (IRIX) partition table   o   create a new empty DOS partition table   s   create a new empty Sun partition table

明顯是支援 GPT 分區的
http://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=766d5156c43b784700d28d1c1141008b2bf35ed7

你也可以用 partedThe fdisk tool is perhaps the most recognized disk partitioner in the world

The fdisk tool is perhaps the most recognized disk partitioner in the world, as it has historically been present in Windows and all Unix flavors, among other OSs. While this tool has proven useful for its Linux variant, it as been subject to intense patching along its 20 years of existence, and it is a product of multiple authors, coding styles and concepts. Because of this, extending fdisk, to keep up with modern day computing and disk needs is hard, time consuming and error prone. To address this, a serious effort, initially sponsored by Google, was started to redesigned and update fdisk to fit the requirements of a modern disk partitioning program. Some include removing DOS compatibility mode, replacing the deprecated CHS addressing with LBA, GPT support, creating a generic a driver based API that can transparently handle different partition types and major code cleanups and refactoring, among others. While several things have been done, there is still a long ways to go.

I‘m pleased to announce that fdisk can now work with GPT based disks!!

GUID Partition Table (GPT) , developed by Intel in the late ‘90s, is a standard for laying out partitioning on hard disks, now forming part of the UEFI standard. Its increasing popularity is easily understandable, as it provides several benefits over the traditional PC master boot record (MBR) scheme. Furthermore, people using Intel based Apple products (like macbooks) will most likely be using GPT (with a hybrid MBR scheme). While the Internet is full of documents that go into the details of this format, there are a few benefits worth mentioning here:

GPT does not know anything about CHS addressing, and only uses LBA (64bit).
Because it uses 64bit LBAs, it can hold 2^{64}?1 sectors, typically 9.4 Zb with standard 512 byte sectors, way above the 2Tb limit offered by MBR.
GPT uses 32bit CRC checksums to validate data integrity for its headers and partition entries. It also adds redundancy to it‘s structures having them present twice, once at the start and again at the end of the disk. This, of course, helps protect the system against disk errors and allows better recovery.

Some considerations about the implementation:
We currently support probing, listing/adding/deleting/writing partitions, data integrity verification. Furthermore, fdisk can determine if there is a traditional protected, or hybrid MBR present.
For now, primary header corruption is not recoverable from he backup at the end of the disk.
Header checksums are updated upon every change (ie: add/delete partitions), this allows us to mathematically verify the changes on-the-fly, and not only when writing to disk, like most other related tools do.
When creating a new partition, all partition type GUIDs are available.

I‘d like to thank both Petr Uzel from SuSE and Karel Zak from Red Hat for their time reviewing, testing and answering any doubts I had.

Enjoy!

fdisk updates and GPT support (轉)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.