LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Reallocating space for existing install (https://www.linuxquestions.org/questions/linux-general-1/reallocating-space-for-existing-install-68702/)

invictus 06-28-2003 04:04 PM

Reallocating space for existing install
 
Debian/Woody kernel 2.4.1

Structure as follows:
hda1 -- Win32, 6 gb
hda2 -- swap, 170 mb
hda3 -- ext2 primary, 1.2 gb

hdb1 -- Win32, 30 gb
hdb5 -- Win32, 30 gb

hdb1 is soon to be an ext2 or ext3 partition, in part or all of it. My problem, however, is this:

How do I force my current install to use the extra space for something like, say, /usr, which is 673 mb(!!) on my miserable 1.2 gb partition?

DavidPhillips 06-28-2003 07:59 PM

just change the partition type in fdisk to type 83 (linux)

fdisk /dev/hdb1

t
1
83


format the partition with..
mke2fs /dev/hdb1

create journal to convert to ext3..
tune2fs -j /dev/hdb1

mount it somewhere..
mkdir /somewhere
mount /dev/hdb1 /somewhere

copy /usr files to it..
cd /usr
tar -c . | (cd /somewhere; tar -x)

now a copy of your files in /usr will be in /somewhere
mount the partition to /usr..

umount /somewhere
mount /dev/hdb1 /usr


update your /etc/fstab file to mount the partition at boot..
/dev/hdb1 /usr ext3 defaults 1 2




note: you can delete the files in /usr to reclaim disk space in /
do it like this..
umount /usr
rm -rf /usr
mkdir /usr
mount /usr

invictus 06-28-2003 08:14 PM

Ah-HAH!

Thank you muchly, I get it now.

invictus 08-17-2003 12:10 AM

Quote:

Originally posted by DavidPhillips


update your /etc/fstab file to mount the partition at boot..
/dev/hdb1 /usr ext3 defaults 1 2


note: you can delete the files in /usr to reclaim disk space in /
do it like this..
umount /usr
rm -rf /usr
mkdir /usr
mount /usr

Everything done almost as you had instructed.
/dev/hda5 is a 3.5G ext3 partition, created through the install of Mandrake. Mandrake was later killed (didn't have time to mess with it), leaving an empty 3.5G partition.

mount /dev/hda5 /h

cd /usr
cp -r * /h
umount /h
mount /dev/hda5 /usr

Then... Here comes the problem:
cd /
umount /usr
rm -rf /usr
mkdir usr
mount /dev/hda5 /usr

Space not reclaimed. /dev/hda3 is still at 100% full.

I've updated /etc/fstab, so the next thing I'll be trying is a reboot...

Suggestions? Corrections?

DavidPhillips 08-18-2003 09:31 PM

are you sure /usr was on hda5 to start with?

I don't see how it could still be using space if you actually deleted it.

try du -c /usr to see what space would be saved

invictus 09-07-2003 07:30 PM

Quote:

Originally posted by DavidPhillips
are you sure /usr was on hda5 to start with?

I don't see how it could still be using space if you actually deleted it.

try du -c /usr to see what space would be saved

Once again, thank you for the help. It worked flawlessly, except for the BKAC error. I backed up the original /usr before starting, and then totally forgot about it. No wonder the space didn't get freed up!

DavidPhillips 09-08-2003 04:13 PM

cool


All times are GMT -5. The time now is 08:16 AM.