Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I created a schroot recently (following the directions here), and it conveniently shares my (host) user home directory. That is, /home/username is the same in the chroot as outside the chroot.

Where is this behaviour configured ? How can I prevent this behaviour ?

I'm using Ubuntu desktop 12.04 64-bit, and schroot version info is

$ schroot --version
schroot (Debian sbuild) 1.4.25 (03 Feb 2012)
share|improve this question
    
Is it the same folder both places we are talking about. Or what is the reason you want this behavior changed? –  Diblo Dk Jul 8 '13 at 23:01
    
@DibloDk If I understand your first question, I think the answer is yes. find /home/username returns the same values whether I'm chrooted or not. –  Limited Atonement Jul 9 '13 at 18:11
    
@DibloDk Oops, I guess enter sends the message. The reason I want it changed is for security. I have a chroot so that I can run programs (I'm currently running Windows programs using wine, so I truly don't trust them!) without as much risk to my system. I don't want the programs to have access to my home directory. I hope that answers your question. –  Limited Atonement Jul 9 '13 at 18:15
    
Yes I can see that my question is very unclear. I think I have understood you, but to just be safe. - The home path /home/username are this two different path or the same? :) –  Diblo Dk Jul 9 '13 at 21:18
    
@DibloDk They refer to the same part of the disk, and, naturally, have the same contents, so I'll say they're the same :-) –  Limited Atonement Jul 10 '13 at 13:07

2 Answers 2

up vote 1 down vote accepted

By default, schroot mount directories according to filesystem table file /etc/schroot/default/fstab. You could comment the line start with /home so that schroot won't bind-mount the home directory.

You could also specify other filesystem table file by editing schroot conf file. For example, if you add setup.fstab=minimal/fstab to the end of /etc/schroot/chrood.d/[your chroot's].conf, schroot would filesystem according to /etc/schroot/minimal/fstab.

share|improve this answer
    
Wow! A big welcome to Stack Overflow, and, thanks for the excellent answer. It was worth the year-and-an-half wait! –  Limited Atonement Nov 27 at 3:16
1  
Thank you, I'm very glad that you accepted my first answer. –  Tianren Liu Nov 30 at 21:27

Go into the host system (exit the chroot), and run mount. There, you should see where you home directory (and any others) are mounted into the chroot. Navigate to the destination directory and run umount. Something like this should work:

# umount $(mount | grep 'home.*precise' | awk '{print $3}')

where the grep pattern home.*precise is whatever matches the mount points you want to get rid of.

share|improve this answer
    
Unfortunately, the directory gets remounted later, and I'm not sure by what mechanism. –  Limited Atonement Jul 29 '13 at 15:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.