Change size of hard drive in gparted

Using applications, configuring, problems
Message
Author
april

Change size of hard drive in gparted

#1 Post by april »

I have an sda1 of 80 Gig formatted as ext2 and a sdb1 of 120G formatted as fat32.

So I have this bright idea to move all of my data onto sdb1.

I do

Code: Select all

dd if=/mnt/sda1 of=/mnt/sdb1
and away it goes .
When I look sdb1 now has an 80Gig ext2 partition on it containing a copy of all my data and does not seem to be expandable.


How can I resize that sdb1 to use up the full 120 Gig ?

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#2 Post by rcrsn51 »

Did you check in Gparted?

Because you wrote an ext2 partition over a fat32 partition, I suspect that your partition table info is messed up.

At this point, I wouldn't trust sdb1 to reliably store more data.

This might have worked better if you had first re-formatted sdb1 as ext2.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#3 Post by jafadmin »

You need to do it like this:

Code: Select all

dd if=/dev/sda1 of=/dev/sdb1
Then resize.
.
Last edited by jafadmin on Tue 15 May 2018, 10:31, edited 1 time in total.

april

#4 Post by april »

Yes I did and agreed thats what I have done . The question though is what I can do about it ..

ATM I am running on this drive as sda1 now . Its quite reliable but limited to 80 Gig in size.

I have the old drive available sda1 but must load it in to the cradle and then boot from it . That way I can then try to arrange matters on an unmounted hard drive sdb1 which will probably have 40 Gig or so of fat32 availale as well as the copied 80 Gig of ext2 .

Thats why I'm asking in case anyone knows a better way than maybe redoing it with a full 120 Gig of ext2 . It might be the only way though.

april

#5 Post by april »

jafadmin wrote:You need to do it like this:

Code: Select all

dd if=/dev/sda1 of=/dev/sdb1
Then resize.
Sorry posted under you
above post may explain the dilema . Its currently mounted
Last edited by april on Tue 15 May 2018, 10:35, edited 1 time in total.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#6 Post by jafadmin »

april wrote:Yes I did and agreed thats what I have done . The question though is what I can do about it ..

ATM I am running on this drive as sda1 now . Its quite reliable but limited to 80 Gig in size.

I have the old drive available sda1 but must load it in to the cradle and then boot from it . That way I can then try to arrange matters on an unmounted hard drive sdb1 which will probably have 40 Gig or so of fat32 availale as well as the copied 80 Gig of ext2 .

Thats why I'm asking in case anyone knows a better way than maybe redoing it with a full 120 Gig of ext2 . It might be the only way though.
Not "/mnt" .. instead "/dev"

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#7 Post by jafadmin »

april wrote:
jafadmin wrote:You need to do it like this:

Code: Select all

dd if=/dev/sda1 of=/dev/sdb1
Then resize.

.
Sorry posted under you
above post may explain the dilema . Its currently mounted
unmount both, if possible, or at least the target drive.

You won't be able to resize a mounted drive in any case.

april

#8 Post by april »

To be honest I can't remember whether I used /mnt/ or /dev/ originally. It did not get kept in the console memory .

But while you are there can you tell me what the diff is ?
Attachments
capture8485.png
(25.44 KiB) Downloaded 246 times

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#9 Post by jafadmin »

april wrote:To be honest I can't remember whether I used /mnt/ or /dev/ originally. It did not get kept in the console memory .

But while you are there can you tell me what the diff is ?
/mnt are partition mount points. /dev is the actual device.
Actually:

Code: Select all

dd if=/dev/sda of=/dev/sdb

is what it needs to be if you are imaging sda to sdb

april

#10 Post by april »

Thanks

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#11 Post by rcrsn51 »

If you boot off a live CD or flash drive with the "pfix=ram" option, you can get sda1 in an unmounted state.

Then you can use Gparted to resize it.

------------------------
Last edited by rcrsn51 on Tue 15 May 2018, 12:26, edited 4 times in total.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#12 Post by disciple »

