Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a new Ubuntu 11 server install created per the wiki with the following partitions:

md1 : active raid5 sdc5[2] sda5[0] sdb5[1]
  1935813632 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]

md2 : active raid5 sdb6[1] sdc6[2] sda6[0]
  16722944 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]

md0 : active raid1 sda1[0] sdc1[2](S) sdb1[1]
  487412 blocks super 1.2 [2/2] [UU]

unused devices: <none>

/ is mounted at md1, md2 is swap and md3 is /boot.

I would like to create a tmpfs for /tmp which I probably should have done at install time, but I'm wondering if there is any issue doing it now, considering that its parent is a RAID array?

Also, what process would you recommend for creating the tmpfs?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

No problem, by the time you are mounting /tmp is mounted / will aready be mounted. The file system you are mounting to is relatively unimportant. It is important that it is already mounted. Using tmpfs will actually help your raid perfomance if you do use /tmp a lot.

More important with tmpfs is the size of your swap partition. The available memory including swap controls how large a tmpfs file system you can create. When memory gets tight or /tmp data ages, it is likley be moved to swap. Creating large files in tmpfs tends to involve swapping some of the data to your swap partition, but generally this should not be a problem.

EDIT: WARNING: tmpfs is temporary and will be flushed every reboot. I've seen long multi-step runs trashed by storing data on file systems cleared on reboot. Don't use a tmpfs mount for anything that needs to survive a reboot. Do use tmpfs for anything that should not survive a reboot.

Some systems have a script that clears /tmp and/or similar directories on reboot. Behavior of these should be the same whether or not tmpfs is used.

share|improve this answer
    
Thanks @Bill, that helps. My swap is 16Gb and I have 8Gb of RAM, so I´m hoping that should be enough. Does that sound right? –  Jonathan Day Jul 4 '11 at 22:34
    
@Johnathan Far more than enough. –  BillThor Jul 5 '11 at 13:14
add comment

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.