LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-26-2020, 02:55 PM   #16
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176

Quote:
Originally Posted by Geist View Post
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.)
 
Old 01-26-2020, 02:57 PM   #17
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by vtel57 View Post
Definitely keep us posted on your progress or holler if you need some more assistance, Gregg.

Luck with it!

~Eric
I will, Eric. Thanks.
 
1 members found this post helpful.
Old 01-26-2020, 03:18 PM   #18
Geist
Member
 
Registered: Jul 2013
Distribution: Slackware 14 / current
Posts: 442

Rep: Reputation: 196Reputation: 196
Quote:
Originally Posted by Gregg Bell View Post
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.

Last edited by Geist; 01-26-2020 at 03:22 PM.
 
Old 01-26-2020, 04:09 PM   #19
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by Geist View Post
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.
 
Old 01-26-2020, 04:34 PM   #20
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 996

Rep: Reputation: 469Reputation: 469Reputation: 469Reputation: 469Reputation: 469
Quote:
Originally Posted by Gregg Bell
Thanks Ed. That complicates things a bit. So in that process I would have to reinstall all my apps, right?
Yes, along with the OS you will need to re-install any application programs.

The advantage is that you can create partitions of the appropriate sizes unconstrained by the old disk.
Ed
 
1 members found this post helpful.
Old 01-26-2020, 06:02 PM   #21
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by EdGr View Post
Yes, along with the OS you will need to re-install any application programs.

The advantage is that you can create partitions of the appropriate sizes unconstrained by the old disk.
Ed
Thanks Ed
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Open-spec SBC is a clone of a clone of a clone of a Raspberry Pi 3 LXer Syndicated Linux News 0 04-25-2018 04:56 PM
Easy way to clone my hard drive rmcellig Linux - Newbie 18 10-07-2009 08:59 PM
clone hard drive to smaller hard drive digity Linux - Newbie 8 01-11-2009 06:29 PM
Clone a dual booting IDE hard drive to a SATA hard drive namida12 Linux - Distributions 1 07-14-2008 10:01 AM
Easy way to clone linux installed hard drive mobassir Linux - Software 6 01-12-2004 05:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration