RE: Having a hard time copying root filesystem to new drive...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robin Laing wrote:
> Daniel B. Thurman wrote:
> > Sigh... I pulled an all-nighter trying to copy my existing 
> root filesystem
> > onto a new drive due to running out of filesystem space.  Seems that
> > I was able to cp -a the existing drive to my new filesystem 
> partition,
> > was able to properly setup the fstab, relabel, and so on, was able
> > to see grub working but when it came to starting up the new drive,
> > I get the following errors:
> > 
> > ....blah....blah
> > Uncompressing Linux... Ok, booting the kernel.
> > Red Hat nash version 6.0.19 starting
> > Unable to access resume device (LABEL=SWAP-sda3)  <- have 
> to rebuild the initrd file....
> > mount: could not find filesystem '/dev/root'
> > setuproot: moving /dev failed: No such file or directory
> > setuproot: error mounting /proc
> > setuproot: error mounting /sys: No such file or directory
> > switchroot: mount failed: No such file or directory
> > [hang]
> > 
> > What am I doing wrong?
> > More importantly, what is the proper procedure in making a 
> copy of your
> > existing root filesystem onto a new drive partition?
> > 
> 
> If you used LVM partitions, you only need to add another partition to 
> that partition.  Then grow the file system.
> 
> If you have not used LVM, then look at splitting your 
> partitions around 
> and going from there.  How much space and what partitions do you have.
> 
> I normally put my home on a separate drive and then put the 
> OS on it's 
> own drive.
> 
> Can you supply a df -h of your system?
> 

1) I am not using LVM
2) My original disk is too small - found a larger one and wish to
   move my disk fs to this new drive.

I think I am asking a simple question but apparently maybe not so
simple :-)  The question is, what is the proper way to transfer over
your root filesystem to a new drive/partition.  I know that I got
the boot partition on the new drive working. It is the root partition
that I am having trouble with.

What I did was:

1)  Add the new drive to the IDE cable
2)  Boot with my original drive (it still works but running out of space)
3)  Partition and label my new drive with:
          /boot  100MB   LABEL=/boot1
          /       40GB   LABEL=/root1
          swap     1GB   LABEL=swap1
4)  mounted the new /boot partition to /mnt
5)  cd to /mnt
6)  cp -a /boot .
7)  umount /mnt
8)  mounted the new / partition to /mnt
9)  cd /mnt
10) cp -a /{bin,dev,etc,home,lib,opt,proc,root,opt,sbin,selinux,srv,sys,tftpboot,usr,var} .
    Note: Copy of dev, proc and sys does report errors as far as links and sockets, but
          otherwise I assume this is ok, since how else is one to get these copied over?
11) Manually added the mount directories: boot, mnt, media
12) Manually added the otherwise empty directories: misc, net, tmp
    and manually set the chmods and permissions
11) edited /etc/fstab with new labels - different from original fstab
12) umount /mnt
13) fsck'ed new boot and root partitions
14) shutdown
15) Remove original drive and add new drive
16) Boot in rescue CD
17) chroot /mnt/sysimage
18) mount new /boot partition to /boot
19) grub-install /dev/sda
20) unmount /boot
21) edit /etc/fstab and ensure labels are correct
22) exit (chroot)
23) remove rescue CD
24) reboot

Grub finds /boot and then starts up, but with errors as reported above.

Anything I miss?


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux