Skip to main content
Exapnd /tmp by mounting /tmp to a new harddisk and partition
- Install new harddisk / create new virtual disk
- You may need to reboot in order for the kernel to recognize the new harddisk.
- assume the new harddisk is recognized as /dev/sdc
You may check the existence of the new harddisk by fdisk -l /dev/sdc
- create new partition: fdisk /dev/sdcEnter the below command:
- n (new partition)
- p (primary)
- 1 (partition no. 1)
- accept default value for cylinder
- w (write changes to disk)
- Create file system ext3 on the new partition: mkfs –t ext3 /dev/sdc1
- rename the existing /tmp to /tmp_old
- if /tmp mount on a separate disk
- edit the /etc/fstab to make it mount at boot
- add this line:
/dev/sdc1 /tmp ext3 defaults 0 0
- if the existing /tmp is mount on a separate partition, change the existing /tmp mount to /tmp_old in /etc/fstab (if any)
- mkdir /tmp_old
- reboot the Linux
- if /tmp is not mount on a separate disk
- reboot in single user mode
- rename /tmp to /tmp_old:
Command: mv /tmp /tmp_old
- create new directory for mount: mkdir /tmp
- reboot the computer again to verify
- Migrate everything from /tmp_old to /tmp
cd /tmp_old
find . -depth -print | cpio -pdlmv /tmp(You may need to add overwrite parameter (-u) to cpio if you are in second attempt to avoid excessive confirmation: find . -depth -print | cpio -pdlmvu /tmp)
- delete /tmp_old content if everything works fine.
Comments