Re: Partition size discrepancy df v parted/cfdisk
On Thu, 22 Jan 2004 15:05:01 +0000, Clive Menzies wrote:
> Hi List
>
> I've just reorganised the partitions on a second (Seagate) drive in
> a dual booting Dell Dimension XPS T500 to give more room to /usr
> (to upgrade from woody to sid).
>
> The partitions I messed with were /home, /usr and two swap.
>
> /home was 35 Gb and /usr 1Gb
>
> Using parted I deleted home and created a new 5GB /usr partition and
> 30Gb /home. Once I'd amended fstab and copied the /usr file across,
> I deleted the old /usr and one swap partition to create a new bigger
> swap partition and increased the remaining swap partition. All worked
> fine and I've subsequently upgraded to sid and everything is back as
> it should be.
>
> However, df -h gives (showing /usr as 1Gb):
>
> /dev/hdb2 92M 41M 47M 47% /
> /dev/hdb9 958M 564M 346M 63% /usr
> /dev/hdb6 958M 147M 763M 17% /var
> /dev/hdb7 958M 80K 909M 1% /tmp
> /dev/hdb10 29G 32M 28G 1% /home
> tmpfs 252M 0 252M 0% /dev/shm
>
> whereas parted shows /usr (9) as about 5Gb:
>
> 2 0.031 94.130 primary ext2
> 1 94.131 76316.594 extended lba
> 5 94.162 651.071 logical linux-swap
> 11 651.103 1427.651 logical linux-swap
> 6 1427.682 2400.336 logical ext2
> 7 2400.368 3373.022 logical ext2
> 9 3373.053 8424.711 logical ext2
> 10 8424.743 38421.079 logical ext2
> 8 38421.110 76316.594 logical fat32
>
> and cfdisk also shows 5GB:
>
> hdb2 Primary Linux ext2 98.71
> hdb5 Logical Linux swap 584.00
> hdb11 Logical Linux swap 814.31
> hdb6 Logical Linux ext2 1019.94
> hdb7 Logical Linux ext2 1019.94
> hdb9 Logical Linux ext2 5297.09
> hdb10 Logical Linux ext2 31453.48
> hdb8 Logical W95 FAT32 39736.33
>
> Any ideas?
>
fsdisk and parted are showing the partiton size, whereas df is showing the
*filesystem* size. You don't say how you "copied the /usr file across",
but what you should have done is:
Use mke2fs to create the filesystem on /dev/hdb9, e.g.:
mke2fs /dev/hdb9
Then you should have mounted the new filesystem, used cp to copy the
current /usr to it, then changed /etc/fstab to reflect the new /usr and
rebooted, or umounted the old /usr and mounted the new one, e.g.:
mkdir /tmp/usr (or /mnt/usr if you prefer)
mount /dev/hdb9 /tmp/usr
cp -ax /usr /tmp
umount /tmp/usr
umount /usr
mount /dev/hdb9 /usr
<change the /etc/fstab also>
It seems that you probably didn't do that, and somehow copied the old
filesystem as a whole onto the new partition (keeping the old filesystem's
size and wasting all the rest of the partition). Check out ext2resize man
page to fix.
--
....................paul
It is important to realize that any lock can be picked with a big
enough hammer.
-- Sun System & Network Admin manual
Reply to: