Moved root filesystem to new disk....now what?

Moved root filesystem to new disk....now what?

Post by Michael Knig » Sat, 30 Mar 2002 11:42:46



After a bit of help from this group, I was able to successfully copy
over my root filesystem over to a new drive partition.

I did this by booting off the RedHat 7.2 CD and going to linux rescue
mode.

My original root filesystem existed on /dev/hda1 and I wanted it to
reside on /dev/hdb1

So, without either drive mounted, I did....

dd if=/dev/hda1 of=/dev/hdb1

This was successful, but since the new partition was larger than the
old one, my filesystem didn't take up the entire partition.

I fixed this by doing "resize2fs /dev/hdb1"

This seemed successful and "df ." with the drive mounted reported the
correct size on /dev/hdb1.

I changed /etc/grub.conf to reflect that root now resided on
/dev/hdb1.

However, mount still reports.....

/dev/hda1 on / type ext3 (rw)

I know from the filesystem size that I'm actually running on
/dev/hdb1, but I can't figure out how to make it show /dev/hdb1
instead of /dev/hda1.....what did I do wrong?

-Michael

 
 
 

Moved root filesystem to new disk....now what?

Post by And.. » Sat, 30 Mar 2002 11:54:48




>After a bit of help from this group, I was able to successfully copy
>over my root filesystem over to a new drive partition.

>I did this by booting off the RedHat 7.2 CD and going to linux rescue
>mode.

>My original root filesystem existed on /dev/hda1 and I wanted it to
>reside on /dev/hdb1

>So, without either drive mounted, I did....

>dd if=/dev/hda1 of=/dev/hdb1

>This was successful, but since the new partition was larger than the
>old one, my filesystem didn't take up the entire partition.

>I fixed this by doing "resize2fs /dev/hdb1"

>This seemed successful and "df ." with the drive mounted reported the
>correct size on /dev/hdb1.

>I changed /etc/grub.conf to reflect that root now resided on
>/dev/hdb1.

>However, mount still reports.....

>/dev/hda1 on / type ext3 (rw)

>I know from the filesystem size that I'm actually running on
>/dev/hdb1, but I can't figure out how to make it show /dev/hdb1
>instead of /dev/hda1.....what did I do wrong?

>-Michael

Edit the /etc/fstab file
And change it there, it should be obvious.
/dev/hda1 /
changed to
/dev/hdb1 /

Andrew

 
 
 

Moved root filesystem to new disk....now what?

Post by Urs Thuerman » Sat, 30 Mar 2002 17:49:29



> However, mount still reports.....

> /dev/hda1 on / type ext3 (rw)

> I know from the filesystem size that I'm actually running on
> /dev/hdb1, but I can't figure out how to make it show /dev/hdb1
> instead of /dev/hda1.....what did I do wrong?

Edit the entry for / in /etc/fstab.  On mounting, mount(8) writes the
entries from /etc/fstab to /etc/mtab, where all currently mounted file
systems are recorded.  On boot, mount -a is executed which mounts all
auto FSs from /etc/fstab and records them in mtab.

urs

 
 
 

Moved root filesystem to new disk....now what?

Post by Floyd Davidso » Sat, 30 Mar 2002 19:01:24




>> However, mount still reports.....

>> /dev/hda1 on / type ext3 (rw)

>> I know from the filesystem size that I'm actually running on
>> /dev/hdb1, but I can't figure out how to make it show /dev/hdb1
>> instead of /dev/hda1.....what did I do wrong?

>Edit the entry for / in /etc/fstab.  On mounting, mount(8) writes the
>entries from /etc/fstab to /etc/mtab, where all currently mounted file
>systems are recorded.  On boot, mount -a is executed which mounts all
>auto FSs from /etc/fstab and records them in mtab.

It might be worth pointing out here that the root filesystem is
a little bit special.  It is mounted during the boot process, before
init can even be run (it has to be mounted so that /sbin/init can
even be found, never mind /etc/inittab and the /etc/fstab).

Hence the root filesystem that is mounted is determined long
before /etc/fstab is available, and unlike other filesystems in
/etc/fstab, when "mount -a" is executed it does *not* mount the
root filesystem.  But it does create an /etc/mtab entry from
the /etc/fstab file.  

