Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
reiser partition didn't even survive one boot :/
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
nyda
Apprentice
Apprentice


Joined: 12 Aug 2004
Posts: 183

PostPosted: Sat Dec 25, 2004 12:06 am    Post subject: reiser partition didn't even survive one boot :/ Reply with quote

So, I got a new harddisk today and thought I would just copy Gentoo from the old disk onto the new disk, setup the boot loader reboot.
The kernel came up fine but then stopped (not panic'ed) during swap activation (using the correct partition) and I had to make a hardware reset.
Next reboot, kernel panic'ed mounting the root partition.

Now, booting again with the old hdd, the new HDD's root partition won't mount. fsck finds a corruption that can only be corrected by rebuilding the tree. Did that, but the directory structure is completely broken now (basically all filenames are lost, it's just numbers now).

Long story short, I was wondering if this could really have been caused by the kernel freeze or the panic afterwards. At least during the freeze, my new root wasn't even mounted, and during the panic it should have been readonly, right? Is there any way to test if it's the harddisk or what else could have gone wrong?
Back to top
View user's profile Send private message
landon
Apprentice
Apprentice


Joined: 09 Mar 2004
Posts: 159

PostPosted: Sat Dec 25, 2004 12:08 am    Post subject: Re: reiser partition didn't even survive one boot :/ Reply with quote

nyda wrote:
and thought I would just copy Gentoo from the old disk onto the new disk, setup the boot loader reboot.


Please outline the steps that you performed. Don't skimp on the details.
Back to top
View user's profile Send private message
srlinuxx
l33t
l33t


Joined: 22 Nov 2003
Posts: 627

PostPosted: Sat Dec 25, 2004 12:39 am    Post subject: Re: reiser partition didn't even survive one boot :/ Reply with quote

landon wrote:
nyda wrote:
and thought I would just copy Gentoo from the old disk onto the new disk, setup the boot loader reboot.


Please outline the steps that you performed. Don't skimp on the details.


Yeah, you probably goofed up on the permissions or something. if you make the partition the same exact size you can dd it. otherwise use cp -a. make sure you fix the fstab and lilo.conf before trying to boot it.

But it works good cuz I've done it 3 or 4 times.
_________________
--You talk the talk, but do you waddle the waddle?
-Gentoo Monthly Screenshots
Back to top
View user's profile Send private message
nyda
Apprentice
Apprentice


Joined: 12 Aug 2004
Posts: 183

PostPosted: Sat Dec 25, 2004 12:43 am    Post subject: Reply with quote

Ok, I guess that was a bit vague. So here are the details. Thanks for your help :)

"Old" disk was and still is hdb. New disk replaces former hda master.

Code:
fdisk /dev/hda
  new linux, 32M, make active
  new swap, change type swap (0x82)
  new linux, remaining space
  write partition table

mkfs.ext2 /dev/hda1
mkswap /dev/hda2
mkfs.reiserfs /dev/hda3

mount /dev/hda3 /mnt/tmp
cp -ax / /mnt/tmp

adjust /mnt/tmp/etc/fstab ("hdb"->"hda")

set up grub on the new disk properly (grub on mbr of new disk, config from old disk, replaced hd1 with hd0)

set bios primary boot device to new disk (does not swap disk names, just boots from the other one)

reboot

grub comes up from new disk, kernel boots and stops during swap activation (without disk activity).

hardware reset...
Back to top
View user's profile Send private message
nyda
Apprentice
Apprentice


Joined: 12 Aug 2004
Posts: 183

PostPosted: Sat Dec 25, 2004 2:46 am    Post subject: Reply with quote

Ok, it just killed my other drive - which means I just lost my data. :cry: :evil:

It happened after I fdisked my new drive again, copied the system files over to the new one and did a reboot. This time I forgot to adjust the fstab, so it used the swap partition on my old disk (which *SHOULD* have been fine!). It didn't hang during "Adding ...K swap on /dev/hdb2" (thats the correct partition on that disk), but afterwards hdb3 was trashed.

I can only guess that the beginning of hdb3 has been overwritten with swap trash from hdb2, although the swap-size given in the message should have fit into the swap-partition. I have no clue why it does this or why it only happens when the OS boots from the new disk.

I'm stuck here, I need some suggestions, please. :(
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Sat Dec 25, 2004 2:54 am    Post subject: Reply with quote

nyda wrote:
Code:
set up grub on the new disk properly (grub on mbr of new disk, config from old disk, replaced hd1 with hd0)

set bios primary boot device to new disk (does not swap disk names, just boots from the other one)

I think this is the part that caused your problems.

Changing the boot drive in the BIOS does not affect the way the kernel sees the drives (hda is still hda) this part is true, but the BIOS settings do affect the way GRUB sees the drives (the drive you boot from becomes hd0).
Back to top
View user's profile Send private message
nyda
Apprentice
Apprentice


Joined: 12 Aug 2004
Posts: 183

PostPosted: Sat Dec 25, 2004 2:58 am    Post subject: Reply with quote

No, it's not a harddisk swap. I know some BIOSes have such an option (my old Epox board had it), but this is just a boot device priority change.

Even if that was the problem, it still doesn't explain why everytime the kernel initializes the swap, the partition after the swap partition is trashed.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Sat Dec 25, 2004 3:03 am    Post subject: Reply with quote

nyda wrote:
No, it's not a harddisk swap. I know some BIOSes have such an option (my old Epox board had it), but this is just a boot device priority change.

That is the same thing, as far as GRUB is concerned.
Back to top
View user's profile Send private message
nyda
Apprentice
Apprentice


Joined: 12 Aug 2004
Posts: 183

PostPosted: Sat Dec 25, 2004 3:27 am    Post subject: Reply with quote

cyrillic wrote:
That is the same thing, as far as GRUB is concerned.


Ok, so let's just assume you're right. Then there is still the problem that the swap is specified in fstab (using kernel names) and not by grub. And even if those were wrong too, then each partition would still match a compatible partition on the other disk as the layout is exactly identical.

Code:
hda1: 32MB ext2, boot    hdb1: 32MB ext2, boot
hda2: 1G swap            hdb2: 1G swap
hda3: ~75GB reiserfs     hdb3: ~200GB reiserfs


If, say the reiser and swap partition were in different order on one of the disks, I'd see the problem. But they aren't. It shouldn't matter which swap is used!

I have backups of most of my code/work, but I can't just go and reinstall (&compile) gentoo for hours if the next boot might very well wipe it all out again...?
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Sat Dec 25, 2004 3:51 am    Post subject: Reply with quote

I have no idea why your filesystems are getting corrupted.

Since your partition layouts are the same on both drives, it should not have done any harm to boot from the wrong drive, or have your root filesystem on one drive and swap on the other. In fact, you should not have even noticed the difference unless you looked at the output of "mount"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum