Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/usr/portage in another partition? HowTo?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
KLG
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2005
Posts: 90
Location: @York, UK

PostPosted: Fri Aug 26, 2005 2:24 pm    Post subject: /usr/portage in another partition? HowTo? Reply with quote

Hi, I recently ruined my gentoo installation, so I must do everything again
I think that some day i ll mess everything again, so in order not to waste so
much time, i thougt why not place /usr/portage in anohter partition?

The only trouble is that i have the following parttions

sdba Win XP

sdb1 /root 20gb
sdb2 /swap 2.7gb
sdb3 /home 20gb
sdb4 /windows (FAT32) 35 gb

i really need the FAT32 for movies and mp3 and docs....

Can i mount from fstab the /usr/portage in sdb3?
What i have to change in a stage 3 installation? (plz be as much specific as possible)
i mean mount /dev/sdb3 /mnt/gentoo/usr/portage is correct????

Thank u in advance
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Fri Aug 26, 2005 2:37 pm    Post subject: Reply with quote

I can't quite follow you as to how this is supposed to help with ruining your installation... but you're free to put partitions anywhere you like. All you need is an empty filesystem (a partition, or a loopback file, or ...) and mount it in the target directory.

If the target directory already exists and there are files in that directory, you'll have to move these files onto your new partition/whatever first.

Something along these lines (use on your own risk):

