DF reports wrong disk size
Hello,
I needed to move my ubuntu install from /dev/sda6 (5GB) partition to /dev/sda3 (30GB) partition. I never thought I'd use ubuntu that much so put it on a small test partition. I have used partimage to create an image of sda6 then restored it to sda3. When I do a df -h I get the wrong output. I did investigate using tune2fs -m -0 /dev/sda3 regarding reserved space for /root but this did not help. I have also tried the resize command. Please can someone tell me how to correct this. Code:
Filesystem Size Used Avail Use% Mounted on Code:
fdisk -l >grub >setup (hd0,2) but something is still not right as it is using the /sda6 menu.lst options. |
When you copy a partition at the byte level (with dd or similar tools), you are copying the entire filesystem---which will be the same size even in a newer, larger, space. I'm not sure what partition resizing tools do in such a situation. (What "resize command" did you use?)
As for installing GRUB, the shell method you show requires 3 commands: grub root setup Example, to point GRUB to drive 1, partition 3 for its files, and then install the the MBR of drive 1: grub root (hd0,2) setup (hd0) (remember that GRUB counts from zero) |
I have the same problem. In my case I am trying to use partimage from a 40GB HDD to a 80GB HDD.
When I do a df -h I get the following on 80GB Code:
Filesystem Size Used Available Use% Mounted on Code:
#sfdisk -s /dev/sda3 Quote:
|
Solved the wrong disk size issue
Finally I got it working using the resize command. Hope this works for you pobman. Mind you that my filesystem on sda3 is ext3
Here is what I did, 1. Boot you system with a CDROM/USB using any of the rescue linux or knoppix etc. I used sysresccd. 2. After boot up Code:
umount /dev/sda3 (just in case if it is mounted) Code:
fsck -n /dev/sda3 Code:
/dev/sda3: clean, <SOMESIZE>> Code:
tune2fs -O ^has_journal /dev/sda3 Code:
e2fsck -f /dev/sda3 Code:
resize2fs /dev/sda3 Code:
fsck -n /dev/sda3 Code:
tune2fs -j /dev/sda3 Let me know if it works for you |
Thanks a lot VinayatLQ,
In the end I decided to blow away my install and start a fresh, but I will store as I am sure it will happen again, now to try a similar thing on my ntfs partition with that bloat ware. Thanks :) |
Hey - thanks!
Thanks, VinayatLQ - I had the same problem and followed your 8 steps - they worked great. df now reports the same size as gparted.
I'm planning to use the partition as a raid1 mirror with a similar HD so it was important to get it right (I'd resized it to match it to the other HD). There was only one minor difference in what I did - the partition is new and separate from the ones in use (/, /home, etc), so I could unmount it and work on it without using a rescue CD like Knoppix. I don't think of myself as a newbie, or of this as a newbie-type question, but I appreciate getting help from people that are more expert than me, and I'll try to do the same. |
I know it has been a while since this thread has seen any action. I am only posting because this keeps coming up high in my Google searches and I found a simple solution.
I resized my RAID6 array by adding three new drives but DF kept showing the old size. After some research I found that I simply needed to tell the OS to resize the partition to its maximum size. It took a while but it did it LIVE without unmounting the array and no data loss. As a matter of fact I was even able to write to the disk while it was being resized. I wouldn't try rebooting because that sounds down right dangerous. It took about 3 hours (+/-) to expand my array from 3T to 6T using this command: Code:
sudo resize2fs /dev/md9 |
All times are GMT -5. The time now is 09:21 AM. |