Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have one 500 GB hard drive with Linux Ubuntu and I wish to move it to a smaller SDD drive (40 gigs) because the system itself (with some data) occupies only a few gigs.

I did some searching and found out about dd but apparently it cannot copy to smaller drive (partition table would have incorrect size).

Is there some way how to achieve this and leave the system in tact?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

You could use a GParted Live system to resize your Ubuntu partition then use dd to clone it.

share|improve this answer
add comment

Just copy the files over.

Using cpio to copy the files will go a lot faster than than 'cp -R -p' but by the time you've worked out all the flags for cpio, you'd have copied the files anyway using cp.

You'll need to change the 40gDisk:/etc/fstab to use the partition on your 40gb disk for '/' and amend the root mount in the grub config (and probably install grub on the disk too). If you're leaving the 500Gb disk in, then you may want to amend the grub settings there too.

Migbht be a good idea to have a bootable cdrom / usb standing by key just in case it goes pear-shaped.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.