How do I view a mounted cloned hard drive's Linux file system?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I view a mounted cloned hard drive's Linux file system?
I've always had a clone of my primary hard drive sitting in my computer's 'ultrabay.' I also have three partitions - NTFS and FAT32, and the Linux partition. Every night, I do an rsync of my NTFS and FAT32 partitions.
However, I've never been able to backup my Linux (Fedora) partition - but because the Linux partition on the backup hard drive has never been visible. Up to this point, I've been backing up my primary hard drive's /home/username directory to a directory on my backup hard drive's Windows partition.
I'd ultimately like to rsync my primary hard drive's Fedora partition directly with my backup hard drive. However, as mentioned, while I can see the non-Fedora partitions on the backup hard drive, I cannot see the Fedora partitions.
I'd greatly appreciate any guidance as to how to do this - and of course, rsync suggestions are always appreciated.
Well, to start with, when you say they don't show up, do you mean that they don't automatically mount? Or that the partitions don't show up in /dev/sd*?
If they're just not automounting, then the solution is to mount them, and then use rsync or whatever other program you like to copy things across.
If they're not showing up, then the most likely explanation is that your "clone" isn't, and something's messed up on the disk. You should be able to fit that with gparted or similar.
If you could clarify with which I am helping you, I'll see what I can do.
The pages linked to in that thread give a decent rundown on how to do it, although I'm not seeing anything that's specific to Fedora 9, so you may have to improvise a bit on some of the names of the commands. You probably won't have to install any packages since it's a clone of your current drive and your machine can read it just fine. The other fellow who actually uses Fedora can probably do a better job of helping you with the specifics if necessary.
If Fedora doesn't mount it automagically, it probably means you have the same names for vg/lv on the backup. LVM won't handle that.
You could change the names, but then it wouldn't be a (exact) clone, and for example may not boot because of grub/fstab mismatches (unless you use UUID/label).
Personally I'd just blow that partition away, make it type x83 (mkfs as appropriate) and just fsck to it what I needed.
tldp.org has a good LVM howto, Redhat used to as well. I avoid it where possible.
Perfect - that the volumes have the same names is exactly what the issue is. On the next install I will choose something other than LVM, but for the meantime, I suppose it would be easiest to change the name of the backup hard drive. Then, if the primary hard drive fails and I want to use the backup, I can boot with a 3d hard drive I have sitting around (an old Fedora 9) and change the backup hard drive name back to what it was on the first (failed) hard drive to ensure it boots fine.
I saw a summary of how to rename the LVM at http://www.linuxquestions.org/questi...-to-do-375928/ , I'll give it a shot later this week. I'm going to also visit tldp.org like you suggested and see what they have.
Now I have a problem after cloning the LVM and keeping this 2nd disk in the 'ultrabay'; when I boot up, the system automatically now runs off SDB instead of SDA. My system is set to boot off the first hard drive, so first, why is it doing this, and second, what can I do to fix this? My GRUB.Conf is below. What if I unhash "#boot=/dev/sda5" on the 'primary' drive (SDA) - will that fix this - or is there a better way?
Thanks!!
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,4)
# kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda5
default=0
timeout=5
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.35.13-92.fc14.i686.PAE)
root (hd0,4)
kernel /vmlinuz-2.6.35.13-92.fc14.i686.PAE ro root=/dev/mapper/VolGroup-lv_root rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
initrd /initramfs-2.6.35.13-92.fc14.i686.PAE.img
title Fedora (2.6.35.13-91.fc14.i686.PAE)
root (hd0,4)
kernel /vmlinuz-2.6.35.13-91.fc14.i686.PAE ro root=/dev/mapper/VolGroup-lv_root rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
initrd /initramfs-2.6.35.13-91.fc14.i686.PAE.img
title Fedora (2.6.35.12-90.fc14.i686.PAE)
root (hd0,4)
kernel /vmlinuz-2.6.35.12-90.fc14.i686.PAE ro root=/dev/mapper/VolGroup-lv_root rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
initrd /initramfs-2.6.35.12-90.fc14.i686.PAE.img
title Other
rootnoverify (hd0,0)
chainloader +1
The correct way to do it these days, provided you have a reasonably recent version of grub, is to locate your partitions by filesystem UUID. Otherwise you're likely to run into issues if your devices don't always start up in the same order. I've seen several machines where warm boot vs. cold boot changed the device order. Or where having a USB device plugged in would mess it up.
The easiest way, of course, is to upgrade to GRUB2, which will configure things by UUID automagically. Unfortunately, Fedora is a bit messed up in this regard, and the available packages for GRUB2 will just make your life miserable. So install from source instead. Instructions here: http://blog.fpmurphy.com/2010/06/upg...-to-grub2.html
I am not an expert with GRUB. However, my old machine that I'm currently using uses UUIDs and an old version of GRUB, and instead of a "root (hdx,x)" line, it's got a "uuid <uuid>" line. The kernel parameter is being passed as a
"root=UUID=<uuid>"
GRUB2 has a search function. Put in a "search --no-floppy --fs-uuid --set=root <uuid>" in place of the uuid line. Kernel parameter is the same as GRUB.
Ok, so by way of background, I have these two cloned Fedora 14 drives, and am trying to boot with both in the computer - one as primary, and the other as secondary.
On the 'original' drive, I've replaced the entries in FSTAB and GRUB.Conf to use the various UUIDs listed with blkid. On the cloned drive, I changed all UUIDs to make them different from the 'original' drive, and then changed FSTAB and GRUB.Conf accordingly to use those updated UUIDs.
Each drive boots up fine separately, no problem.
When I boot them together, though - meaning booting off the original drive in the main HD bay, with the cloned HD sitting in the computer's ultrabay, I get almost to the end of the boot process, but then get a warning: "no root device found, sleeping forever." And that's it.
I'm glad I got this far, it's great to learn about the Fedora OS. It seems that everything works ok alone, since each drive boots up fine separately. However, what can I do now to make the computer boot up with both HDs inserted in the computer? I feel like I'm almost there - or am I?
My GRUB and FSTAB are included a few posts above, the only changes are specifying UUIDs.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.