[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [user] How to get this parted output?

From: Jim Meyering
Subject: Re: [user] How to get this parted output?
Date: Thu, 08 Mar 2012 15:15:46 +0100

Gilles wrote:
> (This is not a bug, but rather a user question. I had to subscribe to
> the bug@ mailing-list as there doesn't seem to be a user@ list that
> would have been more appropriate.)

This list is a fine place for questions.

> After playing with a test host, I need to recreate /dev/sda1 exactly
> as it was before parted (2.3 on Ubuntu) was ran to save the image, but
> I can't figure out how to get this output before running cfdisk:
> ==================
> # cat sda-pt.parted
> Model: ATA WDC WD3200BEVT-2 (scsi)
> Disk /dev/sda: 625142448s
> Sector size (logical/physical): 512B/512B
> Partition Table: msdos
> Number  Start       End         Size       Type     File system  Flags
>  1      63s         29302559s   29302497s  primary  ntfs         boot
>  2      547013250s  625137344s  78124095s  primary  ext3
> ==================
> I ran "parted -h" to learn, used a few commands, but none displays
> data that way. Does someone know?

Assuming you really do want to overwrite /dev/sda, set this variable:


It's an msdos partition table, so start with this:

    parted -s $dev mklabel msdos

Then you want two primary partitions, and you already know
their types and starting and ending sector numbers, so do this:

    parted -s $dev mkpart primary ntfs 63s 29302559s
    parted -s $dev mkpart primary ext3 547013250s 625137344s

Finally, you want the boot flag to be set on the first partition, so do this:

    parted -s $dev set 1 boot on

reply via email to

[Prev in Thread] Current Thread [Next in Thread]