Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to do some disk partitioning to specific sectors using the parted command (because fdisk hasn't been updated to handle large drives). But this thing doesn't seem to work as documented.
Code:
root@ubuntu:~# parted /dev/sda unit s mklabel gpt mkpart primary 50331648 7812415487
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
parted: invalid token: gpt
Yes/No? ^C
root@ubuntu:~# parted /dev/sda unit s mkpart primary 50331648 7812415487
Error: partition length of 7762061790 sectors exceeds the msdos-partition-table-imposed maximum of 4294967295
root@ubuntu:~# parted /dev/sda unit s mkpart gpt 50331648 7812415487
parted: invalid token: gpt
Partition type? primary/extended? primary
File system type? [ext2]?
Start? 50331648
End? 7812415487
Error: partition length of 7762061790 sectors exceeds the msdos-partition-table-imposed maximum of 4294967295
root@ubuntu:~#
One of the most lame pieces of software I've seen ... or else its man page (the info doc is just a replica of the man page) is just plain wrong.
Error: partition length of 7762061790 sectors exceeds the msdos-partition-table-imposed maximum of 4294967295
You can't make a partition in a PC MBR (master boot record) that is larger than ((2^32) - 1) sectors. The field used to store the partition size is only 32 bits wide. The largest positive number that field can hold is 4294967295.
If you will notice, I tried to set the label to be a GPT. Yes, I know of the issue with MSDOS style partition table. The parted command was supposed to be able to do this ... to do GPT ... to solve this issue. It seems to be broken at least in the Ubuntu package. Or at least the man page (go read it) isn't consistent with it.
If you will notice, I tried to set the label to be a GPT.
Well, this is the latest documentation from the GNU web site:
Code:
part-type is one of `primary’, ‘extended’ or ‘logical’, and may
be specified only with ‘msdos’ or ‘dvh’ partition tables. A name
must be specified for a ‘gpt’ partition table.
At the least, it looks like your desire to make a primary partition is in conflict with your desire to make a GPT label.
Also, if you use parted in interactive mode, you DO NOT want to use the "mkpart" command. You want to use the "mklabel" command.
Also, if you use parted in interactive mode, you DO NOT want to use the "mkpart" command. You want to use the "mklabel" command.
I don't want to use it in interactive mode. That was just a test. I want to do it all on one command line, automated from a script. It just doesn't accept the "gpt" keyword for "mklabel". Maybe all the other errors are because it didn't understand "gpt"?
The only other command line partition program that is supposed to be GPT aware is "gptdisk", and it isn't available for Ubuntu and won't compile on Ubuntu due to a missing header.
Syntactically, that seems to work. But it accepts commands both ways, too:
Code:
altair/root /root 368# parted /dev/sda unit s print
Model: ATA ST9250410ASG (scsi)
Disk /dev/sda: 488397168s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 256s 262143s 261888s primary ext2 boot
2 262144s 12582911s 12320768s primary reiserfs
3 12582912s 14680063s 2097152s primary linux-swap(v1)
4 14680064s 488397167s 473717104s primary reiserfs
altair/root /root 369# parted /dev/sda 'unit s' print
Model: ATA ST9250410ASG (scsi)
Disk /dev/sda: 488397168s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 256s 262143s 261888s primary ext2 boot
2 262144s 12582911s 12320768s primary reiserfs
3 12582912s 14680063s 2097152s primary linux-swap(v1)
4 14680064s 488397167s 473717104s primary reiserfs
altair/root /root 370# parted /dev/sda "unit s" print
Model: ATA ST9250410ASG (scsi)
Disk /dev/sda: 488397168s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 256s 262143s 261888s primary ext2 boot
2 262144s 12582911s 12320768s primary reiserfs
3 12582912s 14680063s 2097152s primary linux-swap(v1)
4 14680064s 488397167s 473717104s primary reiserfs
altair/root /root 371#
However, no joy with the mklabel command in all forms:
Code:
altair/root /root 441# parted /dev/sdc unit s mklabel gpt
Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue?
parted: invalid token: gpt
Yes/No? ^C
altair/root /root 442# parted /dev/sdc 'unit s' 'mklabel gpt'
Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue?
parted: invalid token: gpt
Yes/No? ^C
altair/root /root 443# parted /dev/sdc "unit s" "mklabel gpt"
Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue?
parted: invalid token: gpt
Yes/No? ^C
altair/root /root 444#
It seems like this version of parted (both what's on the Live CD, which I am using to try to do it on a 4TB RAID array on a new server, and on my already installed laptop where I am testing doing this to a 4GB USB memory stick) doesn't support GPT.
I finally got the gptdisk package (source only, no ubuntu package found) to compile on my laptop and it seems to work. Now I need to figure out how to get it onto the live CD.
It seems like this version of parted (both what's on the Live CD, which I am using to try to do it on a 4TB RAID array on a new server, and on my already installed laptop where I am testing doing this to a 4GB USB memory stick) doesn't support GPT.
I have parted version 1.8.9 on an Ubuntu 8.10 installation:
Code:
[user@machine]:parted --version
parted (GNU parted) 1.8.9
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by <http://parted.alioth.debian.org/cgi-bin/trac.cgi/browser/AUTHORS>.
It allowed me to create a GPT partition on a thumb drive. If you really need a LiveCD with the latest parted, you should try System Rescue CD.
altair/root /root 447# parted --version
parted (GNU parted) 1.8.8.1.159-1e0e
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by <http://parted.alioth.debian.org/cgi-bin/trac.cgi/browser/AUTHORS>.
altair/root /root 448#
altair/root /root 461# cat /lib/libparted-1.8.so.12.0.0 /sbin/parted | strings | fgrep -i gpt
ped_disk_gpt_done
ped_disk_gpt_init
GNU Parted supports this EXPERIMENTALLY for some special disk label/file system combinations, e.g. GPT and ext2/3.
-../../../libparted/labels/gpt.c
%s contains GPT signatures, indicating that it has a GPT table. However, it does not have a valid fake msdos partition table, as it should. Perhaps it was corrupted -- possibly by a program that doesn't understand GPT partition tables. Or perhaps you deleted the GPT table, and are now using an msdos partition table. Is this a GPT partition table?
The backup GPT table is not at the end of the disk, as it should be. This might mean that another operating system believes the disk is smaller. Fix, by moving the backup to the end (and removing the old backup)?
The primary GPT table is corrupt, but the backup appears OK, so that will be used.
Both the primary and backup GPT tables are corrupt. Try making a fresh table, and using Parted's rescue feature to recover partitions.
_header_is_valid (disk->dev, gpt)
The format of the GPT partition table is version %x, which is newer than what Parted can recognise. Please tell us! bug-parted@gnu.org
Not all of the space available to %s appears to be used, you can fix the GPT to use all of the space (an extra %llu blocks) or continue with the current setting?
gpt_disk_data->entry_count > 0
gpt_disk_data->entry_count <= 8192
gpt_part_data != NULL
PARTED_GPT_APPLE
gpt_alloc_metadata
gpt_partition_enumerate
gpt_partition_align
gpt_partition_get_flag
gpt_partition_set_flag
gpt_partition_set_system
gpt_partition_destroy
gpt_write
gpt_clobber
gpt_probe
ped_disk_gpt_init
so I don't know what is the cause. An early bug? Disabled by Ubuntu team?
I've decided to write my own modeled on gdisk in the gptdisk package. The parted command is just too inflexible. I just don't know when I can get to that. I'll use gdisk in the mean time.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.