[YLUG] recovering partition table

Roger Leigh rleigh at codelibre.net
Sat Jul 25 12:28:14 UTC 2009


On Sat, Jul 25, 2009 at 12:38:19PM +0100, Patrick Dupre wrote:
> After I made a mistake, I am trying to recover my disks.

And the mistake was...?

And you have done what after making the mistake...?

>    Device Boot      Start         End      Blocks   Id  System
> /dev/sdd1               1         305     2449881   82  Linux swap /
> Solaris
> /dev/sdd2             306        9726    75674182+   f  W95 Ext'd (LBA)
> /dev/sdd5             306         732     3429846   83  Linux
> /dev/sdd6             733        1733     8040501   83  Linux
> /dev/sdd7            1734        2342     4891761   83  Linux
> /dev/sdd8            2343        2953     4907826   83  Linux
> /dev/sdd9            2954        3318     2931831   83  Linux
> /dev/sdd10           3319        3499     1453851   83  Linux
> /dev/sdd11           3500        5900    19286001   83  Linux
> /dev/sdd12           5901        6901     8040501   83  Linux
> /dev/sdd13           6902        8102     9647001   83  Linux
> /dev/sdd14           8103        9726    13044748+  83  Linux
> 
> which seems OK, but I cannot mount the partition because the filesystem
> is not recognize (VFS: Can't find ext3 filesystem on dev sdd5)

Why does this seem OK?  Is it *exactly* the same as when it was working
correctly?

If the partition layout is not *identical*, your filesystem is not going
to be found because Linux will be looking at the wrong place on the disc.

Did you back up your partition table at any point?

> How can I repair it ?

As always, you will need to provide specific details, or else you won't
get a specific answer.

You haven't told us which partitions are which or how far it gets
through booting.

You can see what's on a partition like so:
% sudo file -L -s /dev/sda*
/dev/sda:  x86 boot sector; partition 1: ID=0x7, active, starthead 1, startsector 63, 195318207 sectors; partition 2: ID=0x83, starthead 254, startsector 195318270, 385560 sectors; partition 3: ID=0xfd, starthead 254, startsector 195703830, 1757816235 sectors, code offset 0x63, OEM-ID "      м", Bytes/sector 190, sectors/cluster 124, reserved sectors 191, FATs 6, root entries 185, sectors 64514 (volumes <=32 MB) , Media descriptor 0xf3, sectors/FAT 20644, heads 6, hidden sectors 309755, sectors 2147991229 (volumes > 32 MB) , physical drive 0x7e, dos < 4.0 BootSector (0x0)
/dev/sda1: x86 boot sector, code offset 0x52, OEM-ID "NTFS    ", sectors/cluster 8, reserved sectors 0, Media descriptor 0xf8, heads 255, hidden sectors 63, dos < 4.0 BootSector (0x80)
/dev/sda2: Linux rev 1.0 ext2 filesystem data (mounted or unclean), UUID=e0acf2fb-ded0-40c1-8bc3-9faee7fc8a73
/dev/sda3: LVM2 (Linux Logical Volume Manager) , UUID: f0kDPL9ML8rd7ZUNrzWFBAmd7xJkSbk

What do you see, to start with?



As an aside, your partition table is far too complex.  If you really
need that many partitions, you need to use LVM.  It's far more
flexible and you will never need to touch it after your initial
installation.  This is my partition table:

% sudo fdisk -l /dev/sda
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000ce55e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       12158    97659103+   7  HPFS/NTFS
/dev/sda2           12159       12182      192780   83  Linux
/dev/sda3           12183      121601   878908117+  fd  Linux raid autodetect

sda1 is a Windows installation which can be ignored.  sda2 is /boot
containing the bootloader files and kernel/initrd.  Everything else
is on sda3, which is a part of a RAID1 set (there's a second disk with
an identical partition table).  LVM is then run on the RAID device
as a single physical volume.  You don't need to use RAID to use LVM
though--you just need a /boot and the rest as a single partition for
use as an LVM Physical Volume.

% sudo pvs
  PV         VG        Fmt  Attr PSize   PFree
  /dev/md0   ravenclaw lvm2 a-   838.19G 149.51G
% sudo vgs
  VG        #PV #LV #SN Attr   VSize   VFree
  ravenclaw   1  10   2 wz--n- 838.19G 149.51G
% sudo lvs
  LV                                            VG        Attr   LSize   Origin  Snap%  Move Log Copy%  Convert
  chroots                                       ravenclaw owi-ao   4.00G                  
  home                                          ravenclaw -wi-ao  50.00G                  
  mybook-backup                                 ravenclaw -wi-ao 600.00G                  
  root                                          ravenclaw -wi-ao 700.00M                  
  swap                                          ravenclaw -wi-ao   8.00G                  
  usr                                           ravenclaw -wi-ao  10.00G                  
  var                                           ravenclaw -wi-ao   6.00G                  

% mount [edited to remove unnecessary stuff]
/dev/mapper/ravenclaw-root on / type ext3 (rw,relatime,errors=remount-ro)
/dev/sda2 on /boot type ext2 (rw,nodev)
/dev/mapper/ravenclaw-home on /home type ext4 (rw,nosuid,nodev,usrquota,grpquota,user_xattr)
/dev/mapper/ravenclaw-usr on /usr type ext4 (rw,nodev,relatime)
/dev/mapper/ravenclaw-var on /var type ext4 (rw,nodev,user_xattr)
tmpfs on /tmp type tmpfs (rw,size=6G,mode=1777)
/dev/mapper/ravenclaw-chroots on /srv/chroot type ext3 (rw)
/dev/mapper/ravenclaw-mybook--backup on /srv/data/phd type ext4 (rw,nosuid,nodev,user_xattr)
/dev/sdb1 on /srv/data/windows-scratch type vfat (rw,uid=1000,gid=1000)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)

