# how to add another partition as /usr now?[solved]

## padoor

i have already installed gentoo in one partition without a boot partition.

this partition is of 18gb size and now it is 70 percent full .

i haave another gentoo installation on a 5.5 gb partition which is 95 percent full.

i want to format this 5.5 gb partition and add to the current gentoo installation as /usr or which ever will help in increasing the available space for gentoo. i plan to install more media applications of audio and video.

how best i can do this and how to mount as /usr for the existing installation.

currently my / is hda3

want to add is hda11

help is needed.

----------

## cyblord

hmm... I think it's possible with fdisk.

I'll look into it

----------

## swooshOnLn

hum...

Well, you could do it like this possibly.

Find a path in /usr that takes up about 5.5 gigs (and wont tend to grow past that) and copy it to your hda11 partition. Once you have done that, remove that path from your hda3 drive, and then mount hda11 as that path. Here is the basic layout

/usr/share/space (~5.5 gigs)

```

cp -rRv /usr/share/space /mnt/hda11

rm -r /usr/share/space

...

mount /dev/hda11 /usr/share/space

```

I would let somebody after me clearify this up a lil bit, but this should be a partial way to go about this.

----------

## Maedhros

Moved from Installing Gentoo to Kernel & Hardware.

----------

## padoor

 *swooshOnLn wrote:*   

> hum...
> 
> Well, you could do it like this possibly.
> 
> Find a path in /usr that takes up about 5.5 gigs (and wont tend to grow past that) and copy it to your hda11 partition. Once you have done that, remove that path from your hda3 drive, and then mount hda11 as that path. Here is the basic layout
> ...

 

i found now that my current /usr is of >5.3gb size.

i want to keep the downloaded /distfiles

can the above suggestion write new files in the mounted space and keep the /usr as it is?

coming to think of this it looks a mess of a job.

its nearly impossible to copy the existing contents to new space without error.

as power failure is common thing here and any failure in copying ---  my gentoo  ???

if we can find a way to mount the new partition as /usr/portage that can by itself help .

i hope some thing can be done to increase the available space for this installation.

----------

## magic919

Copy /usr/portage over to the 'new' partition by temporarily mounting it as something else.  Then unmount it and re-mount as /usr/portage.  Job done.  Don't forget to update fstab.

You can clear out the 'old' /usr/portage once you know it's safe.  Unmount new one first!

----------

## padoor

i will try doing that last suggestion.

my present /usr/portage is 2.2gb size . when i mount hda11 as /usr/portage it will give a space of 2.2 gb to / partition.

hope the copying works ok

----------

## magic919

I hope it goes well.  But don't worry too much about the copying.  As you still have the original you can just try it again.  It's not like moving things where stuff can get harmed.

----------

## padoor

sure thing i will copy first to /mnt/hda11

then rename the /usr/portage to /usr/pge or something and mount the hda11 as /usr/portage when it works ok i can delete the renamed folder.

in the meanwhile i have asked for help in altering partitions in the following thread

if it can work that would be much easier.

https://forums.gentoo.org/viewtopic-t-466542-highlight-.html

----------

## NeddySeagoon

padoor,

Make the filesystem of your choice on /dev/hda11, say ext3,  

```
mke2fs -j /dev/hda11
```

mount it on a temporary mount point 

```
mount -t ext3 /dev/hda11 /mnt/cdrom
```

create a special mount point if you prefer.

Copy over everything from /usr to /mnt/cdrom preserving permissions and so on 

```
cp -ar /usr /mnt/cdrom
```

make a new line in /etc/fstab like 

```
/dev/hda11  /usr ....
```

to mount /dev/hda11 on boot.

Reboot to test ... you should notice that your /usr now has a lost+found directory but your old /usr did not.

At this point, you have not saved any space ... you are mounting the new /usr over the top of the old one and the old one is hidden.

When you are happy all is well, boot with the liveCD, mount your root on /mnt/gentoo and remove the content of /mnt/gentoo/usr but not the usr itself, since that is now the mount point for /dev/hda11. You have now regained your space in root.

----------

## padoor

 *NeddySeagoon wrote:*   

> padoor,
> 
> Make the filesystem of your choice on /dev/hda11, say ext3,  
> 
> ```
> ...

 

cp -ar /usr /mnt/cdrom

i used this code and copied the usr to /dev/hda1 after formating and sizing  ext3  13 gb sixe.

dir /dev/hda1   gave  usr

upon mounting it as /usr it gave errors couldnot find x paths and ssorts of messages while bootimg and did not boot up.

then i moved all folders to /dev/hda1   without the usr folder.

then it booted up ok and works.

all paths may be looking /usr while actually it was /usr/usr

that solved the adding space to /usr.

but i did not gain any space in  hda3  / partition

i had renamed the old /usr as /old and mkdir /usr before mounting the new /usr partition.

now i dont see the /old folder to delete.

where it could have vanished?

kdf still shows 65 percent usage of the space. in hda3

kdf shows 48 percent usage of hda1 of 13 gb space

is this correct?

where the old /usr files would have gone?

----------

## NeddySeagoon

padoor,

The old /usr is still there, its contents are hidden under the new /usr.

To delete the content of the old /usr you must boot with a liveCD, since you do not want the new /usr to be mounted.

Boot with the liveCD and mount your root partition at /mnt/gentoo.

Run 

```
df
```

or 

```
mount
```

to make sure no other Gentoo partitions are mounted - you really don't want to get this wrong.

The content of /mnt/gentoo/usr belongs to the old /usr - it must, its on your root partition and no others are mounted.

Delete the contents of /mnt/gentoo/usr but not /mnt/gentoo/usr itself, thats now the mount point for your new /usr.

When you reboot normally, you will see your extra space.

----------

## padoor

yes i got the space occupied by the old usr 

i had done something of a blunder.

as soon as i found the newly mounted hda1 as /usr works fine  i draged those files in /old which was the one i had renamed the old /usr  to /mnt/hda11 and moved them.thinking incase of trouble i can copy them back.

this time i am saved because the new mounted partition worked ok.

then i umounted /dev/hda11 and formated it to ext3

then now in livecd boot mounted /dev/hda3 only the / partition.

all these files were showing in the /mnt/hda11 i deleted them and then now i got the space.

now kdf shows usage of 28 percent of hda3 18gb space.

though i did not understand how it was moved to hda11 folder not the partition. i have all partitions mounted with fstab during boot.

i have now gained 5.5 gb space in / partition and there is 6.3 gb space in the /usr partition

i think that should do for a long time for me.

thanks for all the support and guidance.

thanks again

----------

