Ask Your Question

df showing incorrect partition size

asked 2018-08-01 04:51:05 -0600

_asterisk gravatar image

updated 2018-08-01 23:59:04 -0600

genodeftest gravatar image

So I migrated my root partition to another drive. One thing I should of anticipated is that the destination was bigger then the source. The migrate was successful but now I see that I've lost that extra space. 'df' shows the old partition size:

[john@arcturus ~]$ df -h
Filesystem              Size  Used Avail Use% Mounted on
**/dev/sdb3                28G   21G  5.3G  81% /**
/dev/sdb4                39G   28G  9.1G  76% /home

parted output for sdb:

[john@arcturus ~]$ sudo parted /dev/sdb print list
Model: ATA Samsung SSD 750 (scsi)
Disk /dev/sdb: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End    Size    Type     File system  Flags
 1      1049kB  166GB  166GB   primary  ntfs         boot
 4      166GB   208GB  41.9GB  primary  ext4
 **3      208GB   250GB  41.9GB  primary  ext4**
 2      250GB   250GB  472MB   primary  ntfs         diag

Is there anyway I can change the partition to reclaim that lost space?

edit retag flag offensive close merge delete


Please use syntax highlighting!

genodeftest gravatar imagegenodeftest ( 2018-08-01 23:58:28 -0600 )edit

Hos did you do the migration?

villykruse gravatar imagevillykruse ( 2018-08-02 02:47:41 -0600 )edit

I forget to mention, I used dd to migrate the partition.

_asterisk gravatar image_asterisk ( 2018-08-02 04:44:16 -0600 )edit

I suspected that that was what happened and that explains it.

villykruse gravatar imagevillykruse ( 2018-08-02 14:13:15 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-08-02 14:12:02 -0600

villykruse gravatar image

Since you used dd to copy the file system, the size of the file system will be the same in the copy as in the original. Notice that there is a difference between the partition which holds the file system and the size of the file system itself.

To fix the file system size, if it is an ext4 file system, you should use resize2fs. See for example this guide.

Also, run man resize2fs.

The following should expand the file system on /dev/sdb3 to the correct size of the containing partition.

resize2fs /dev/sdb3
edit flag offensive delete link more


That's the ticket, thanks

_asterisk gravatar image_asterisk ( 2018-08-02 18:43:14 -0600 )edit

Question Tools

1 follower


Asked: 2018-08-01 04:51:05 -0600

Seen: 144 times

Last updated: Aug 02 '18