rcrsn51 wrote:If you boot off a live CD or flash drive with the "pfix=ram" option, you can get sda1 in an unmounted state.

Then you can use Gparted to resize it.
To emphasize, you probably don't need to reimage it, you just need to have it unmounted to resize it.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#13 Post by rcrsn51 »

[Edit] However, notice the ! symbol in Gparted beside the partition. That indicates that Gparted thinks the partition has some problem.

It may or may not be fixable.

april

#14 Post by april »

No in fact having it unmounted ("pfix=ram" option not needed ) will only enable me to resize the partition to 112Gigs .see image. It won't let me deal with the greyed piece at all.

I am going to check the disk first and then reformat if that does not fix the size issue.

Doing a disk check from gParted fixed up the greyed error and gave the full partition to ext2 . So assuming some of the 120 Gig is used for housekeeping I get to use 112 Gigs without having to reformat or lose data which is where I wanted to go .

Thanks all. PS Still don't know if I used /mnt/ or /dev/.

Additional question . I now have a black lock icon appear where the triangle was . What does that mean . The partition shows and works as it should and it does not seem to affect anything but I have not seen that before.

I have booted from it now and I'm guessing thats because its mounted yes?
Attachments
capture23122.png
(117.9 KiB) Downloaded 78 times
capture32498.png
(23.72 KiB) Downloaded 156 times

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#15 Post by rcrsn51 »

The padlock symbol indicates that the partition is currently mounted and you are locked out from changing it.

It is in your first screen shot.

You identified your hard drive as 120 GB, but Gparted measures it as 112 GiB. There is a slight difference in the two units.

You are probably OK.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#16 Post by bigpup »

Manufactures of hard drives always identify the size based on the smaller number used to calculate size.
Makes it look bigger than it really is.

1GB=1000×1000×1000 Byte

Operating systems use this actual byte number.

1GB=1024×1024×1024 Byte

In the operating system and it's programs.
a 120GB drive will show as 111.76 GB
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

april

#17 Post by april »

bigpup wrote:Manufactures of hard drives always identify the size based on the smaller number used to calculate size.
Makes it look bigger than it really is.
1GB=1000×1000×1000 Byte
Operating systems use this actual byte number.
1GB=1024×1024×1024 Byte
In the operating system and it's programs.
a 120GB drive will show as 111.76 GB
Just trying to make sense of that
1024 x 1024 x1024 =10,737,418 x 120=128,849,010,000

1000x 1000x 1000 = 10,000,000 x 120=120,000,000,000

and a byte is 8 bits so these x 8 ? 960 Gigabits
No its not clear yet
So where does the 111.76 come from ?
I always assumed the loss was partition FAT tables , formatting indexes and records node lists etc

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#18 Post by disciple »

120/128...*120=111.76
(Sorry, posting from a phone)
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

april

#19 Post by april »

120/128 x 120 = 112.5


120/128.849010 x 120 = 111.75871 (corrected rcrsn51)
But even so why would a ratio apply?

I would think its capacity is 128.9Gig in data size regardless and 17 and a bit Gigs are used up in housekeeping which is just huge anyway.
Last edited by april on Thu 17 May 2018, 09:14, edited 2 times in total.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#20 Post by rcrsn51 »

120/128.849010 x 128.849010 = 138.35054
That's the wrong calculation. (12/3*3=12)

It should be

Code: Select all

120 / 128.849010 x 120
Or simply

Code: Select all

120/1.073741
Hard drive manufacturers use "G" as the official metric prefix - 10 to the power 9 (one billion).

But computers have traditionally worked in binary. So "K" means 2 to the power 10 and "M" means 2 to the power 20.

So "G" should mean 2 to the power 30, which is slightly bigger than 10 to the power 9. To avoid confusion, this prefix is called "Gi".
Makes it look bigger than it really is.
So it depends on how you are counting the individual bytes - in powers of 10 or powers of 2.

------------------------

GParted shows the raw size of the partition. The amount of space actually available to the user could be identified by Linux commands like df.

Post Reply