Gparted = departed?

1 view
Skip to first unread message

Dave McCarty

unread,
Nov 19, 2009, 1:24:12 PM11/19/09
to Bismanlug
Not having used my desktop for some time I decided to boot it up and do
some work on it today. Imagine my dismay when the following appeared on
the screen:

GRUB

Error 17
After doing some research on the issue it seems this message means that
GRUB cannot access the boot disk. This was a little confusing since I
had successfully completed the upgrade to 9.10 and it had worked fine. I
found some additional information on what might be wrong and ran the
following in terminal with the results that appear here:

sudo fdisk -l

Disk /dev/sda 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track. 60801 cylindres
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0007f202

Device Boot Start End Blocks Id System
/dev/sda1 1 60801 488384001 b w95 FAT32

Disk /dev/sdc: 4175 MB, 4175953920 bytes
255 heads, 63 sectors/track, 507 cylinders
Units - cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000e17d5

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 507 4072446 b W95 FAT 32

sudo fdisk /dev/sda

The numbers of cylinders for this disk is set to 60801.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help) : x f w
Expert command (m for help)


At this point I remember that prior to our last meeting I had wanted to
redo one of the thumb drives with Unetbootin and Ubuntu 9.10. I had
reformatted the the usb to do a clean install of unetbootin. Then I
remembered that the first time I tried to do that in Gparted it was
pointed to my HD. I thought it just refused to reformat it because it
was mounted but now I think it changed it from ext4 to FAT32,

I tried booting from a live CD but I cannot access the HD. I get a
message that it cannot mount the drive.

I am stuck with a complete rebuild of the desktop? Or is there a trick
to restore it to ext4 and recover the data?

Dave


Dan Falconer

unread,
Nov 19, 2009, 1:42:40 PM11/19/09
to bism...@googlegroups.com
My first thoughts when I saw you'd changed the filesystem on your harddrive from ext4 to FAT32 was, "eeeewww" because of how painful that is.  I suddenly remembered back to a day when I had accidentally changed the main drive in my server from ext(2/3) to swap... then I thought it would be okay when I rebooted.

Okay, all reminiscing aside, I *may* have a solution for you.  But I will warn you, it is probably going to be a pain.  Essentially, it involves pulling all the data off your drive using dd, writing that info to another drive, formatting your drive to the proper fs, then re-writing the data back.  DISCLAIMER: I have no idea if this will work.

  1. Have a spare drive (i.e. a thumb drive or external hd with lots of space: it must have more space that whatever size your hd was).
  2. Boot off a rescue disk.  I prefer Knoppix, but your mileage may vary.  NOTE:  if the 5.x version doesn't recognize your hardware or otherwise fails, you should use the 3.6 version (that has worked for me on older systems in the past).
  3. Mount your extra drive (we'll say as "/mnt/backup" for now)
  4. Use DD to copy the **partition** (i.e. /dev/sda1): dd if=/dev/sda1 of=/mnt/backup/sda1.dd
  5. That step will take a while, depending on the size of the partition (I used this on a ~40G drive on an old system, took something like 4 hours)
  6. At this point, I would do some testing, if you have **another** drive available that you don't care about destroying:
    1. fdisk the drive, give it a partition of >= size of your partition you just imaged (via dd)
    2. make **sure** that new partion is not mounted.
    3. write your image to that new partition: dd if=/mnt/backup/sda.dd of=</dev/newdevice>
    4. mount the new partition to see if your old data is on there.
  7. Assuming the testing worked (i.e. that this isn't a ridiculous notion), fdisk the device that contains the imaged partition, giving it the exact fs it had before
  8. Write your new data to the drive (see sub-items under 6)
  9. Pray.
Again, I have no idea if this will work for you.  Any time that I've installed Linux on a desktop when the user wasn't sure, I first created an image of the entire drive via dd (dd if=/dev/sda of=/mnt/myexternalhdd/machineName.dd).  I have been very successful at building and restoring images this way, though I've done a lot of testing through virtual machines first.

Good luck!
--
Best Regards,


Dan Falconer
http://CrazedSanity.com || http://www.Buzzkill.org

Dan Falconer

unread,
Nov 19, 2009, 1:48:22 PM11/19/09
to bism...@googlegroups.com
A quick word of caution when using DD: make ****certain**** the arguments are correct.  I can't stress that enough.  Getting them wrong could overwrite a good partion's data with the bad partition's data.  dd is very powerful, but very easy to do very terrible things with... you've been warned.
Reply all
Reply to author
Forward
0 new messages