Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
I have a server that was set up by my previous sysadmin. He used a weekly cron script to mirror hda to hdc using:
cat /dev/hda > /dev/hdc
This is not a problem if both disks are identical. However, when i mirror to a disk with different parameters, it should be using the wrong partition table details, right?
I can now use the cloned disk without problems except for the OS complaining about that the last partition (hda9) of not being the correct size, etc. and refused to mount it.
I tried using fdisk to delete that last partition and recreate but i believe it recreates with wrong specs. How do i recreate this contentious partition?
Is the current partition table (hda1 to hda8) incorrect although it's working? If it's wrong, how do i correct it without losing any file?
It is better to use cp instead of dd or cat when using hard drives with different geometry. Another way is using the filesystem's dump utility.
To fix the partition table use sfdisk. After you are done, use the resize option while mounting the partition. Though the resize option is for EXT2/3 and ReiserFS, but you have to use the resize utility for XFS and JFS partitions.
I find the cat method is a very bad way to back up data. (this is my personal view).
Why?
Suppose the source media has bad blocks/sector corruption: cat, cp and dd (yep, all three of them) will abort the transfer when it encounters the bad block. If the sysadmin really wanted to make a straight clone of the drive and attempt to avoid these kinds of complications, then dd_rescue is one alternative. (Not all distros have this command though.)
The other problem with the cat method is it assumes the target drive is the same size *or bigger*. The geometry won't matter as long as the drive is operating in LBA mode (which all drives over 8GB should), and as long as the bootloader works on the target drive. In fact, partitioning utilities (such as fdisk) tend to be the only programs that fuss about CHS geometry anyway.
I'm trying to clone a different HDD using cp. I've copied all the partitions to the second HDD (which already had some partitions), one by one. Which directory should I omit, e.g. /dev, /proc?
I noticed that some of the mount points are not mounted partitions, e.g. dev, proc, etc. I thought these are "files" created in UNIX for tracking real resources that would be generated at runtime. Please correct me if i'm wrong.
Thus i wonder whether they need to be backed up at all.
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,606
Rep:
verbatime copy of mbr you did
so lilo is looking for hda still? Hence you have a lilo error
If I understand ok what you did.
I am no expert
I prefer grub to lilo because one can edit boot line
>>Thus i wonder whether they need to be backed up at all.
It depends what sort of backup you want.
In absolute terms, probably not /proc.
Am not 100% sure about the rest.
If you clone so to be able to revive a system, then you
would have everything. If it was raid you would have everything as well.
Have never tried to revive a linux machine from partial backups
(that is say /usr + /boot /etc but not /proc not /dev).
Can only postulate, sorry
Last edited by Emmanuel_uk; 04-24-2006 at 03:10 AM.
Use a LIVE Linux CD. Then mount the / partition and any other partitions to /mnt/sysimage. Also mount procfs and sysfs under /mnt/sysimage. Next type 'chroot /mnt/sysimage /bin/bash'. Then type 'source /etc/profile'. Then run lilo to revise the MBR.
If you use Grub, you only have to write to the MBR once. Lilo have to be re-run every time /etc/lilo.conf is revised.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.