Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
12-04-2007, 04:43 PM
|
#1
|
Member
Registered: Jun 2005
Location: Sacramento, CA
Distribution: Many, Old and New
Posts: 124
Rep:
|
Quick DD unequal size drive question
dd if={40gb hard drive} of={120gb hard drive}
What happens?
I suppose the 120gb hd looks like a 40gb hard drive afterward. If so is there any way to get back the lost disk space?
(this in a more recent distro than RedHat 7.3)
Last edited by pentalive; 12-04-2007 at 04:45 PM.
Reason: clarifacation
|
|
|
12-04-2007, 05:00 PM
|
#2
|
LQ Guru
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,391
|
Quote:
Originally Posted by pentalive
dd if={40gb hard drive} of={120gb hard drive}
What happens?
I suppose the 120gb hd looks like a 40gb hard drive afterward. If so is there any way to get back the lost disk space?
(this in a more recent distro than RedHat 7.3)
|
You might be able to make the lost space usable by changing the partition table.
---------------------
Steve Stites
|
|
|
12-04-2007, 05:54 PM
|
#3
|
Member
Registered: Jun 2005
Location: Sacramento, CA
Distribution: Many, Old and New
Posts: 124
Original Poster
Rep:
|
Quote:
Originally Posted by jailbait
You might be able to make the lost space usable by changing the partition table.
---------------------
Steve Stites
|
Is there a linux tool that will grovel through the disk drive and create a partition table?
|
|
|
12-04-2007, 06:07 PM
|
#4
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
dd copies everything literally.......
If you copy the whole drive (if=/dev/hda), then it copies the MBR, partition tables, and all partitions. Going from 40 to 120, you will wind up with an image of your 40GB drive at the front of the 120. I assume you can then resize and/or create new partitions to fill the excess space.
When you clone just a partition (if=/dev/hdaX), then that's all you get. I assume that you have to copy to a target partition which is at least big enough.
|
|
|
12-04-2007, 06:14 PM
|
#5
|
Member
Registered: Sep 2005
Location: US
Distribution: Gentoo AMD64 Testing
Posts: 129
Rep:
|
fdisk can increase the size of the partition, but you need to know exactly how big the disk is to be able to tell it (because it only knows what is on the partition table, that is from the small disk). It is very easy to screw everything up beyond repair while doing this. Read the man page for more info.
After that is done resize2fs (or the tool for your fs type) can increase the size of the file system to match that of the new partition.
|
|
|
12-04-2007, 06:34 PM
|
#6
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,414
|
Nuts.
Create new partitions on the big disk, and copy ("dd" if you insist) each partition in turn.
|
|
|
06-30-2009, 11:31 AM
|
#7
|
LQ Newbie
Registered: Jun 2009
Posts: 1
Rep:
|
The easy way
Since this is the only thread I found on the dd resizing, I will add my solution :
Tested with ext2 on ubuntu 8.10 with 4gb (almost full) sd card to 8gb sdhc card.
I simply opened gparted, reduced the size of the partition of about 10mb (gparted was saying I had a 7.x gb partition almost full), and then expanded it to full size again (gparted now says I got a 7.x gb partition with 4gb free, df tells me the same). Took 3 minutes
hope this helps
|
|
|
06-30-2009, 02:09 PM
|
#8
|
Member
Registered: Jun 2005
Location: Sacramento, CA
Distribution: Many, Old and New
Posts: 124
Original Poster
Rep:
|
That's it
Thanks everyone for your answers.
Pentalive.
|
|
|
04-30-2010, 12:49 AM
|
#9
|
LQ Newbie
Registered: Apr 2010
Posts: 11
Rep:
|
Quote:
Originally Posted by boutch55555
Since this is the only thread I found on the dd resizing, I will add my solution :
Tested with ext2 on ubuntu 8.10 with 4gb (almost full) sd card to 8gb sdhc card.
I simply opened gparted, reduced the size of the partition of about 10mb (gparted was saying I had a 7.x gb partition almost full), and then expanded it to full size again (gparted now says I got a 7.x gb partition with 4gb free, df tells me the same). Took 3 minutes
hope this helps
|
Now that is just lovely. Exactly what I needed when booted off the ubuntu live cd and installed gparted to fix a dd copy.
It's 6 months since since thread but I just gotta thank you.
|
|
|
All times are GMT -5. The time now is 11:25 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|