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.
I am a newbie with Linux but I have to clone a disk. I'm using Ubuntu 10.04.
The system is 4 years old and was using a 80gb disk with 512B sectors, and I would like to clone it before it's dead with a new disk, that has unfortunately 4K/sectors... I'm stuck there.
Do you know if there is a possibility to clone a 512b/sector disk with a 4K/sector disk?
here is a good article on the 512->4096 sector evolution.
In particular, you want to take note that the OS provides a 512b emulation so the applications don't see the 4096
The underlying differences between the two physical disks should be hidden.
You could use plain old dd, but writing many 512b chunks would be inefficient so you should specify a block size of 4k (or multiples thereof).
I suggest you use ddrescue, which will copy/clone a disk and uses a default 65536b soft block size while copying. It has many additional features and can be more aggressive attempting to read/recover from a failing disk.
Thanks for your quick reply, I’m looking further for DDrescue.
But as I can’t even create a partition or a filesystem on the new disk because of the 4k sectors, I don’t see how it would help (using parted). I dont know how to deal with this.
It (ddrescue) will copy the partition table block by block.
You'll have to fix the table afterwards.
I would take a look at gdisk rather than gnu parted, I've had better success with gdisk (since I prefer GPT partitions).
In the expert menu you can change sizes (carefully).
If this fails, and you have backup space, fsarchiver can archive entire filesystems into a file.
Then you create a new MBR or GPT, partition as you see fit and then restore from the fsarchived file.
eg
So I think I will try your second option and start backing up to a file.
The problem is still I don't know how to create a partition table on this 4K/sector disk...
About fsarchiver, the disk has an extended partition sda2, which has inside sda5 as the swap and sda6 ext3. Should I archiver sda1 and sda2 or sda1 and sda6 ?
I ask because you no longer need to use extended partitions.
If you use gdisk or gnu parted you can create GPT style partions and have up to 128 primary partitions, HOWEVER to change from one style partition table to the other is medium level linux. All the partitions will get new GUID and you'll need to boot from a livecd or sysrescuecd (good to learn). You'll have to fix grub, and /etc/fstab at a minimum. I do it regularly, cloning disks, etc but you can just as easily ruin an installation if you don't have the skills. There are many online tutorials, but it's not an entry level task. Don't let that scare you, it's worth the effort.
I previously suggested ddrescue because you indicated the primary disk was failing. In that case it's more important to copy the data to a good disk, then work with the good disk to restore the OS. It depends on how many spare disks you have lying around.
I am using a laptop with Ubuntu 10.04LTS, no dual boot.
My goal is to clone a hard-drive 80gb that comes with a system I bought 5 years ago, but not supported anymore as the company's closed. So I have the old disk and the new one connected with USB adapters to my laptop.
Périphérique Amorce Début Fin Blocs Id Système
/dev/sdb1 * 1 2000 16064968+ 83 Linux
/dev/sdb2 2001 9729 62083192+ 5 Etendue
/dev/sdb5 2001 2128 1028128+ 82 Linux swap / Solaris
/dev/sdb6 2129 9729 61055001 83 Linux
I am just a basic user, but I can follow a tutorial... It's just this 4K sector disk that annoys me.
So I backed up the old disk with fsarchiver. Now I'm going to read your links to learn how to work with a 4K/sector disk. Usually I use the DiskTool from Ubuntu, but it doesnt work with this disk since it's 4K.
I have to tell you that I don't have root access to that old system, this is also why I need to clone it before the disk is completely dead.
I already tried with Clonezilla, but it fails to restore the backupb because it fails to create a partition table on the new 4K/sector disk... I could try with SystemRescueCD also.
Thx a lot for your help ! Following the links you gave me, I anderstood that I needed to update my distribution cause my partition tools were too old to manage the 4k/sectors disk...
So it means Clonezilla is outdated as it doenst manage such disks. I am wondering if RescueDisc is outdated too.
With parted updated I am now able to create the partition table and I am confident I will be able to restore everything easily
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.