Hot answers tagged

83

You can use parted -l to determine the type of partition table. Eg: $ sudo parted -l Model: ATA TOSHIBA THNSNS25 (scsi) Disk /dev/sda: 256GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 4194kB 32.2GB 32.2GB primary ext4 boot 2 32.2GB 256GB 224GB ...


68

In order to align partition with parted you can use --align option. Valid alignment types are: none - Use the minimum alignment allowed by the disk type. cylinder - Align partitions to cylinders. minimal - Use minimum alignment as given by the disk topology information. This and the opt value will use layout information provided by the disk to align the ...


32

On linux, you can check this via the gdisk tool which should be available for any distro. gdisk -l /dev/sda Here, /dev/sda is the device node of the physical drive, not a partition (/dev/sda1, /dev/sda2, etc. are partitions). If you see something that includes: *************************************************************** Found invalid GPT and valid ...


28

That link you posted looks like a very ugly hack type solution. However, according to the man page, gdisk, which is used to convert MBR -> GPT, also has an option in the "recovery & transformation" menu (press r to get that) to convert GPT -> MBR; the g key will: Convert GPT into MBR and exit. This option converts as many partitions as ...


23

Will dd if=/dev/zero of=/dev/sda wipe out a pre-existing partition table? Yes, the partition table is in the first part of the drive, so writing over it will destroy it. That dd will write over the whole drive if you let it run (so it will take quite some time). Something like dd bs=512 count=50 if=/dev/zero of=/dev/sda would be enough to overwrite the ...


22

After a day of research, I can now answer my own Question: yes it is possible, and you can even use that partition as /boot and store your kernels/initramfs/etc. there. Requirements: Grub >= 2.00 (1.98 and 1.99 do not work) Grub must be installed from a Linux kernel, that has support for EFI variables (CONFIG_EFI_VARS compiled in or as module efivars) For ...


18

I'm going use the term BIOS below when referring to concepts that are the same for both newer UEFI systems and traditional BIOS systems, since while this is a UEFI oriented question, talking about the "BIOS" jibes better with, e.g., GRUB documentation, and "BIOS/UEFI" is too clunky. GRUB (actually, GRUB 2 -- this is often used ambiguously) is the bootloader ...


17

As the OS was not specified, here is FreeBSD way of doing things. All is done through the gpart command (short for GEOM partioner - nothing to do with GNU). A simple gpart show would show you all the available partitions of all the disks, but you can specify the device to have a more precise look on one: legacy partition layout with MBR (aka "msdos") and ...


16

Most of the previous respondents are correct when they say that you can usually do what you need with a GPT partition table layout, but since there are valid reasons for wanting to use MBR, I think I will just answer your question instead of assuming you are wrong for asking. To get rid of the GPT, you need to remember that with this format, there is a ...


12

mdraid always allows you to move disks around freely in the machine, regardless of how you add the disk to the array. It tracks the disks by the RAID metadata (superblocks) stored on the disk. Note that this assumes mdadm can find the disks when its assembling the arrays. The default (specified in /etc/mdadm/mdadm.conf) is normally DEVICE partitions, which ...


11

TO ADDRESS YOUR EDIT: I didn't notice the edit to your question until just now. As written now, the question is altogether different than when I first answered it. The mirror you describe is not in the spec, actually, as it is instead a rather dangerous and ugly hack known as a hybrid-MBR partition format. This question makes a lot more sense now - it's not ...


10

The extended and logical partitions make sense only with msdos partition table. It's only purpose is to allow you to have more than 4 partitions. With GPT, there are only 'primary' partitions and their number is usually limited to 128 (however, in theory there is no upper limit implied by the disklabel format). Note that on GPT none of the partitions could ...


10