% sudo swapon -s
Filename                                Type            Size    Used    Priority
/dev/mapper/ravenclaw-swap              partition       8388600 0       -1

% sudo file -L -s /dev/ravenclaw/*
/dev/ravenclaw/chroots:                                       Linux rev 1.0 ext3 filesystem data, UUID=8f253578-16c6-44d1-a217-58588a2974ea (needs journal recovery) (large files)  
/dev/ravenclaw/home:                                          Linux rev 1.0 ext4 filesystem data, UUID=7175acd2-2eb5-41e6-8404-4858ef1445ae, volume name "home" (needs journal recovery) (extents) (large files) (huge files)                                                 
/dev/ravenclaw/mybook-backup:                                 Linux rev 1.0 ext4 filesystem data, UUID=b83bec63-90ec-459c-bb51-63442890be18, volume name "data1" (needs journal recovery) (extents) (large files) (huge files)                                                
/dev/ravenclaw/root:                                          Linux rev 1.0 ext3 filesystem data, UUID=34595898-69af-48d6-8cc4-2c3423fc2418, volume name "root" (needs journal recovery)                                                                                      
/dev/ravenclaw/sid-snap-68ddab45-e28d-4dc6-a8fd-b165a327f38f: Linux rev 1.0 ext3 filesystem data, UUID=8f253578-16c6-44d1-a217-58588a2974ea (large files)                           
/dev/ravenclaw/sid-snap-7dff68da-110c-4f60-a25c-1ae51505b04e: Linux rev 1.0 ext3 filesystem data, UUID=8f253578-16c6-44d1-a217-58588a2974ea (large files)                           
/dev/ravenclaw/swap:                                          Linux/i386 swap file (new style), version 1 (4K pages), size 2097151 pages, no label, UUID=00000000-0000-0000-0000-000000000000                                                                                 
/dev/ravenclaw/usr:                                           Linux rev 1.0 ext4 filesystem data, UUID=497fbe48-ff65-48bc-aa51-328246040f2d, volume name "usr" (needs journal recovery) (extents) (large files) (huge files)                                                  
/dev/ravenclaw/var:                                           Linux rev 1.0 ext4 filesystem data, UUID=1b23f104-dd48-4f8e-9003-72da69e6d53b, volume name "var" (needs journal recovery) (extents) (large files) (huge files)                                                  
/dev/ravenclaw/var-old:                                       Linux rev 1.0 ext3 filesystem data, UUID=df3b16d4-929b-458f-9138-0ea4c27b222f, volume name "var" (large files)


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://mailman.lug.org.uk/pipermail/york/attachments/20090725/424c14f2/attachment.pgp 


More information about the York mailing list