4

I was creating a partition using the parted command and i used the mkpart option to create a new primary partition. But i got an unusual error message while doing this. This is my output:

(parted) print Model: ATA VBOX HARDDISK (scsi) Disk /dev/sda: 729GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 300GB 300GB primary ext4 boot (parted) mkpart Partition type? primary/extended? primary File system type? ext4 Start? 1050 End? 30000 Warning: You requested a partition from 1050MB to 30.0GB (sector 2050781..58593750). The closest location we can manage is 300GB to 300GB (sector 585936896..585936896). Is this still acceptable to you? Yes/No? 
  • I did the start at 1050 (because the previous partition starts at 1049) and i did the end at 30GB as i wanted it (30000MB)

  • I have been told that i have to do the Start value as one more than the previous partition's start value and i should do the end value at the size i want in MB as parted uses MB by default.

2
  • 1
    I apologize for leading you astray. When I last messaged you I said a 30GB partition would be the start of that partition, as in roughly 1 unit more then the end of the previous partition, plus 30 GB worth of units. user derobert has the answer. You need to have the start be 1 sector more than the end of the previous partition. Commented May 7, 2019 at 17:39
  • Its cool, im still learning lol anyways so my current understanding is that for the start i should make it more more digit than the previous partitions start. And for the end i should do it the actual size i want it to be. Isnt this correct? Commented May 7, 2019 at 17:43

1 Answer 1

5

Partitions must not overlap, so the start of the second partition must be at least one sector after (larger number) than the last sector of the first partition. Not the first sector, the last.

Your first partition starts at offset 1049kb and is 300GB in size. Parted is asking you for a start position in MB; your first partition runs from (approximately) 1 through 300000 MB (the "end" position, multiplied by 1000 to convert from GB to MB). So 1050 would be in the middle of that, hence not allowed.

You can have parted print the sizes entirely in MB by running unit MB before print. That will make it easier to see what is happening and the right numbers to use. You could switch to sectors with unit s, if you need to get the positioning perfect.

7
  • Firstly thanks for the answer man, and Im still not understanding it could you explain to me what i would write for the start and end value or how i can work out what to put for them? Commented May 7, 2019 at 17:36
  • @Qasim If you put '300GB' as the start and '330GB' as the end, that should work, giving you a 30GB partition. Or switch it to MB, and run print again to see the values to use. Commented May 7, 2019 at 17:50
  • Hm ok i see, but how does this work, i just need you to explain to me what i should add for my start and end values and why. Or how i could calculate the start and end im just trying to get a good understanding of it Commented May 7, 2019 at 17:52
  • @Qasim You start partition 2 where partition 1 ended. Your partition 1 ends at 300GB, so that's what you'd use a start value for partition 2. Commented May 7, 2019 at 18:05
  • Ok and where would i end it? Commented May 7, 2019 at 18:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.