The partition unique GUID is generated at the time that the partition is created. It uniquely identifies the partition at least inside the disk and probably among all the disks you own (because it's unbelievably rare for GUIDs to collide). A partition GUID code (by which I believe you mean a partition type GUID), on the other hand, is a known, fixed GUID. ...


10

The partition table is stored near the beginning1 of the (logical2) disk device. Overwriting that area with anything (zeroes from /dev/zero or any other data) will replace the partition table with gibberish, so it will no longer be obvious where the partitions on the device begin. One can still scan the whole disk and try to identify the "magic bytes" that ...


9

My solution has been to use gdisk which can perform partitions alignment automatically on a 2048 sectors (1024KiB) by default, although it can be changed in the expert menu.


9

With udisks on Linux: $ sudo /lib/udev/udisks-part-id /dev/sda using device_file=/dev/sda syspath=/sys/devices/pci0000:00/0000:00:0b.0/ata1/host0/target0:0:0/0:0:0:0/block/sda, offset=0 ao=0 and number=0 for /dev/sda Entering MS-DOS parser (offset=0, size=500107862016) MSDOS_MAGIC found found partition type 0xee => protective MBR for GPT Exiting MS-DOS ...


8

GPT or MBR? As @mgorven said, either will work on 2TB. I've deployed dozens of MBR disk labels on 2T disks and it works fine on them. It's really your choice. I go with MBR by preference for now, but this is about to change. UEFI and GPT You don't need UEFI to write a GPT disk label to a disk, and if you're clever, you could conceivably boot a disk with a ...


8

Traditionally, Linux on x86 hardware has used MSDOS partition tables. In this case, removing /dev/sda2 won't shift any of the higher numbered partitions down, because the primary partitions act like "slots": you can use them in any order you like, and removing one doesn't affect any of the others. If instead you had sda{1-7} with sda4 being the extended ...


8

Partitioners like to align partitions on a mebibyte boundary these days. For MBR partitioning, there are 4 primary partitions, and for the rest you need extended and logical partitions. While the layout of the primary partitions is expressed at the end of the first sector of the disk, for the logical partitions, you've got a linked list of additional ...


8

You cannot use fdisk to work with GPT disks, it will only work with MBR disks. Any disk that > 2TB must be GPT. You likely cannot mount this HDD because even though the kernel has detected it (in the dmesg output) the HDD hasn't been partitioned or formatted with a filesystem so that it can be mounted. Try the following to do this: $ sudo sfdisk -l This ...


8

gdisk only has the one command line option (-l), to list the partition table and then quit. All of the other operations are conducted interactively from within gdisk. See Rod Smith's walkthrough for some more context. Essentially, though, you want to just use the command # gdisk /dev/sdb and then, at the prompt, use the s command to sort the partition ...


8

MBR, Master Boot Record Wikipedia excerpt; link: A master boot record (MBR) is a special type of boot sector at the very beginning of partitioned computer mass storage devices like fixed disks or removable drives intended for use with IBM PC-compatible systems and beyond. The concept of MBRs was publicly introduced in 1983 with PC DOS 2.0. I ...


7

UEFI has nothing to do with power management. ACPI manages power. UEFI indicates modern firmware than BIOS and newer platform, thus improved power efficiency. This might be a correlation. The PM subsystem is different from UEFI. Linux includes a whole range of power management functionalities, though unrelated to UEFI, like cpufreq, intel_pstate, pcie_aspm, ...


7

If you don't want to fiddle with dd, gdisk can do: $ sudo gdisk /dev/sdb GPT fdisk (gdisk) version 0.8.8 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Command (? for help): ? b back up GPT data to a file <snip> w write table to disk and exit x extra ...


6

From the Arch Wiki: When creating a partition, parted might warn about improper partition alignment but does not hint about proper alignment. For example: (parted) mkpart primary fat16 0 32M Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? The warning means ...


6

some unix partitioner, are deperecated and GPT partition table is new and some tools doesn't work GPT. GNU parted is new and gparted is GNOME Parted for example: root@debian:/home/mohsen# parted -l /dev/sda Model: ATA WDC WD7500BPVT-7 (scsi) Disk /dev/sda: 750GB Sector size (logical/physical): 512B/4096B Partition Table: msdos Disk Flags: Number Start ...


6

The fdisk equivalent is gdisk, which is commonly available in the gptfdisk package via package manager. You'd do much better to use it, in my opinion. I don't trust anything *parted, personally - any partition tool that simultaneously partitions and formats is not a partition tool.


6

grub itself does not care about boot flags. An EFI System partition is distinguished by its GUID type C12A7328-F81F-11D2-BA4B-00A0C93EC93B, not by a boot flag. Yes, this partition needs to be formatted FAT32. Not all FAT32 partitions are EFI System partitions, only one of them, and that one, if present, is small and has a special purpose. On a computer which ...


5

Use gdisk /dev/sda Note: /dev/sda is in the case of the person who asked this question but change it to your drive name. Once you are inside with gdisk use: x extra functionality (experts only) then when you type p to see all the options, you will see this: Expert command (? for help): ? a set attributes c change partition GUID d display the ...


5

The real limitation is that the fdisk tool in the util-linux package doesn't support GPT-type partition tables, which you can find on any disk. However, they're commonly found on disks greater than 2 GiB, because the old MBR-type partition tables don't support sizes that large. The easiest fix is, as the error suggested, to just use the GNU Parted software ...


Only top voted, non community-wiki answers of a minimum length are eligible