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.
The sizes are different, but in this case, from small to large, that should merely result in unallocated space after the cloned image.
In other words, the larger drive will appear as if it were the smaller drive, a harddrive with (lets assume) one partition with 75GB of space.
But, unlike the smaller drive, the larger drive will have space available, albeit 'unallocated' beyond that.
Thus, the clone of the old drive, which is said one partition, could be expanded to fill the entire 250GB, or more partitions could be put after it.
Code:
Small drive:
p1
[||||||||||||]
Large drive after clone:
p1 | unallocated
[||||||||||||xxxxxxxxxxxxxx]
After expanding the partition
p1 | still p1, but with free space
[||||||||||||______________]
Or with a new partition:
p1 |p2
[||||||||||||______________]
In the second to last example, the partition is extended and it would be like the 75gb drive had grown to a 250Ggb one.
In the last example, partition one would be full (if the source drive of 75gb were full too) and the second partition would be empty.
Thanks Geist. That seems doable. But how would the unallocated space after the 75GB be "grown" to the 250GB size? (I wouldn't be interested in having a second partition on the drive.)
Thanks Geist. That seems doable. But how would the unallocated space after the 75GB be "grown" to the 250GB size? (I wouldn't be interested in having a second partition on the drive.)
Look up the file system the partition is using and run its appropriate 'resizefs' on it.
It's probably going to be ext3 or ext4, so in that case it would be (possible with sudo at the beginning)
Code:
resize2fs /dev/sdXY
replace X and Y with your drive and partition.
I think this can be safely done while the drive is mounted but unmounting it is probably surefire in that regard.
Might want to wait a little for someone else to give you a second opinion. This should be right but...this is data and nobody likes losing their data (usually anyway).
(Even if it's 'safe' data, it's still a hassle to redo something)
Edit:
If that isn't the solution (although, again I think it is that easy) then deleting and recreating the partition with fdisk followed by the above would do it.
Deleting and recreating the partition doesn't destroy the data, it would just recreate the partition with its end being at the end of the new disks capacity.
So, nothing too scary (especially since it's just one partition)
Still, I think you can just use resize2fs immediately.
Look up the file system the partition is using and run its appropriate 'resizefs' on it.
It's probably going to be ext3 or ext4, so in that case it would be (possible with sudo at the beginning)
Code:
resize2fs /dev/sdXY
replace X and Y with your drive and partition.
I think this can be safely done while the drive is mounted but unmounting it is probably surefire in that regard.
Might want to wait a little for someone else to give you a second opinion. This should be right but...this is data and nobody likes losing their data (usually anyway).
(Even if it's 'safe' data, it's still a hassle to redo something)
Edit:
If that isn't the solution (although, again I think it is that easy) then deleting and recreating the partition with fdisk followed by the above would do it.
Deleting and recreating the partition doesn't destroy the data, it would just recreate the partition with its end being at the end of the new disks capacity.
So, nothing too scary (especially since it's just one partition)
Still, I think you can just use resize2fs immediately.
Geist, thanks so much for all the great info, but I have to admit I'm pretty psyched out by getting it all right. (Like Eric was saying, one / can make all the difference.) I'll come back tomorrow and look at it and maybe I'll be less psyched out.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.