Code:
mkfs.<fs> /dev/<part> # Deletes everything, gives you a nice clean empty partition
mount /dev/<part> /mnt/whatever
cp -a /path/to/target/directory/* /mnt/whatever/
# if there are hidden files in there, you have to move them extra
# set ownership and permissions like target
chown --reference=/path/to/target/directory /mnt/whatever/.
chmod --reference=/path/to/target/directory /mnt/whatever/.
umount /mnt/whatever
mount /dev/<part> /path/to/target/directory # make that an fstab entry


However, it's much more advisable to create & mount partitions first and then copy files in it. (mount first, extract stage tarball later). This way there's no risk of losing files (the only risk is wrong permissions for the mount directories you created, but that is easily fixed with chown/chmod).
Back to top
View user's profile Send private message
KLG
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2005
Posts: 90
Location: @York, UK

PostPosted: Fri Aug 26, 2005 5:58 pm    Post subject: Reply with quote

perhaps i wasn't as clear as i should have been,

I have already ruined the installation, and because i have a tedency to do things that i shouldn't i fear that i will ruin in the future my next installaton...

Because i am sure this is going to happen i want to save myself a few hours.... by puting /usr/portage in a different partition.

I am going to start from the begin (format everything and redo the partitions) -stage 3 installation, i have kept only the one FAT32 partition. The problem is that i dont want to have extended partitions, so i am forced to have both /home and /usr/portage in sdb3. Can i do that? And must i do something else during the installation, so it can extract the portage in sdb3?? How do I do that!

I know that i must "set" /usr/portage in fstab file, but before that?
Back to top
View user's profile Send private message
StarDragon
Guru
Guru


Joined: 19 Jun 2005
Posts: 390
Location: tEXas

PostPosted: Fri Aug 26, 2005 6:28 pm    Post subject: Reply with quote

My suggestion would be to put it in the /root hd (sdb1). To do that simply create two different partions, and when you mount the partitions into the installation just make sure you mount / /home and /usr/portage. Kinda like it's described in the guide:

Code:
4.e. Mounting

Now that your partitions are initialized and are housing a filesystem, it is time to mount those partitions. Use the mount command. Don't forget to create the necessary mount directories for every partition you created. As an example we mount the root and boot partition:

Code Listing 15: Mounting partitions

# mount /dev/hda3 /mnt/gentoo
# mkdir /mnt/gentoo/boot
# mount /dev/hda1 /mnt/gentoo/boot

Off course and for your extra partition
# mkdir /mnt/gentoo/usr
# mkdir /mnt/gentoo/portage
# mount /dev/hda4 /mnt/gentoo/portage


Hope that helps...
_________________
"After all, a person's a person, no matter how small."--Horton Hears A Who!
Back to top
View user's profile Send private message
Pithlit
l33t
l33t


Joined: 27 Dec 2003
Posts: 887
Location: fuhen

PostPosted: Fri Aug 26, 2005 6:41 pm    Post subject: Reply with quote

My partitions (/dev/hda2 is swap):
Code:

/dev/hda3             4,8G  1,7G  3,1G  36% /
/dev/hda5             2,4G  1,3G  1,2G  54% /portage
/dev/hda6             487M   35M  452M   8% /tmp
/dev/hda7              29G   24G  5,6G  81% /home
/dev/hda1              31M  9,2M   20M  32% /boot

My fstab:
Code:
/dev/hda1               /boot           ext3            noauto,noatime                  1 2
/dev/hda3               /               reiserfs        noatime,exec                    0 1
/dev/hda2               none            swap            sw                              0 0
/dev/hda5               /portage        reiserfs        noatime,users,defaults,exec     0 0
/dev/hda6               /tmp            reiserfs        noatime,users,defaults,exec     0 0
/dev/hda7               /home           reiserfs        noatime,users,defaults          0 0


What is wrong with the extended partitions? The system will deal with them exactly like with logical ones... Just make a table that will suit you.
_________________
If someone solves a problem for you say thanks... and put [SOLVED] in the title!
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Fri Aug 26, 2005 6:55 pm    Post subject: Reply with quote

KLG wrote:
Because i am sure this is going to happen i want to save myself a few hours.... by puting /usr/portage in a different partition.


I don't have an extra partition for /usr/portage - I only have / and /home (and some more inside /home). If I ruin my system (for example, I delete /etc or /usr/bin by accident or mkfs the / partition), what's the use of having the /usr/portage stuff on a separate partition?

I think for the case of screwing up it's much better to have a backup. The essential system files don't take up much space and are worth their money (I'd really hate to lose my system configuration, since I don't use standard settings much). I use an external hard disk for a complete backup, but you could fit essential system files (by that, I mean everything that can not be re-installed automatically by portage) easily on a CD. On a DVD you can fit even more, and DVD burners and media are damn cheap.

Quote:
The problem is that i dont want to have extended partitions, so i am forced to have both /home and /usr/portage in sdb3. Can i do that?


Possible in theory. Mount sdb3 somewhere and make /home and /usr/portage a symlink to directories in this mountpoint. Not very clean solution. Using extended partitions is much better - that's what they're there for. Unless you actually want /usr/portage and /home share free space - if a user screws up in /home (making the partition full), it might screw portage... same the other way around, as the distfiles folder grows... nah. Don't do it.
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3065
Location: Korea

PostPosted: Fri Aug 26, 2005 7:06 pm    Post subject: Reply with quote

In make.conf set the following:

Code:
PORTDIR = [path]
   Defines the location of your Portage tree.
   Defaults to /usr/portage.


So you can set it up to reside inside any partition.
Back to top
View user's profile Send private message
KLG
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2005
Posts: 90
Location: @York, UK

PostPosted: Mon Aug 29, 2005 10:14 pm    Post subject: Reply with quote

frostschutz>> i think u are right, whats the point saving 1-2 gigs of downloaded packages if u have to spend 2-3 days to have a really operational system...

I guess now thw question is: emerge --?? -? what? is there a programm like ghost for gentoo? or should i ghost the linux partitions from windows?

[quote=KLG] or should i ghost the linux partitions from windows? [/quote]

just kidding ppl :D
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3065
Location: Korea

PostPosted: Tue Aug 30, 2005 7:22 am    Post subject: Reply with quote

KLG wrote:
frostschutz>> i think u are right, whats the point saving 1-2 gigs of downloaded packages if u have to spend 2-3 days to have a really operational system...

I guess now thw question is: emerge --?? -? what? is there a programm like ghost for gentoo? or should i ghost the linux partitions from windows?


partimage is similar to ghost.
www.partimage.org

But again, on your separate partition with portage question:
You can put portage anywhere you want. So like if you were running out of space and your /home partition had lots of extra space all you'd need to do is this:
Code:
mv /usr/portage /home


Then edit your /etc/make.conf to have the following line added:
Code:
PORTDIR = /home/portage
Back to top
View user's profile Send private message
To
Veteran
Veteran


Joined: 12 Apr 2003
Posts: 1145
Location: Coimbra, Portugal

PostPosted: Tue Aug 30, 2005 9:07 am    Post subject: Reply with quote

I don't have the same situation, but since I got a new HD I use it for downloads and for the distfiles:

Code:
/dev/hda1               /boot                   ext2            noauto,noatime          1 1
/dev/hda3               /                       ext3            noatime                 0 0
/dev/hda4               /home                   ext3            noatime                 0 0
/dev/hdb1               /usr/portage/distfiles  ext3            defaults                0 0
/dev/hdb2               /home/to/.aMule         ext3            defaults                0 0
/dev/hda2               none                    swap            sw                      0 0
/dev/cdroms/cdrom0      /mnt/cdrom              iso9660         noauto,ro               0 0


The rest other users allready explain it.


_________________

------------------------------------------------
Linux Gandalf 3.2.35-grsec
Gentoo Base System version 2.2
------------------------------------------------
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum