Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've recently been put in charge of a RHEL6 server running our NMS. I don't know much about Linux filesystem administration. What I'm needing to do is create a partition for /tmp, instead of having it sit on /. We are using LVM to handle our partitions.

#Output of df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             4.0G  1.1G  2.7G  29% /
tmpfs                  16G  116K   16G   1% /dev/shm
/dev/sda1             504M   61M  419M  13% /boot
/dev/mapper/VolGroup00-LVusr
                      4.0G  2.8G 1003M  74% /usr
/dev/mapper/VolGroup00-LVvar
                      9.9G  4.5G  4.9G  48% /var
/dev/mapper/VolGroup00-LVopt
                      252G   11G  229G   5% /opt

#Output of cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on <REDACTED>
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=d13d3a55-39c4-4be8-81b3-3181440961ca /                       ext4    defaults        1 1
UUID=d032e7b7-f44e-499f-94e1-58064385108f /boot                   ext4    defaults        1 2
/dev/mapper/VolGroup00-LVusr /usr                    ext4    defaults        1 2
/dev/VolGroup00/LVvar           /var            ext4    defaults        1 2
/dev/mapper/VolGroup00-LVopt /opt                    ext4    defaults        1 2
/dev/mapper/VolGroup00-LVswap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
#<REDACTED>:/volumes/nxpool-01/unix-home/home /home  nfs     defaults,rsize=8192,wsize=8192,intr,vers=3     0 0

This server has 1TB of RAID5 storage, so space isn't an issue. We have ample unallocated space to hand out, I just don't know how to create the partition using LVM. I started to run into issues of automated backups using /tmp and running out of space, so backups started to fail.

Please let me know if I'm leaving out any vital information.

share|improve this question
1  
You should probably go to the people who put you in this position and ask them for some much needed education on the tools that they are making you use - you desperately need it and will be much better off with it. –  Iain Jan 24 at 14:32
    
I have never met a distro where tmp wasn't already on a separated partition. Sometimes it's over memory (tmpfs) and sometimes it's on a disk, whether it's lvm or not. –  Kwaio Jan 24 at 14:57

1 Answer 1

Per advice given, I asked my colleague who knows more than I.

The general outline of what needed to happen:

`vgdisplay` to see Volume groups
`lvcreate -L <size> -n <name> <volgroup>` to create a new logical volume
`mke2f -t <fstype> <path/to/volgroup/<name>>` to create a filesystem out on the logical volume
`vim /etc/fstab` and add a new entry
`mount` the new partition
share|improve this answer
    
It won't harm anything, but you likely left files in /tmp on the original partition which are now hidden by the mount. You would have to do a boot-to-single-user-mode two-step to eliminate them properly. –  Dan Garthwaite Jan 24 at 16:46
    
Ah yeah I actually got rid of everything there first –  ResidentBiscuit Jan 25 at 0:00

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.