LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-03-2011, 08:29 AM   #16
gimpy530
Member
 
Registered: Oct 2007
Posts: 98

Original Poster
Rep: Reputation: 16

Quote:
Originally Posted by xeleema View Post
I've been able to replicate the problem by using GPT EFI partitioning on the USB sticks, and *not* dd'ing the head and tail of each device!
You'll need to nuke the drives as I mentioned in my previous post, then use "fdisk" to create the partitions (I have a newfound hatred for parted).
Do you mean you are getting the same results, one drive with a corrupted table? If so, I'll try it in a VM and if I can replicate it there, try the upstream kernel and file a bug report.

fdsik cannot handle GPT or the kind of drives I will eventually move to. From the man page:
Quote:
Originally Posted by fdisk(8)
fdisk doesn't understand GUID Partition Table (GPT) and it is not designed for large partitions. In particular case use more advanced GNU parted(8).
 
Old 02-03-2011, 03:17 PM   #17
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
Quote:
Originally Posted by gimpy530 View Post
Do you mean you are getting the same results, one drive with a corrupted table? If so, I'll try it in a VM and if I can replicate it there, try the upstream kernel and file a bug report.
It was actually happening on every drive I did it to (with parted). I would do a "mklabel gpt" and "mkpart primary 0 7G" then "quit". I hammered-out a script to mess with the logical volume I put on the drives, and when I came back and checked my syslog, I had a few errors (about three per stick). I didn't fully realize what was going on until I came across an EFI/GPT chart (from this guy). Note the bottom of the chart, where an extra copy of the table is kept.

Quote:
Originally Posted by gimpy530 View Post
fdsik cannot handle GPT or the kind of drives I will eventually move to. From the man page:
How big is your single, largest disk? I've used fdisk to setup a partition table on several 1TB drives, recently. Specifically, fdisk (util-linux 2.13-pre7) circa 05mar2006 on CentOS 5.5.
Can you give "cfdisk" a shot and let me know if you're successful?

I've heard that fdisk cannot create a partition table that goes past 2TB (noted here in 2006 and here in 2007), and that appears to be true (though the man page doesn't say how large "large partitions" are).

Here's what I typically do;
1) Install disks.
2) Use fdisk or cfdisk to create "one big partition" on each drive. Tag it as "Linux RAID AutoDetect"
3) Use "mdadm" to create a RAID (in your case, it could just be one big stripe, RAID0, I do RAID10 when I can)
Code:
mdadm --create /dev/md# --level=raid10 --raid-devices=4 --name=name /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
4) "pvcreate /dev/md#" to make a physical volume.
5) "vgcreate --physicalextentsize 32M --verbose vg# /dev/md#" to make the Volume Group.
6) "lvcreate --extents # --name name /dev/vg# && mkfs.ext3 -m0 -L name /dev/vg#/name"

Limitations of fdisk

The newest stable build (2.18 30jun10) available seems to suffer from the same fate as it's predecessors. I pulled down the source and did the following to get to the man page;
Code:
./configure --prefix /home/luser/testing ; make ; sudo make install ; man -M /home/luser/testing/share/man fdisk
Snippit from fdisk 2.18 manpage
Code:
       fdisk does not understand GUID partition tables (GPTs) and it is not designed for  large  partitions.   In  these
       cases, use the more advanced GNU parted(8).
BUGS
       There are several *fdisk programs around.  Each has its problems and strengths.  Try them in  the  order  cfdisk,
       fdisk,  sfdisk.   (Indeed,  cfdisk is a beautiful program that has strict requirements on the partition tables it
       accepts, and produces high quality partition tables.  Use it if you can.  fdisk is  a  buggy  program  that  does
       fuzzy  things  - usually it happens to produce reasonable results.  Its single advantage is that it has some sup-
       port for BSD disk labels and other non-DOS partition tables.  Avoid it if you can.  sfdisk is for hackers only --
       the  user  interface is terrible, but it is more correct than fdisk and more powerful than both fdisk and cfdisk.
       Moreover, it can be used noninteractively.)
 
Old 02-05-2011, 11:37 AM   #18
gimpy530
Member
 
Registered: Oct 2007
Posts: 98

Original Poster
Rep: Reputation: 16
Currently 1TB is the largest drive in that box, but eventually larger ones will be in it and I may move to hardware RAID which would make Linux think it is one big (e.g. 6TB) drive, which is why msdos style partitions won't work as they are limited to 2TB.

The "mkpart primary 0 7G" part confuses me a bit as with GPT, it should be something like this with no mention of "primary" as GPT does not have primary partitions.

Code:
(parted) mklabel                                                          
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? y                                                                 
New disk label type?  [msdos]? g                                          
(parted) mkpart                                                           
Partition name?  []?                                                      
File system type?  [ext2]?                                                
Start? 1M #I always use 1M here as I have read it lines up sectors to blocks regardless of if they are 4096 or whatever.  I don't know if that is true.                                                                 
End? 2G
Also, mdadm is nice but I don't like to use software RAID unless there is no other choice as it is dependent on the OS so it makes recovery more difficult.

Can you post the errors from syslog?
 
Old 02-05-2011, 10:34 PM   #19
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
My aplogies, I was typing from memory. Here's the whole command I was using below.
I've sinced started using most of the 8GB USB sticks for a different test. Give me a day or so, and I should be able to re-run my original test and get the syslog errors I was seeing. (Note that for me, *every* 8GB USB stick was throwing "GPT corrupt" errors)
Code:
luser@lhost$ sudo parted -s /dev/sdr --  mklabel gpt mkpart primary ext2 0 7G
luser@lhost$ sudo fdisk -l /dev/sdr

WARNING: GPT (GUID Partition Table) detected on '/dev/sdr'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sdr: 8029 MB, 8029470208 bytes
255 heads, 63 sectors/track, 976 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdr1               1         977     7841279   ee  EFI GPT
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(0, 0, 1) logical=(0, 0, 2)
Partition 1 has different physical/logical endings:
     phys=(1023, 254, 63) logical=(976, 49, 32)
luser@lhost$

Last edited by xeleema; 02-05-2011 at 10:36 PM. Reason: Argh! Typos suck. :(
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] removed 2 hard drives, not /, error 'corrupt partition table' on reboot gr8scot Linux - Hardware 13 03-19-2008 12:09 AM
Reduce LV -> Partition table corrupt dubya Fedora 5 06-17-2005 10:35 PM
corrupt partition table Verso Linux - Hardware 5 12-16-2003 10:23 AM
Corrupt Partition Table BigBadPenguin Linux - Hardware 3 09-02-2003 11:02 AM
Corrupt partition table mback Linux - Software 3 04-27-2002 11:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration