Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sym linking /tmp
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
carpman
Advocate
Advocate


Joined: 20 Jun 2002
Posts: 2202
Location: London - UK

PostPosted: Tue Feb 12, 2008 11:01 am    Post subject: sym linking /tmp Reply with quote

Hello, on new install was thinking of doing away with /tmp partition and just sym linking it to a /var/tmp partition are there are issues with doing this or can i just do and not worry?

cheers
_________________
Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Tue Feb 12, 2008 11:35 am    Post subject: Re: sym linking /tmp Reply with quote

carpman wrote:
Hello, on new install was thinking of doing away with /tmp partition and just sym linking it to a /var/tmp partition are there are issues with doing this or can i just do and not worry?

cheers


I usually do this on my desktop machine and haven't had any problem for years.
Back to top
View user's profile Send private message
schachti
Advocate
Advocate


Joined: 28 Jul 2003
Posts: 3765
Location: Gifhorn, Germany

PostPosted: Tue Feb 12, 2008 5:08 pm    Post subject: Reply with quote

Instead of symlinking, you can do it using mount:

Code:
mount -bind /var/tmp /tmp

_________________
Never argue with an idiot. He brings you down to his level, then beats you with experience.

How-To: Daten verschlüsselt auf DVD speichern.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Tue Feb 12, 2008 5:23 pm    Post subject: Reply with quote

Actually, what I do is to just mount the same device at two points from fstab.

But any solution should work the same as far as I can tell.

Code:

$ grep tmp /etc/fstab
none /dev/shm   tmpfs nodev,nosuid,noexec 0 0
/dev/sdc9 /tmp ext2 noatime 0 1
/dev/sdc9 /var/tmp ext2 noatime 0 1
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Tue Feb 12, 2008 7:20 pm    Post subject: Reply with quote

Moved from Installing Gentoo to Other Things Gentoo.
Not about getting gentoo installed, so moved here,
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
carpman
Advocate
Advocate


Joined: 20 Jun 2002
Posts: 2202
Location: London - UK

PostPosted: Tue Feb 12, 2008 8:13 pm    Post subject: Reply with quote

i92guboj wrote:
Actually, what I do is to just mount the same device at two points from fstab.

But any solution should work the same as far as I can tell.

Code:

$ grep tmp /etc/fstab
none /dev/shm   tmpfs nodev,nosuid,noexec 0 0
/dev/sdc9 /tmp ext2 noatime 0 1
/dev/sdc9 /var/tmp ext2 noatime 0 1



did not know that was possible?
_________________
Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Tue Feb 12, 2008 8:18 pm    Post subject: Reply with quote

carpman wrote:
i92guboj wrote:
Actually, what I do is to just mount the same device at two points from fstab.

But any solution should work the same as far as I can tell.

Code:

$ grep tmp /etc/fstab
none /dev/shm   tmpfs nodev,nosuid,noexec 0 0
/dev/sdc9 /tmp ext2 noatime 0 1
/dev/sdc9 /var/tmp ext2 noatime 0 1



did not know that was possible?


That's the way I do it, and it certainly worked for a few years now.

Code:

# mount | grep tmp
udev on /dev type tmpfs (rw,nosuid)
none on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)
/dev/sdc9 on /tmp type ext2 (rw,noatime)
/dev/sdc9 on /var/tmp type ext2 (rw,noatime)
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6749

PostPosted: Tue Feb 12, 2008 8:30 pm    Post subject: Reply with quote

i92guboj wrote:
Code:
/dev/sdc9 /tmp ext2 noatime 0 1
/dev/sdc9 /var/tmp ext2 noatime 0 1

I don't remember where I read it, but this was explicitly discouraged in some official document, because you have no guarantee that the kernel recognizes that this is the same filesystem just mounted twice. It is more secure to tell him explicitly, using --bind:
Code:
/dev/sdc9 /tmp ext2 noatime 0 1
/tmp /var/tmp none bind 0 0
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Tue Feb 12, 2008 8:38 pm    Post subject: Reply with quote

mv wrote:
i92guboj wrote:
Code:
/dev/sdc9 /tmp ext2 noatime 0 1
/dev/sdc9 /var/tmp ext2 noatime 0 1

I don't remember where I read it, but this was explicitly discouraged in some official document, because you have no guarantee that the kernel recognizes that this is the same filesystem just mounted twice. It is more secure to tell him explicitly, using --bind:
Code:
/dev/sdc9 /tmp ext2 noatime 0 1
/tmp /var/tmp none bind 0 0


It worked here for many years, but that doesn't mean it is correct.

Do you remember something more or can you give me any clue on what to search for so I can research a bit more on this?
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6749

PostPosted: Tue Feb 12, 2008 10:27 pm    Post subject: Reply with quote

i92guboj wrote:
Do you remember something more

No, sorry. It was many years ago that I read this. Maybe for current kernels it is not even true anymore.
On the other hand, it might happen that you have no problems for a long time but there can be race conditions anyway: It is not hard to imagine problematic situations which might happen if one of the mounts has just cached a block which the other changes...

Actually, I used to mount the same FAT partition twice with different options. But I would not dare to write on both simultaneously...
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Tue Feb 12, 2008 10:42 pm    Post subject: Reply with quote

mv wrote:
i92guboj wrote:
Do you remember something more

No, sorry. It was many years ago that I read this. Maybe for current kernels it is not even true anymore.
On the other hand, it might happen that you have no problems for a long time but there can be race conditions anyway: It is not hard to imagine problematic situations which might happen if one of the mounts has just cached a block which the other changes...

Actually, I used to mount the same FAT partition twice with different options. But I would not dare to write on both simultaneously...


Yes, race conditions is what I had in mind. But the fact is that, well, both are tmp partitions. And in gentoo you can spend literally hours or days compiling and writing thousands or even hundreds of thousands of files into /var/tmp/portage, while you use /tmp (which is on the same partition) to store the users temporal stuff.

So, it would be the best environment to reproduce such a race condition, and for years and years of Gentoo, I haven't noticed any kind of corruption at all.

Anyway, there is nothing valuable on this partition, and the contents is erased on bootup anyway, so, that might be it as well...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things 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