Re: Merge Extra free space into current linux partition
Thierry Chatelet <tchatelet@free.fr> writes:
> On Friday 23 October 2009 04:20:23 Kevin Ross wrote:
>> > From: Kushal Koolwal [mailto:kushalkoolwal@hotmail.com]
>> > Sent: Thursday, October 22, 2009 5:32 PM
>> >
>> >
>> > I am using Debian Lenny on x86 computer installed on my SATA
>> > hard drive - /dev/sda5.
>> >
>> > # cfdisk /dev/sda
>> > **************************************************************
>> > *****************
>> > sda1 Boot Primary FAT16 [DOS
>> > ] 2146.80
>> > sda2 Primary NTFS []
>> > 10001.95
>> > sda5 Logical Linux ext3
>> > 15002.92
>> > Pri/Log Free Space
>> > 132887.63
>> > **************************************************************
>> > *****************
>> >
>> > I would like to merge all the extra Free Space (132887.63) as
>> > shown above into my current Debian partition (/dev/sda5).
>> >
>> > How can I do that without having to move all the data and
>> > reformatting/re-creating partition.
>> >
>> > Kushal Koolwal
>>
>> Use fdisk (or similar tool) to change the end cylinder of the partition to
>> the end of the disk. Do not change the start cylinder. Then run
>> "resize2fs /dev/sda5" to grow the filesystem to take up the rest of the
>> space.
>>
>> Oh, of course make sure you have a backup first.
>>
>
> Is it possible to resize a mounted partition? If not, then you can use a live
> cd of gparted.
You can resize it on the disk while the system is running, but the
kernel won't recognize the changes. I think there is a way (using
sysfs?) to tell the kernel to reread the partition table, but I
haven't been able to find it. Of course, as others have suggested, it
would be much safer to do it all offline. Does anybody else know if
there is a way to reread the partion table an a running system?
--
Carl Johnson carlj@peak.org
Reply to: