Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Deleting non-essential dirs
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Sat Mar 01, 2014 8:27 pm    Post subject: Deleting non-essential dirs Reply with quote

I'm synchronizing a Gentoo install from one laptop to multiple other laptops. All of the laptops are identical. My goal is to only sync what is essential to the other laptops and delete the rest.

Here's what I'm deleting:

/home/*/* (except for /home/*/.config/xfce4 and /home/*/.gvfs)
/usr/portage
/usr/src/*
/var/cache/*
/var/log/*
/var/tmp/*
/tmp/*
/var/spool/* (except for /var/spool/cron)
/usr/local/portage

Here's what I'm not syncing but not deleting:

/run
/dev
/sys
/proc
/media
/mnt
/swapfile

Everything else is being synced. Can I get rid of more? Am I dumping anything I should keep?
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Sun Mar 02, 2014 11:16 am    Post subject: Reply with quote

I'd be inclined to ignore anything under /var - it's stuff which each system records
and updates for itself. You might want to copy some of the /var/log/portage stuff
depending on how the systems are built.

/bin, /boot, /etc, /home, /lib, /opt (?), /root, /sbin, /usr, /usr/portage if it's a separate
filesystem - that's about it.

Will
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Mon Mar 03, 2014 7:27 pm    Post subject: Reply with quote

I tried removing /var entirely but the system behaved strangely after boot up. Some things would take a very long time to show up on the screen. The lightdm login display for example. The mouse cursor was there and controllable right away but nothing else. The login display would show up after a couple minutes. Some other similar behavior inside xfce4. Which /var folder was likely the culprit?

Am I OK to get rid of everything in /run except for /run/openrc?

Any special considerations for a running system?
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1377

PostPosted: Mon Mar 03, 2014 8:08 pm    Post subject: Reply with quote

cwr meant to ignore when synchronizing. Not removing the dirs!
(This way you asked)
_________________
fun2gen2
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Mon Mar 03, 2014 8:48 pm    Post subject: Reply with quote

So the folders beneath /var need to remain intact?
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1377

PostPosted: Mon Mar 03, 2014 10:26 pm    Post subject: Re: Deleting non-essential dirs Reply with quote

grant123 wrote:
I'm synchronizing a Gentoo install from one laptop to multiple other laptops.

Your first sentence of your first post gone in a terrible wrong direction:
The content of these directories mostly doesn't need to be synchronized (the files).
What you really don't need, e.g.: /usr/share/doc/DIRS/FILES
_________________
fun2gen2
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Mon Mar 03, 2014 11:32 pm    Post subject: Reply with quote

Quote:
Your first sentence of your first post gone in a terrible wrong direction:
The content of these directories mostly doesn't need to be synchronized (the files).

Which directories? You mean most directories on the system?

Quote:
What you really don't need, e.g.: /usr/share/doc/DIRS/FILES

/usr/share/doc/ is a good one to ditch. Others?
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1377

PostPosted: Tue Mar 04, 2014 10:31 am    Post subject: Reply with quote

Directories are places
ebuilds install them to allow files to be placed
by users. If a service runs as a user
it cannot happen there are left over files of this service all over the place of your system
but these places.

Linux is about security!
_________________
fun2gen2
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Tue Mar 04, 2014 11:55 am    Post subject: Reply with quote

Yes, sorry, I wasn't clear. I was considering synchronizing, not copying, as ulenrich says.

If you are copying, then you need most but not all of /var - I'd be inclined, for instance,
to lose /var/spool. OTOH /var's usually small - you could just copy the whole thing.

Will
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Tue Mar 04, 2014 1:15 pm    Post subject: Reply with quote

How about /run?
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1377

PostPosted: Tue Mar 04, 2014 1:29 pm    Post subject: Reply with quote

Consider all directories are potentially needed.
Why would an ebuild install them otherwise.
_________________
fun2gen2
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Tue Mar 04, 2014 1:55 pm    Post subject: Reply with quote

Sure but some locations on a running system can be skipped when syncing or copying to a new system. /dev/* (except for /dev/null, /dev/console, and /dev/random), /proc/*, /sys/*, /media/*, and /mnt/* for example.
Back to top
View user's profile Send private message
mreff555
Apprentice
Apprentice


Joined: 10 Mar 2011
Posts: 231
Location: Philadelphia

PostPosted: Wed Mar 05, 2014 1:52 am    Post subject: Reply with quote

For the sake of completeness, if you are getting rid of /usr/portage you probably don't need /etc/portage either.
Honestly if you are just syncing to the other laptops your don't really need a compiler either.
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Wed Mar 05, 2014 10:41 pm    Post subject: Reply with quote

Which location(s) can I dump to get rid of the compiler?
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1377

PostPosted: Wed Mar 05, 2014 11:49 pm    Post subject: Reply with quote

grant123 wrote:
Which location(s) can I dump to get rid of the compiler?

less /var/db/pkg/sys-devel/gcc-4.7.3-r1/CONTENTS
_________________
fun2gen2
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Thu Mar 06, 2014 1:49 am    Post subject: Reply with quote

It looks like the big one for gcc is /usr/lib/gcc.

/lost+found is another one to dump.
Back to top
View user's profile Send private message
mreff555
Apprentice
Apprentice


Joined: 10 Mar 2011
Posts: 231
Location: Philadelphia

PostPosted: Thu Mar 06, 2014 12:15 pm    Post subject: Reply with quote

When you successfully finish this project I would be interested to know what the net filesystem size is.
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Thu Mar 06, 2014 1:43 pm    Post subject: Reply with quote

If I were to dump all of this extra stuff it would almost get down to 4GB. In the past I've used a different approach to get a super-minimal Gentoo system under 256MB which I load to a ramdisk on the 256MB Beaglebone. I felt pretty cool about that.
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Thu Mar 06, 2014 2:08 pm    Post subject: Reply with quote

How about /var/db/pkg?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10273
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Mar 06, 2014 2:33 pm    Post subject: Reply with quote

Just to be clear, you're never going to run Portage on any of the cloned laptops, right? If this statement is not true, then you need /var/db/pkg.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Thu Mar 06, 2014 2:44 pm    Post subject: Reply with quote

No portage on the cloned laptops.
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Thu Mar 06, 2014 3:38 pm    Post subject: Reply with quote

Dumping /usr/lib/gcc ended up causing all kinds of problems so that's a keeper.
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Thu Mar 06, 2014 9:35 pm    Post subject: Reply with quote

/usr/share/gtk-doc can go.
Back to top
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 989

PostPosted: Thu Mar 06, 2014 11:38 pm    Post subject: Reply with quote

Can these contain private info?

/var/tmp
/var/spool
/var/cache
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10273
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Mar 06, 2014 11:51 pm    Post subject: Reply with quote

Gentoo generally follows the Filesystem Hierarchy Standard. You might want to read up on that.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
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
Goto page 1, 2  Next
Page 1 of 2

 
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