RE: Having a hard time copying root file system to new drive... [SOLVED]

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

 



>> Daniel B. Thurman wrote:
>>  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? 
>

Bringing back the error reported:
=================================
....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]
=================================

Following are replies working from the oldest to the newest:

Les Mikesell wrote:
> A 'cp --one-file-system -a / /mnt' should have done the same...
Nope. It does not preserve the selinux ACLs.

> You also have to edit /etc/grub.conf (actually the target of its symlink 
> which may not be there if you haven't mounted your /boot in its relative 
> position).  From rescue mode you might mount the /boot partition 
> somewhere, then look for grub/grub.conf.  The root= in the kernel lines 
> have to match where your new / partition will be.
Oh!  You DO have something there!  Yes, I was pointing to the wrong
root label - that's for sure.  But fixing THIS did not solve the issue.
Read on!
> 
> Hmmm... You should be able to hit a key to get to the grub prompt when 
> booting and edit this on the fly instead of a rescue boot again.  Then 
> once you are running, edit /etc/grub.conf.
Yes, I added selinux=0 single to the line, booted, and whoa!  In doing this
there was an extra HINT there!  It says that the reason that it failed
to mount /dev/root was because it was expecting EXT3.  This message was
not hinted in the normal boot up.  So, I rebooted in knoppix and ran
qtparted and lo' and behold!  My partition was formatted with ext2
filesystem type.  Shoot!  That did it.  The problem I had was I did not
pay attention to the filesystem type when I formatted.  Royal BF!

Duane Clark wrote:
> The boot file /boot/initrd* has the disk labels embedded in it. And if 
> those labels are wrong, you get this message:
> Unable to access resume device (LABEL=SWAP-sda3)  <- have to rebuild the 
> initrd <the rest snipped>
I KNOW that having a mislabeled swap mislabeled as seen by initrd does not
cause the process to stop, it just complains.  I have done this many time
and used mkinitrd - and it works.  Not a big deal here.

In case you were wondering:
+ cd /boot; mkdir backup; mv <kernel-version>.img backup/
+ mkinitrd <kernel-version>.img <kernel-version>
Done.

Aldo Foot wrote:
> <snip> [Use Knoppix and dd as summarized here]
At the time I tried it but gave up, it was because I later discovered
that the partitons were formated as ext2. 

Tim wrote:
> Or simply remake the swap partition with that name.  The name can be
> anything, it doesn't have to be that name for /dev/sda3.
Yup, or use mkinitrd to make a new one (see above) or simply relable
the drive to the one where the 'complaint' appeared ob boot up and
update your /etc/fstab to match.

Tim wrote:
> I thought all of them (their contents) were created upon bootup
> (each bootup), as required.
Yup, it does.  But does not really matter because copying anything
in these directories are 'erased' anyway, I hope.

Ok, in summary:
===============
1) Boot up Knoppix (although maybe LiveCD would do the same)
2) With both drive installed, click on the original / and /boot
   drive partition icons on your desktop (like hda1 (/boot) and
   hda2(/), for example) and these drives will be mounted RO in
   /media/{hda1,hda2}.
3) Open a terminal window, and become root user (su)
4) Use Qtparted to create your new drive's partitions,
   the /boot, /, and swap space.  Pay attention to the fact
   that your /boot and / should be ext3 filesystem type.
   Make sure that you create the labels for each partition
   and when completed out of qtparted, check with e2label.
4) Mount your new drive's / and /boot partitions to
   /media/{hdb1,hdb2}
5) cd, into each directory then cp -a the source files into
   each target directory:
   a) cd /media/hdb1; cp -a /media/hda1/. . (for /boot)
   b) cd /media/hdb2; cp -a /media/hda2/. . (for /)
6) Check the target /boot and / drive labels and relabel
   if not correct:
   a) check: e2label /dev/hdb1, relabel: e2label /dev/hdb1 /boot1
   b) check: e2label /dev/hdb1, relabel: e2label /dev/hdb2 /root1
7) Edit the target /boot directory's grub.conf file
   and update the root=LABEL=/root1 for each kernel
   version if there is more than one.
8) Edit the target / directory's /etc/fstab file
   and update the mount LABEL= for / and /boot:
   LABEL=/root1  /        ext3 defaults 1 1
   LABEL=/boot1  /boot    ext3 defaults 1 2
   LABEL=swap1   swap     swap defaults 0 0
9) shutdown system
10) Replace the original HD with the new HD
11) If grub fails, MBR is probably not placed on the
    new drive.  In this case, use rescue CD, check that
    your intended drive is the correct one, then apply
    grub-install /dev/sdX where X=letter of your new drive.
12) If on booting up on your new drive that you get a message
    "Unable to access resume device (LABEL=*********)", this will
    not stop your boot up, nor disable swap - just let it continue.
    To fix this to your new swap label in /etc/fstab, log into
    your system, become root user and:
    a) cd /boot; mkdir backup; mv <kernel-version>.img backup
    b) mkinitrd <kernel-version>.img <kernel-version>
    c) You can reboot to check but this is optional.

I think that covers it.

Thanks to all who responded and aided me through the process
of discovery.  It was hell, but worth it.  I won't make the
same mistake twice... well, we will see. :P

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.7/1233 - Release Date: 1/19/2008 6:37 PM
 


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

  Powered by Linux