You are not logged in.

#1 2008-11-06 10:53:28

slipper
Member
Registered: 2008-09-11
Posts: 28

XFS - Reinstall GRUB

Well I know now not to install grub onto an XFS filesystem. However I've still got a problem. My HDD currently looks like this:

/dev/sda1 swap (ext2)
/dev/sda2 /       (xfs)
/dev/sda3 XP    (ntfs)

I created a new 20GB partition and installed XP on it. I then booted into Arch Live environment and used grub-install /dev/sda. It told me that it could not find a device for /boot. Then I done what I should have done in the first place and followed the instructions here: http://wiki.archlinux.org/index.php/Reinstalling_GRUB

I got up to mounting my current installation. I used

mount -t xfs /dev/sda2 /mnt

. To which it returned:

wrong fs type, bad options, bad superblock on /dev/sda2, missing codepage or other error.

I installed xfsprogs (still in live environment here) and ran xfs_repair -v /dev/sda and it's output is:

Phase 1
bad primary superblock - bad magic number
attempting to find secondary superblock...

...And it's been putting full stop after fullstop across the screen for about 20 minutes. All I want to do now is be able to boot back onto my Arch installation or at the very least salvage files off of it. Help appreciated.

Offline

#2 2008-11-06 11:41:55

JGC
Developer
Registered: 2003-12-03
Posts: 1,664

Re: XFS - Reinstall GRUB

If your superblock is corrupted after messing with grub, I think you installed grub on /dev/sda2 instead of /dev/sda. Installing bootloaders in a partition instead of MBR is only supported on ext2 and ext3, other partition types will get a corrupted superblock due to such an action. You should let xfs_repair repair your filesystem to recover the lost superblock, this can be a quite long operation.

Offline

#3 2008-11-06 11:51:53

slipper
Member
Registered: 2008-09-11
Posts: 28

Re: XFS - Reinstall GRUB

JGC wrote:

If your superblock is corrupted after messing with grub, I think you installed grub on /dev/sda2 instead of /dev/sda. Installing bootloaders in a partition instead of MBR is only supported on ext2 and ext3, other partition types will get a corrupted superblock due to such an action. You should let xfs_repair repair your filesystem to recover the lost superblock, this can be a quite long operation.

Thanks very much for the help. smile

I managed to boot back into my install. I made a new partition and installed GRUB to that, used fdisk to fix bootable flags and now all seems to be working okay. I might let xfs_repair run overnight and see if that fixes it.

Offline

#4 2008-11-06 17:55:39

thisperishedmin
Member
Registered: 2008-11-04
Posts: 164

Re: XFS - Reinstall GRUB

uh oh...I just setup arch on XFS lol...what happened to cause your problem initially?

I'm slightly unclear if it was an XFS related problem, or if the problem was in fact installing grub to sda2.  Some clarification would be appreciated.  I'm sure it might save my bum one day too tongue

Offline

#5 2008-11-06 21:46:00

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: XFS - Reinstall GRUB

As a rule, I always have my /boot partition ext2 to avoid any problems like this smile


neutral

Offline

#6 2008-11-07 03:08:32

slipper
Member
Registered: 2008-09-11
Posts: 28

Re: XFS - Reinstall GRUB

thisperishedmin wrote:

uh oh...I just setup arch on XFS lol...what happened to cause your problem initially?

Trying to reinstall GRUB on XFS (after XP installed its bootloader) seemed to cause it. They both try to use sector 0 which XFS needs. Owell, live and learn. wink

Offline

#7 2008-11-07 13:32:30

thisperishedmin
Member
Registered: 2008-11-04
Posts: 164

Re: XFS - Reinstall GRUB

haha ^^^ right you are.

sand_man - good point on the /boot partition.  I will definitely keep that in mind.  I've first seperated out /boot and swap and home and such by partition on this install.  I can see some advantages to it already - and it makes me sad I used to put Ubuntu all together on one partition lol. 

but like slipper said... live and learn wink

Offline

#8 2008-11-07 13:58:00

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: XFS - Reinstall GRUB

long time ago there was a bug in GRUB that caused a lot of problems with xfs. I think that this was fixed already.
Personally I prefer small /boot ext2 partition (~30-50 MB) which is even not mounted.
/dev/sda1 /boot ext2 acl,noatime,noexec,noauto,user_xattr 0 1

works well for me. Of course you need to remember to mount /boot before installing new kernel wink

Offline

Board footer

Powered by FluxBB