Well, what is it you really want to do? Remeber you have to think
differently in UNIX. You can increase you space by grafting in additional
partitions where ever you want. Let's say for example you have your
current hd is set up as follows:

Device         Mount Point        Size
/dev/hda1      /                          200MB
/dev/hda2      /home                 8500MB
/dev/hda3      /var                     200MB
/dev/hda4      /tmp                    200MB
/dev/hda5      /usr                     1000MB

Now you have found that you just don't have enough space in /usr anymore,
but you have ample space in /home, so you would like to move some space
over from one to another. First tar the contents of /home and /usr and
save these off in a safe place where you can restore them later (e.g. a
tape drive).

Next unmount /usr and /home, and use fdisk to repartition them to the
right size (say 2000MB for /usr, and 7500MB for /home). You should
probably go to single user during this process just to be safe. Once you
have done that, remount /usr and /home, and untar your /usr and /home
tarballs.

What gets really cool is if you want to add another HD. Say you want to
put in a new HD to increase /home, and then use the capacity of /home to
increase /usr. Partition your new HD and mount it (mount it where ever,
say /mnt/tmp), then copy the contents of /home to the new HD. Now wipe
out the contents of /home and umount both /home and the new HD. Now
remount the new HD at mount point /home, and repeat the process for
transfering files from /usr to the old /home partition.

Cool stuff huh.

Cristian Carnutu wrote:

> Hi,
>
> 1.How can I enlarge a Linux partition without loose data?
> 2.Is there anyway to make smaller an ext2 partition without loose data
> on it?
>
> Regards,
>
> Cristian

--

Robert B. Haehnel
Ice Engineering Research Division
Cold Regions Research and Engineering Laboratory
72 Lyme Road
Hanover, NH 03755-1290

Phone:  (603)646-4325
Fax:    (603)646-4477
e-mail: [EMAIL PROTECTED]
web:    http://www.crrel.usace.army.mil


Reply via email to