Difference between revisions of "Partition editing"
From Noah.org
Jump to navigationJump to search (New page: Category:Engineering == sfdisk == On Ubuntu you may have to install the util-linux package: <pre> aptitude install util-linux </pre> === Backup extended partition table === <pre> sfd...) |
|||
Line 1: | Line 1: | ||
[[Category:Engineering]] | [[Category:Engineering]] | ||
+ | [[Category:Disks_and_Filesystems]] | ||
== sfdisk == | == sfdisk == | ||
+ | |||
On Ubuntu you may have to install the util-linux package: | On Ubuntu you may have to install the util-linux package: | ||
Line 8: | Line 10: | ||
=== Backup extended partition table === | === Backup extended partition table === | ||
+ | |||
<pre> | <pre> | ||
sfdisk -d /dev/hda > /tmp/hda | sfdisk -d /dev/hda > /tmp/hda | ||
Line 13: | Line 16: | ||
=== Restore extended partition table === | === Restore extended partition table === | ||
+ | |||
<pre> | <pre> | ||
sfdisk /dev/hda < /tmp/hda | sfdisk /dev/hda < /tmp/hda |
Revision as of 14:05, 25 August 2008
sfdisk
On Ubuntu you may have to install the util-linux package:
aptitude install util-linux
Backup extended partition table
sfdisk -d /dev/hda > /tmp/hda
Restore extended partition table
sfdisk /dev/hda < /tmp/hda
Note that you can edit /tmp/hda between Backup and Restore. You can use this to extend the last partition if you imaged from a smaller drive to a larger drive. You cannot use this to manipulate partitions in the middle without destroying their contents.