How to recover an integer ext3 partition from a disk with a damaged partition table ?
Hi, I have a broken solid state disk, in facts badblocks has found about a hundred of damaged blocks. The most shortcoming is that I have lost the partition table too, and I suspect that some bad blocks are in relation with the partition table data since testdisk can not write the recovered partition table to the disk. Now, I need to rescue a 10 GB ext3 partition (that is the last one on device). So, I would like to use dd (or dd_rescue) to physically transfer the partition in a file on an ext3 USB disk, and then mount the file as an ext3 partition (like an iso file by means of loopback device, is it possible ? how ?). Since I am poor experienced with the CHS and LBA notations, someone can me confirm this: testdisk signals that the partition begins at 6403, 1 ,1 and ends at 7798, 254, 63 in CHS notation. Since the disk has 255 heads and 63 sectors, the corrispective LBA addresses would be 102864258 and 125290810, isn't it ? And, what of these data can I pass to dd (or dd_rescue) in order to transfer the partition ? Or can you suggest a better way to rescue the partition ? Thanks in advance, Andrea -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to recover an integer ext3 partition from a disk with a damaged partition table ?
Andrea Mastellone wrote: Hi, I have a broken solid state disk, in facts badblocks has found about a hundred of damaged blocks. The most shortcoming is that I have lost the partition table too, and I suspect that some bad blocks are in relation with the partition table data since testdisk can not write the recovered partition table to the disk. Now, I need to rescue a 10 GB ext3 partition (that is the last one on device). So, I would like to use dd (or dd_rescue) to physically transfer the partition in a file on an ext3 USB disk, and then mount the file as an ext3 partition (like an iso file by means of loopback device, is it possible ? how ?). Since I am poor experienced with the CHS and LBA notations, someone can me confirm this: testdisk signals that the partition begins at 6403, 1 ,1 and ends at 7798, 254, 63 in CHS notation. Since the disk has 255 heads and 63 sectors, the corrispective LBA addresses would be 102864258 and 125290810, isn't it ? And, what of these data can I pass to dd (or dd_rescue) in order to transfer the partition ? Or can you suggest a better way to rescue the partition ? Thanks in advance, Andrea You can not loopback mount then entire drive. But you can mount a partition as long as you know the offset to it using the offset option when loop mounting. Read the loop mount options in the mount man page. Once you use dd-rescue to make an image file of the drive, you should be able to use all the same tools on the image file as you would on the drive itself. Now, if anyone know how to generate the partition devices from an image file, so you could mount the different partitions without using the offset option of loop mounting, I would love to hear about it. Mikkel -- Do not meddle in the affairs of dragons, for thou art crunchy and taste good with Ketchup! signature.asc Description: OpenPGP digital signature -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to recover an integer ext3 partition from a disk with a damaged partition table ?
On Wed, 2008-09-24 at 10:55 -0500, Mikkel L. Ellertson wrote: snip You can not loopback mount then entire drive. But you can mount a partition as long as you know the offset to it using the offset option when loop mounting. Read the loop mount options in the mount man page. Once you use dd-rescue to make an image file of the drive, you should be able to use all the same tools on the image file as you would on the drive itself. Now, if anyone know how to generate the partition devices from an image file, so you could mount the different partitions without using the offset option of loop mounting, I would love to hear about it. I believe you can use losetup for specifying the offset. Mikkel -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to recover an integer ext3 partition from a disk with a damaged partition table ?
Hello, On Wed, 24 Sep 2008, Mikkel L. Ellertson wrote: Now, if anyone know how to generate the partition devices from an image file, so you could mount the different partitions without using the offset option of loop mounting, I would love to hear about it. I think kpartx can do something like what you want but it needs a working partition table. Regards, Kapil. -- signature.asc Description: Digital signature -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to recover an integer ext3 partition from a disk with a damaged partition table ?
Andrea Mastellone wrote, On 09/24/2008 11:12 AM: Hi, I have a broken solid state disk, in facts badblocks has found about a hundred of damaged blocks. The most shortcoming is that I have lost the partition table too, and I suspect that some bad blocks are in relation with the partition table data since testdisk can not write the recovered partition table to the disk. Now, I need to rescue a 10 GB ext3 partition (that is the last one on device). So, I would like to use dd (or dd_rescue) to physically transfer the partition in a file on an ext3 USB disk, and then mount the file as an ext3 partition (like an iso file by means of loopback device, is it possible ? how ?). Since I am poor experienced with the CHS and LBA notations, someone can me confirm this: testdisk signals that the partition begins at 6403, 1 ,1 and ends at 7798, 254, 63 in CHS notation. Since the disk has 255 heads and 63 sectors, the corrispective LBA addresses would be 102864258 and 125290810, isn't it ? And, what of these data can I pass to dd (or dd_rescue) in order to transfer the partition ? Or can you suggest a better way to rescue the partition ? Thanks in advance, Andrea If I were in your situation and had enough GB on a spare disk to hold the whole SSD, I would do something like the following: dd if=/dev/whole_solid_state_disk \ of=/path/to/spareGB/SSD.image \ conv=noerror bs=512 And then I MIGHT try some tricks to find the ext3 super blocks of the image, and/or dd about the last 10GB out of the image as a second image to do e2fsck's and loop mounting on. if I had less space (and no time to buy an extra USB hard drive) and could translate the CHS to bytes/blocks of disk space, I would do something like: assume 512 blocks, and HeadSector size of 7697074bytes bc of 7697074*6402/512 yields 96243491 which is probably completely wrong. (is this roughly a 55GB device?) dd if=/dev/whole_solid_state_disk \ of=/path/to/spare11GB/SSD.image \ seek=96243491 conv=noerror bs=512 And remember, the device is already failing... you MIGHT only get one more read, so take that into consideration when choosing the method for getting the image. -- Todd Denniston Crane Division, Naval Surface Warfare Center (NSWC Crane) Harnessing the Power of Technology for the Warfighter -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to recover an integer ext3 partition from a disk with a damaged partition table ?
Warren Sturm wrote: On Wed, 2008-09-24 at 10:55 -0500, Mikkel L. Ellertson wrote: snip You can not loopback mount then entire drive. But you can mount a partition as long as you know the offset to it using the offset option when loop mounting. Read the loop mount options in the mount man page. Once you use dd-rescue to make an image file of the drive, you should be able to use all the same tools on the image file as you would on the drive itself. Now, if anyone know how to generate the partition devices from an image file, so you could mount the different partitions without using the offset option of loop mounting, I would love to hear about it. I believe you can use losetup for specifying the offset. Thanks, but that is not what I am after. (I talked about the offset option of loop mounts as part of my answer.) What I would like to know about is how to create the equivalent of /dev/sda1, /dev/sda2, etc from an image file.The image file is equivalent to /dev/sda. Mikkel -- Do not meddle in the affairs of dragons, for thou art crunchy and taste good with Ketchup! signature.asc Description: OpenPGP digital signature -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to recover an integer ext3 partition from a disk with a damaged partition table ?
Todd Denniston wrote: Andrea Mastellone wrote, On 09/24/2008 11:12 AM: Hi, if I had less space (and no time to buy an extra USB hard drive) and could translate the CHS to bytes/blocks of disk space, I would do something like: assume 512 blocks, and HeadSector size of 7697074bytes bc of 7697074*6402/512 yields 96243491 which is probably completely wrong. (is this roughly a 55GB device?) Yes, it is about 55 GiB device. Can i proceed so with this ? dd if=/dev/whole_solid_state_disk \ of=/path/to/spare11GB/SSD.image \ seek=96243491 conv=noerror bs=512 Andrea And remember, the device is already failing... you MIGHT only get one more read, so take that into consideration when choosing the method for getting the image. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to recover an integer ext3 partition from a disk with a damaged partition table ?
On Wed, 2008-09-24 at 12:04 -0500, Mikkel L. Ellertson wrote: Warren Sturm wrote: On Wed, 2008-09-24 at 10:55 -0500, Mikkel L. Ellertson wrote: snip You can not loopback mount then entire drive. But you can mount a partition as long as you know the offset to it using the offset option when loop mounting. Read the loop mount options in the mount man page. Once you use dd-rescue to make an image file of the drive, you should be able to use all the same tools on the image file as you would on the drive itself. Now, if anyone know how to generate the partition devices from an image file, so you could mount the different partitions without using the offset option of loop mounting, I would love to hear about it. I believe you can use losetup for specifying the offset. Thanks, but that is not what I am after. (I talked about the offset option of loop mounts as part of my answer.) What I would like to know about is how to create the equivalent of /dev/sda1, /dev/sda2, etc from an image file.The image file is equivalent to /dev/sda. I have not been able to do that without using the loopback offset short of using something like vmware and making a virtual disk out of the image. Mikkel -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to recover an integer ext3 partition from a disk with a damaged partition table ?
Andrea Mastellone wrote, On 09/24/2008 01:10 PM: Todd Denniston wrote: Andrea Mastellone wrote, On 09/24/2008 11:12 AM: Hi, if I had less space (and no time to buy an extra USB hard drive) and could translate the CHS to bytes/blocks of disk space, I would do something like: assume 512 blocks, and HeadSector size of 7697074bytes bc of 7697074*6402/512 yields 96243491 which is probably completely wrong. (is this roughly a 55GB device?) Yes, it is about 55 GiB device. Can i proceed so with this ? No warranties, you get to keep the broken chunks. I was just playing about with the math based on the info that fdisk puts out in the 'p' information, which for my disk was: Units = cylinders of 16065 * 512 = 8225280 bytes and I was guessing was: Units = cylinders of 15033 * 512 = 7697074 bytes based on you indicating the partition in question was 10GB and THAT partition having 7798-6403=1395 cylinders 10*1024*1024*1024/1395=7697074 So these are VERY round about numbers... If you are not going to capture the whole disk, then I would capture significantly more than the calculations show and then trim that down to work with. If I _/HAD/_ to capture less than 55GB of the device, with only the insufficient data I have now, I would do a something more like setting seek to the order of 7697074*6000/512=90200085 and then start looking for filesystem headers in the data. My preference though would be capture the whole device, because it gives you a lot more chances to come up with the correct data. One example of more chances, would be to 'fix' the partition table in a copy of the image, i.e, you know the partition ran from 6403 to 7798 and something like Partitioned loopback devices[1] MIGHT be able to help. Granted we are already WAY outside my comfort zone in giving advise about recovering data from a device that I don't own. If it is really important, there are folks who will do the whole job for a fee. Again no warranties, you get to keep the broken chunks. dd if=/dev/whole_solid_state_disk \ of=/path/to/spare11GB/SSD.image \ seek=96243491 conv=noerror bs=512 Andrea And remember, the device is already failing... you MIGHT only get one more read, so take that into consideration when choosing the method for getting the image. [1] http://lwn.net/Articles/110468/ http://lwn.net/Articles/251908/ http://lwn.net/Articles/274113/ -- Todd Denniston Crane Division, Naval Surface Warfare Center (NSWC Crane) Harnessing the Power of Technology for the Warfighter -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to recover an integer ext3 partition from a disk with a damaged partition table ? [SOLVED] !!!
Todd Denniston wrote: Andrea Mastellone wrote, On 09/24/2008 11:12 AM: Hi, I have a broken solid state disk, in facts badblocks has found about a hundred of damaged blocks. The most shortcoming is that I have lost the partition table too, and I suspect that some bad blocks are in relation with the partition table data since testdisk can not write the recovered partition table to the disk. Now, I need to rescue a 10 GB ext3 partition (that is the last one on device). So, I would like to use dd (or dd_rescue) to physically transfer the partition in a file on an ext3 USB disk, and then mount the file as an ext3 partition (like an iso file by means of loopback device, is it possible ? how ?). Since I am poor experienced with the CHS and LBA notations, someone can me confirm this: testdisk signals that the partition begins at 6403, 1 ,1 and ends at 7798, 254, 63 in CHS notation. Since the disk has 255 heads and 63 sectors, the corrispective LBA addresses would be 102864258 and 125290810, isn't it ? if I had less space (and no time to buy an extra USB hard drive) and could translate the CHS to bytes/blocks of disk space, I would do something like: assume 512 blocks, and HeadSector size of 7697074bytes bc of 7697074*6402/512 yields 96243491 which is probably completely wrong. (is this roughly a 55GB device?) dd if=/dev/whole_solid_state_disk \ of=/path/to/spare11GB/SSD.image \ seek=96243491 conv=noerror bs=512 And remember, the device is already failing... you MIGHT only get one more read, so take that into consideration when choosing the method for getting the image. Successful ! I just issued dd if=/dev/hda of=/mnt/usb/partition skip=102864258 count=22426552 and then mount -o loop /mnt/usb/partition targetdir/ and all important data have been fully recovered !! Andrea -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines