LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Partition resizing. (https://www.linuxquestions.org/questions/linux-newbie-8/partition-resizing-762423/)

adomi 10-16-2009 12:19 PM

Partition resizing.
 
Hello,

Am new on this forum and in Linux and this is my firts post. Here's the problem am posting for:

I was trying to resize a partition and I used the following steps:

1. I ran the following:
# tune2fs -O ^has_journal /dev/sda2
2. then I checked the file system:
# e2fsck -f /dev/sda2
3. Run:
# resize2fs -d 27 -p /dev/sda2 3G
4. Now run e2fsck again
# e2fsck -f /dev/sda2
5. Then I added my journal back:
# tune2fs -j /dev/hda3

when I run # df -h /dev/sda2, the size is well 3.0 Gig
Code:

[root@beretta ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1            4.9G  1.9G  2.8G  41% /
none                  125M    0  125M  0% /dev/shm
/dev/sda2            3.0G  42M  2.8G  2% /oracle
/dev/sda4            6.3G  47M  5.9G  1% /orabd_files
/dev/hdc              694M  694M    0 100% /media/cdrecorder
[root@beretta ~]#


but when I used parted with the print option, the size seems to have not shrunk at all.

the result is as follows:

Code:

[root@beretta ~]# parted /dev/sda
GNU Parted 1.6.19
Copyright (C) 1998 - 2004 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.

Using /dev/sda
(parted) print                                                           
Disk geometry for /dev/sda: 0.000-20480.000 megabytes
Disk label type: msdos
Minor    Start      End    Type      Filesystem  Flags
1          0.031  4996.779  primary  ext3        boot
2      4996.780  11499.653  primary  ext3       
3      11499.653  13499.934  primary  linux-swap 
4      13499.934  20002.807  primary  ext3       
(parted)



I am using RHEL4.

Any tips?

Tanks in advance.

markush 10-16-2009 12:33 PM

Hi adomi and wellcome to LQ,

you'll have to reboot your computer between repartitioning and creating a filesystem.

Markus

adomi 10-19-2009 03:32 AM

Quote:

Originally Posted by markush (Post 3721917)
Hi adomi and wellcome to LQ,

you'll have to reboot your computer between repartitioning and creating a filesystem.

Markus

I have already resized the partition by following the steps I described above. What are u exactely suggesting? Dropping that patition and doing the operation anew?

syg00 10-19-2009 03:53 AM

Quote:

Originally Posted by adomi (Post 3724628)
I have already resized the partition by following the steps I described above.

No you didn't - you resized the filesystem. Not the partition - which is what parted is concerned with. The partition is the physical allocation on the disk. Generally a filesystem exists within that and uses all the space (of the partition) - but needn't. Tools such as Partition Magic adjust both so they seem the same. Linux has a similar tool - gparted; I'd suggest as a new user you use that for resizing, as it's much safer.

adomi 10-20-2009 12:39 PM

Thank you Syg00 for your reply, particularly for the precisions you gave me regarding what I truly did. I'll try and download gparted and use it for my operation. Will let you how it went.


All times are GMT -5. The time now is 05:55 AM.