LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 03-29-2010, 02:54 AM   #1
ormium
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Rep: Reputation: 0
20GB partition only shown as 4GB partition


Hi,
can anybody explain the following behaviour on RHEL 5.3 in VM-ware?

1. Installed RHEL 5.3 in 20 GB partition
2. Not big enough
3. Created 2nd. 20 GB virtual disk incl. 1 20 GB partition
4. started a resuce CD
5. copied / partition the new partition using "cp -R -preserver /mnt/oldpartition/* /mnt/newpartition/"
6. exchanged this line in /etc/fstab:

LABEL=/ / ext3 defaults 1 1

whith this line:

/dev/sdb1 / ext3 defaults 1 1

(sdb1 is the new 20 GB partition)

7. reboot
8. now see this funny output

[root@localhost ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb1 3960348 3385476 370448 91% /
/dev/sda5 14270000 5077768 8455656 38% /home
/dev/sda1 46633 10516 33709 24% /boot
tmpfs 517600 0 517600 0% /dev/shm


[root@localhost ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 2610 20964793+ 83 Linux


How is this possible that a 20 GB partition only shows to have 4 GB in "df"

Any ideas?

Best Regards,

Romeo
__________________
Romeo Kienzler
r o m e o ( a - t ) o r m i u m . d e
 
Old 03-29-2010, 03:31 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
And which command did you use to format the new partition ?
Is it ext3 or ext2 ?
 
Old 03-29-2010, 05:37 AM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
A 20GB partition doesn't necessarily imply a 20GB file system. So, it all comes down to how did you format this thing.
 
Old 03-29-2010, 07:03 AM   #4
ormium
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Ok, I have the feeling that I maybe have formatted it as 4 GB partition, correct?

I've used the following command:

mkfs.ext3 /dev/sdb1
 
Old 03-29-2010, 07:16 AM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
That should have allocated the whole partition.

But, if for some reason the fs has not grown to fit the partition you can always use the resize2fs tool to grow ext2/3/4 file systems.
 
Old 03-29-2010, 07:47 AM   #6
ormium
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Please see the following result:

[root@localhost ~]# tune2fs -l /dev/sdb1
tune2fs 1.39 (29-May-2006)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: e9469849-a623-4388-84fc-aaa67838f7e9
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype sparse_super large_file
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 2621440
Block count: 5241198
Reserved block count: 262059
Free blocks: 4243721
Free inodes: 2504270
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1022
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 16384
Inode blocks per group: 512
Filesystem created: Mon Mar 29 01:04:46 2010
Last mount time: Mon Mar 29 01:06:15 2010
Last write time: Mon Mar 29 04:20:31 2010
Mount count: 1
Maximum mount count: 28
Last checked: Mon Mar 29 01:04:46 2010
Check interval: 15552000 (6 months)
Next check after: Sat Sep 25 01:04:46 2010
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
Default directory hash: tea
Directory Hash Seed: a1ac4a3b-f15a-40df-8971-5dc58da22541
Journal backup: inode blocks

So block count is 5241198 and block size is 4096 which leads to 20GB.

So I assume the file system is correct?

What else could cause this behavior?

Is it because formerly it was a LVM partition and now I've mounted it directly?

Best Regards,

Romeo
 
Old 03-29-2010, 07:54 AM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
No idea.

Did you try fsck -f on that volume? Maybe it's something weird on the VM itself.
 
Old 03-29-2010, 11:10 AM   #8
ormium
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
no, fsck completed also without errors :/
 
Old 03-30-2010, 02:09 AM   #9
ormium
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Ok, got it working:

1. dd if=/dev/sda2 of=/dev/sdb1
2. resize2fs /dev/sdb1 20G
 
  


Reply



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
[Gentoo] Is it possible to install onto a 2.4GB partition? William (Dthdealer) Gentoo 4 01-23-2009 01:52 AM
20gb linux partition already full hilliard Ubuntu 3 09-21-2008 06:17 PM
share partition with windows with >4Gb file sizes john72carter Linux - General 1 09-07-2006 08:14 AM
how to partition my 20GB harddisk properly for Linux? chuanweizuo Linux - Newbie 2 03-07-2005 07:02 PM
How should I partition my 4gb for slackware neroagent Slackware 3 04-10-2004 12:58 AM

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

All times are GMT -5. The time now is 10:14 AM.

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