Originally Posted by
MakOwner
Could you give us an example of using the sector count for manipulating the partition? I'm about to do this again, and would rather be right and safe than just lucky
Details vary depending on whether you're using GNU Parted, GParted, fdisk, gdisk, or some other tool. Here's an example with fdisk (done on a USB flash drive):
Code:
fdisk /dev/sdc
The number of cylinders for this disk is set to 15418.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): u
Changing display/entry units to sectors
Command (m for help): p
Disk /dev/sdc: 16.2 GB, 16166944768 bytes
64 heads, 32 sectors/track, 15418 cylinders, total 31576064 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x2872a8cf
Device Boot Start End Blocks Id System
/dev/sdc1 32 14745599 7372784 83 Linux
Command (m for help): d
Selected partition 1
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First sector (32-31576063, default 32): 32
Last sector, +sectors or +size{K,M,G} (32-31576063, default 31576063):
Using default value 31576063
Command (m for help): p
Disk /dev/sdc: 16.2 GB, 16166944768 bytes
64 heads, 32 sectors/track, 15418 cylinders, total 31576064 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x2872a8cf
Device Boot Start End Blocks Id System
/dev/sdc1 32 31576063 15788016 83 Linux
Command (m for help): w
Things to note:
- I used the 'u' command to change the units to sectors. Linux fdisk defaults to cylinders, which are imprecise enough that they could be misleading under some circumstances.
- Before deleting the original partition, I checked its start point and size via the 'p' command.
- I was careful to enter the same start sector for the new partition as was used for the original partition.
- I verified the new partition's start sector (via the 'p' command and a comparison to the original 'p' command's output) before saving changes (via the 'w' command). The end was, of course, later on the new partition than on the original.
- There's currently a move underway to shift from cylinder alignment to 1MB (2048-sector) alignment, since the latter produces improved performance on some RAID configurations and with some new hard disks. If your current partitions aren't aligned in the way that's natural for the utility you use, you might have to jump through some hoops to change the tool's alignment rules. You could use 'c' in fdisk or 'l' on the gdisk experts' menu to do this, for instance.
Is there a package in the respository for your GPT fdisk?
Yes, but I'm not sure for which versions it's valid, and the last I checked it was a bit elderly (version 0.5.1, IIRC; the current version is 0.6.6). It's the gdisk package. You can also download Debian packages for x86, x86-64, and PowerPC from the project's Sourceforge page.
Bookmarks