zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

Copy partition Table

July 26, 2013 by Igor Drobot Leave a Comment

Copy Partitions

When replacing a failed disk you have to create partitions on the new one. Or simple copy them from the old one.

Clean and prepare new disk:

1
2
dd if=/dev/zero of=/dev/sdc bs=1024 count=1024
parted --script /dev/sdc mklabel msdos

dd if=/dev/zero of=/dev/sdc bs=1024 count=1024 parted --script /dev/sdc mklabel msdos

Create Partitions overviews from old disk:

1
sfdisk -d /dev/sda > partitions-sda.txt

sfdisk -d /dev/sda > partitions-sda.txt

Now read in the crated partition table:

1
sfdisk /dev/sdc < partitions-sda.txt

sfdisk /dev/sdc < partitions-sda.txt

Legend:
old broken disk: /dev/sda
new working one: /dev/sdc

Filed Under: Linux Tagged With: parted, Partitioning, sfdisk

Categories

Archives

Tags

apache2 Apple arduino ARM Automation backup bash Cisco Cluster Corosync Database Debian Debian squeeze DIY DNS Fedora FTP Fun Icinga Ipv6 KVM Linux LVM MAC OS X Monitoring MySQL Nagios Nginx openSUSE OpenVPN PHP Proxy Python python3 qemu RAID rsync Samba security ssh Ubuntu virtualization Windows Windows 7 Wordpress

Leave a Reply

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

Yeaaah Cookie! We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok