Exapnd /tmp by mounting /tmp to a new harddisk and partition


  1. Install new harddisk / create new virtual disk 
  2. You may need to reboot in order for the kernel to recognize the new harddisk.
  3. assume the new harddisk is recognized as /dev/sdc
    You may check the existence of the new harddisk by fdisk -l /dev/sdc
  4. create new partition: fdisk /dev/sdcEnter the below command:
    1. n  (new partition)
    2. p  (primary)
    3. 1  (partition no. 1)
    4. accept default value for cylinder
    5. w  (write changes to disk)
  5. Create file system ext3 on the new partition: mkfs –t ext3 /dev/sdc1
  6. rename the existing /tmp to /tmp_old
    1. if /tmp mount on a separate disk
      1. edit the /etc/fstab to make it mount at boot
      2. add this line:
        /dev/sdc1  /tmp  ext3 defaults   0  0
      3. if the existing /tmp is mount on a separate partition, change the existing /tmp mount to /tmp_old in /etc/fstab (if any)
      4. mkdir /tmp_old
      5. reboot the Linux
    2. if /tmp is not mount on a separate disk
      1. reboot in single user mode
      2. rename /tmp to /tmp_old:
        Command: mv /tmp /tmp_old
      3. create new directory for mount: mkdir /tmp
      4. reboot the computer again to verify
  7. 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)
  8. delete /tmp_old content if everything works fine.

Comments

Popular Posts