Hence there is no direct relationship between what is is in
/etc/mtab and what was actually mounted as the root filesystem,
and /etc/fstab must be manually edited to agree with whatever
has happened during the boot process.

--
Floyd L. Davidson         <http://www.ptialaska.net/~floyd>

 
 
 

Moved root filesystem to new disk....now what?

Post by Bit Twist » Sat, 30 Mar 2002 21:51:20




>> However, mount still reports.....

>> /dev/hda1 on / type ext3 (rw)

>> I know from the filesystem size that I'm actually running on
>> /dev/hdb1, but I can't figure out how to make it show /dev/hdb1
>> instead of /dev/hda1.....what did I do wrong?

> Edit the entry for / in /etc/fstab.  On mounting, mount(8) writes the
> entries from /etc/fstab to /etc/mtab, where all currently mounted file
> systems are recorded.  On boot, mount -a is executed which mounts all
> auto FSs from /etc/fstab and records them in mtab.

You will also have to fix /etc/lilo.conf and do a
lilo   to install your change or if using grub fix
/boot/grub/menu.lst
 
 
 

Moved root filesystem to new disk....now what?

Post by Michael Knig » Sun, 31 Mar 2002 01:39:30





> >> However, mount still reports.....

> >> /dev/hda1 on / type ext3 (rw)

> >> I know from the filesystem size that I'm actually running on
> >> /dev/hdb1, but I can't figure out how to make it show /dev/hdb1
> >> instead of /dev/hda1.....what did I do wrong?

> >Edit the entry for / in /etc/fstab.  On mounting, mount(8) writes the
> >entries from /etc/fstab to /etc/mtab, where all currently mounted file
> >systems are recorded.  On boot, mount -a is executed which mounts all
> >auto FSs from /etc/fstab and records them in mtab.

Yeah...I forgot to mention in my original post that I had done that
already, and changed the appropriate entries in /etc/grub.conf.  That
was why I was perplexed about mount still reporting it as /dev/hda1.

- Show quoted text -

Quote:

> It might be worth pointing out here that the root filesystem is
> a little bit special.  It is mounted during the boot process, before
> init can even be run (it has to be mounted so that /sbin/init can
> even be found, never mind /etc/inittab and the /etc/fstab).

> Hence the root filesystem that is mounted is determined long
> before /etc/fstab is available, and unlike other filesystems in
> /etc/fstab, when "mount -a" is executed it does *not* mount the
> root filesystem.  But it does create an /etc/mtab entry from
> the /etc/fstab file.  

> Hence there is no direct relationship between what is is in
> /etc/mtab and what was actually mounted as the root filesystem,
> and /etc/fstab must be manually edited to agree with whatever
> has happened during the boot process.

I actually ended up deleting the disk partition on my original root
partition, that way making sure I knew for sure it was forcing it to
use the freshly relocated copy.

Then grub started giving me trouble, so I ended up booting off a
floppy, which seemed to continue from my hard drive just fine.  I had
to do a bit of reading up on grub, and needed to run grub-install
again.  That seemed to fix up everything.

-Michael

 
 
 

1. moving root disk to a new disk

I'm trying to move a root disk on our Enterprise 4000 to a new disk. I
moved all the files with cpio and used installboot to make sure there
was a boot sector on the new disk. But when I try to boot off the new
disk I get a kernel panic. Does anyone know what I'm doing wrong?

thanks,
jem.
--

                   |         Assigned black helicopter is a must.

2. where can I get FIPS?

3. Need help moving root filesystem to new drive

4. Connecting another LAN to ours via leased line?

5. best way to move entire filesystems to a new disk?

6. How do I change ASCII colors of different file types in xterm?

7. Moving root disk to new hard drive

8. How to use pine and tin on local comp.

9. Moving the root directory to a new disk

10. Adding new hard disk and Moving root partition

11. copy root/boot-filesystem on new disk sco 3.2.4.2

12. Boot disk won't mount hard disk as root filesystem

13. superblock prob moving root filesystem