Index

Subject : Re: LUG: New hard drive! Need help copying my data over and stuff.

From : Steven Loudermilk <sjlouder@ncsu.[redacted]>

Date : Wed, 05 May 2010 23:30:29 -0400

Parent


Like Jay said, it might take a while with the capacities of the drives (not that there is any faster option for moving 160GB of data, just be warned this may take a couple hours). I googled and found this link which gives a lot of good examples of dd for different scenarios.

You may already know this, but just in case:

"dd if=/dev/sda of=/dev/sdb" will clone the entire sda drive, including all partitions, MBR, etc. to sdb
"dd if=/dev/sda1 of=/dev/sdb5'" will clone at the partition level (clone partition sda1 to sdb5). Therefore, this may not include the MBR.

The main problem is that if you boot from the live cd, the drive names aren't predictable. Also, depending on how many partitions you have on your current system and if you'd like to keep those makes a difference. Here is my suggestion:

-Load up the ubuntu live cd
-Load up gparted (it may not be on the live cd by default anymore, if it's not, open synaptic and search for it)
-Once gparted is open, it should list the drives connected to the computer in a dropdown box in the upper right, with their device name (e.g. sda) and their approx. size (~160GB and ~500GB). If you only have one partition or want an exact replica of the original drive, this will tell you what device names to fill in the dd command. So if your 160GB drive was sda, and your 500GB drive was sdb, the command would be:

"dd if=sda of=sdb"

I believe this will fill the 500GB with an exact replica of the 160GB drive, and leave the additional space unpartitioned. If it doesn't, you should be able to resize partitions as necessary in gparted.

-If you only want to copy a certain partition, select the original drive in gparted and a graph will show up with the different partitions. Find the size of the partition you'd like and create a partition equal (or probably a little bigger) on your new drive, and then figure out the partition names and fill them in the dd command. It will have a number on the end of the device name, like so:

"dd if=sda1 of=sdb1"

I would then try booting from the new drive before you install linux just in case.

For your other questions:

-NTFS read/write on Linux should be very stable. I've been reading/writing to them from linux since I first ran linux when ntfs support wasn't included by default and I haven't had any data corruption. That said, as far as I know, when you delete a file on a NTFS partition, it won't put it in the trash, it will permanently delete it. So watch out for that if you are cleaning out your files.

-As far as your root size, 8-12 GB should be more than enough space for just the system depending on the number/type of apps you want to install.

-For swap size, since you now have a 500GB drive, I'm sure 3GB should be a good size.

Some other things I have experienced that may be worth thinking about:

-Make sure when you install you choose the correct install choice (something like "install beside other os") I would also look for an option to review the partition layout before you commit the changes.

-I would suggest you create a separate /home partition. This will enable you to upgrade or overwrite your system partition without losing your personal data and (some) configuration files.

Hope this helps.
--
Steven Loudermilk
Computer Science student at NCSU
15548 Lee Hall
Raleigh, NC, 27607
(XXX) 584-9212




On Wed, May 5, 2010 at 10:20 PM, Jay Goel < jpgoel@ncsu.[redacted] > wrote:
Ooh, good question. I might get this totally wrong, but here are some thoughts:

1. I'd avoid dd. Disk dumps sound like a great idea in theory. But all of the OS hardware will change, the partition tables will change, everything in /etc will change, etc.

In order to use dd, you'd have to create an image of your hard drive (dd if=/dev/sda of=bigfile.iso), copy that image to your new computer, mount that image (mount -o loop bigfile.iso /mnt/point), and then try and copy the relevant files to your new /home dir. Slow, error-prone, takes a lot of disk space, etc.

And trying to do a disk dump from your original 160G hard drive to a partition on your 500... holy moly.

I think the most surefire way to make it work is to, on your new box: shrink windows, install linux, copy over your data files, and then bite the bullet and reinstall your windows apps. You could try copying the application data preferences manually. (If someone else has actually done it using dd, I'd also be interested in knowing how everything was done, but dd in this manner only really works on identical hardware.)

2. I couldn't give a percentage on how reliable it is to write NTFS from linux. In fact, I doubt anyone on the list has a benchmark on hand, so don't believe anyone when they respond and say that they think it is reliable.

That said, I have never had problems writing to NTFS from linux. My (non-quantitative) gut reaction is that it'll be okay.

3. I think a 10G "/" partition will probably be plenty. Perspective: Mine is 9.6G used, but I have not done a clean install for 1.5 years and have all sorts of crud (libraries, make-install code, proprietary stuff, etc etc) saved there.

Good luck!

Jay

On Wed, May 5, 2010 at 9:38 PM, Richard Carter < rwcarter@ncsu.[redacted] > wrote:
Hey LUG,

I got my new laptop hard drive today (500gb 7200rpm!). Since I'm happy with my setup on my current drive, I want to copy it over as-is, so I also got a USB hard drive enclosure to make copying my data easy.

I have a 160gb drive right now. 100% of it is a NTFS partition (Windows 7 - unfortunately I use almost all of the 160gb so there wasn't enough room for Linux in this drive; my 320gb dual boot drive failed a couple months ago). I want to boot Ubuntu 10.04 from disc, copy the 160gb partition to the 500gb drive, expand it (probably from within Windows, to avoid problems), and install Ubuntu 10.04 in the rest.

So my questions:
- I know about the dd command, but I'm not sure exactly how I should use it to migrate my old hard drive to the new one. For example, would I copy sda->sdb, or sda1->sdb? An exact command example would be nice. I am capable of RingTFM but I'd rather get advice from a Linux expert than risk not noticing an important switch or something. Also are there any concerns copying a NTFS partition like this? I assume not, since dd is just a byte-for-byte copy, but please let me know if there's anything I should be aware of...
- Exactly how stable is the NTFS read/write in Ubuntu 10.04? Is it 110% guaranteed-not-to-corrupt-my-files stable? I often hesitate to mount my "C:\" drive from within Linux, or usually avoid it entirely, and I may add a FAT32 partition as a shared data storage if there's any reason I shouldn't trust it.
- What is the recommended size of the / partition in Ubuntu 10.04? And with my 2gb of RAM the swap should be what size?

I will probably prompt more discussion on Ubuntu 10.04 later, and if there's any possibility of a summer installfest I'll definitely be there.

Thanks in advance!
Ricket