LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 02-08-2010, 04:01 PM   #1
keith9e
LQ Newbie
 
Registered: Feb 2010
Location: Berlin, New Jersey
Posts: 8

Rep: Reputation: Disabled
Invalid partition table for swap partition that I moved with Gparted


Hi there. Glad to be a part of this forum! I was reading another thread about someone with a bad partition table and I decided to join this forum. I'm not going to take any drastic actions with the partition (/dev/sda3) in question. I am going to wait for instructions on what to do first. I am not very good with Linux and need some hand holding.

System: DELL 4550 Dual-Booted with XP and Ubuntu. Works OK, just no swap.
Well, here's what I did: I deleted a partition for Windows XP Pro because it was a trial, and it ran out. I then decided to slide the swap partition for the Ubuntu Linux that I dual-boot into over. (If this was successful, I was going to try expanding the root partition to take up the unused space.) I used Gparted on a CD to do this, as I figured it was safe to do.

I now cannot mount the swap space at bootup (and have to go into a backup version of the OS), although I can use Gparted in Linux to execute the "swapon" command, and it appears that it worked because I now see "swapoff" as an option on the context menu. (I actually don't even need a swap partition, except to hibernate.)

If I highlight the swap partition and click on "Drive" on Gparted's menu bar and select "Create Partition Table", it will erase all data on /dev/sda, so how do I fix the bad partition table non-destructively? Thanks in advance for the solution to this gnarly problem!!!

(Sorry for the convoluted explanation.)

~Keith
 
Old 02-08-2010, 04:04 PM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,758

Rep: Reputation: Disabled
post output of

#parted
>print all
 
Old 02-08-2010, 04:23 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,499

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Which version of Ubuntu ?. - will allow us to tell which version of grub you are likely using. Moving the swap will probably have changed the UUID, which Ubuntu uses by default.
Shouldn't be a big dealt to fix (or bypass) to get you going.
 
Old 02-08-2010, 04:47 PM   #4
keith9e
LQ Newbie
 
Registered: Feb 2010
Location: Berlin, New Jersey
Posts: 8

Original Poster
Rep: Reputation: Disabled
bad partition table for swap

Thanks for the quick replies. I tried the #parted command but it didn't work & I am not a super-user. Doesn't the # make it a remark? Is sudo the right thing to use? I am confused. What exactly do I type in terminal?

I am using Ubuntu 9.10

~Keith
 
Old 02-08-2010, 05:07 PM   #5
keith9e
LQ Newbie
 
Registered: Feb 2010
Location: Berlin, New Jersey
Posts: 8

Original Poster
Rep: Reputation: Disabled
I figured it out...

I logged in as root and executed the command. Here is the output:

Disk /dev/sda3: 2155MB 2155023360 bytes
255 heads, 63 sectors/track, 262 cylinders
Units= cylinders of 16065*512=8225280 bytes
Disk Identifier: 0x45a18b9d

(sometimes it takes a few tries to 'get it')

~Keith
 
Old 02-08-2010, 06:18 PM   #6
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by keith9e View Post
I now cannot mount the swap space at bootup...
What is the output of "sudo fdisk -l"?
 
Old 02-08-2010, 06:26 PM   #7
keith9e
LQ Newbie
 
Registered: Feb 2010
Location: Berlin, New Jersey
Posts: 8

Original Poster
Rep: Reputation: Disabled
output for sudo fdisk -l:

Are you ready?

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0b9530a0

Device Boot Start End Blocks Id System
/dev/sda1 * 1 12926 103828063+ 7 HPFS/NTFS
/dev/sda2 12927 14078 9253440 83 Linux
/dev/sda3 14332 14593 2104515 82 Linux swap / Solaris

Disk /dev/sdb: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x9dc96e9e

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 6902 55440283+ 6 FAT16
/dev/sdb2 6903 7297 3172837+ 83 Linux

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

Device Boot Start End Blocks Id System
/dev/sdc1 1 22960 184426168+ 7 HPFS/NTFS
/dev/sdc2 22961 23344 3084480 6 FAT16
/dev/sdc3 23345 60801 300873352+ 7 HPFS/NTFS

Disk /dev/sdd: 2004 MB, 2004877312 bytes
129 heads, 32 sectors/track, 948 cylinders
Units = cylinders of 4128 * 512 = 2113536 bytes
Disk identifier: 0x406041be

Device Boot Start End Blocks Id System
/dev/sdd1 * 1 949 1957872 b W95 FAT32
Partition 1 has different physical/logical endings:
phys=(956, 128, 32) logical=(948, 75, 32)

Disk /dev/sde: 2004 MB, 2004877312 bytes
129 heads, 32 sectors/track, 948 cylinders
Units = cylinders of 4128 * 512 = 2113536 bytes
Disk identifier: 0xc3072e18

Device Boot Start End Blocks Id System
/dev/sde1 * 1 949 1957872 6 FAT16
Partition 1 has different physical/logical endings:
phys=(956, 128, 32) logical=(948, 75, 32)

~Keith
 
Old 02-08-2010, 08:12 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,499

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
I haven't been playing with grub2, but I'd be inclined to believe you should be able to solve this by regenerating the control files with a simple
Code:
sudo update-grub
Edit: before doing that, just to confirm which version of grub you are running, let's see the output of
Code:
grub-install -v

Last edited by syg00; 02-08-2010 at 08:14 PM.
 
Old 02-08-2010, 10:09 PM   #9
keith9e
LQ Newbie
 
Registered: Feb 2010
Location: Berlin, New Jersey
Posts: 8

Original Poster
Rep: Reputation: Disabled
grub version

grub-install (GNU GRUB 1.97~beta4)

OK to update grub?

~Keith
 
Old 02-08-2010, 10:16 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,499

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Yes, that's grub2 - the update should fix things.
 
Old 02-08-2010, 10:40 PM   #11
keith9e
LQ Newbie
 
Registered: Feb 2010
Location: Berlin, New Jersey
Posts: 8

Original Poster
Rep: Reputation: Disabled
Updating grub

Well, updating grub did not help. I rebooted, and this is the error message that I have been greeted with since this happened:

One or more of the mounts listed in /etc/fstab cannot yet be mounted: swap: waiting for UUID=da3fa708-4a56-42f6-8688-1d44f4587d9e
Press ESC to enter a recovery shell

...Which I did and here we are. By the way, thank you all for your kind help. It is much appreciated. A rather tenacious little mystery we have here... (Yes I have backed up!)

~Keith

Last edited by keith9e; 02-08-2010 at 10:42 PM.
 
Old 02-09-2010, 01:37 AM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,499

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Would have helped had we had that message earlier. Try this from the recovery shell
Code:
sed -r -i '/swap/ s/^UUID/# UUID/' /etc/fstab
This will comment out the swap entry, and you should be able to reboot. Once back in, you'll need to fix that entry for swap. From a terminal
Code:
 sudo gedit /etc/fstab
This is a fullscreen "windows" editor. Find the line that looks like:
# UUID=27818159-796a-4937-8258-2787adc2d5e1 none swap sw 0 0
This needs fixing - delete the "#" and the following blank we just added. Now open another terminal and enter this
Code:
blkid | grep -i swap
This will show you the new UUID for the swap partition. The new value must replace the UUID= value in /etc/fstab that you have open in the editor.

Should be all.
 
Old 02-09-2010, 07:56 AM   #13
keith9e
LQ Newbie
 
Registered: Feb 2010
Location: Berlin, New Jersey
Posts: 8

Original Poster
Rep: Reputation: Disabled
Success at last!

Gentlemen: Good morning. I apologize profusely for not following proper troubleshooting protocol and stating the exact error message in the first place.

I followed your latest instructions precisely and they worked flawlessly!

This has been a great learning experience. Now, I am wondering about expanding the root partition to fill all available space. I would use Gparted again, but I fear that I will somehow disable my system due to lack of experience in this area. I don't need the space, so I'm not going to do it unless I am 100% assured of success. I would just like to hear your professional opinions on this subject. (Man, Linux sure is finicky!)

In any case, it has been a pleasure to be helped by you. Thanks!

~Keith
 
Old 02-09-2010, 08:18 AM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,499

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Quote:
Originally Posted by keith9e View Post
(Man, Linux sure is finicky!)
Blame the Ubuntu devs for this, not Linux. They chose to use UUID like this because they (presumably) thought their users were too stupid to understand traditional device addresses.
I regularly move things around - I avoid UUID like the plague.

As for expanding the root, that looks like it should be o.k. - so long as you expand it to the "right" (in the gparted graphic). Nothing to worry about if you merely use the spare space between sda2 and sda3.
 
Old 02-09-2010, 08:29 PM   #15
keith9e
LQ Newbie
 
Registered: Feb 2010
Location: Berlin, New Jersey
Posts: 8

Original Poster
Rep: Reputation: Disabled
Avoiding UUID

OK, let's say I decide to expand my root partition. Exactly how would I go about avoiding UUID?
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel unable re-read partition table on disks when i start gparted penduleum Fedora 6 04-20-2010 07:56 AM
cloning linux partition to different laptop, invalid partition table dsollen Linux - Software 8 11-23-2009 09:50 PM
need bigger swap partition but missing a valid partition table compused Linux - Hardware 3 07-02-2008 09:46 AM
gparted destroyed partition table orionp31 Linux - Newbie 5 02-04-2007 11:33 PM
Invalid Partition Table xiojqwnko Slackware 2 04-04-2004 06:27 PM


All times are GMT -5. The time now is 05:58 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration