Move /tmp (tmpfs) to external mount point permanently

Hi All,
I'm looking for some help in moving the /tmp (tmpfs) from a internal root mount on a very small GLiNet router to an externally mounted partition permanently.
My principle problem involves moving large files from one external mounted partition to another, this is using tmp/ which fills up at 64Mb and the transfer stops.
I've no problems rebooting this router any time as I'll be the only one using it.
I created a /mnt/storage/usbtmp directory which is mounted by fstab automatically.
I set the permission of usbtmp/ using chmod 1777 /mnt/storage/usbtmp

I tried to move the /tmp and resize using
mount -o move /tmp /mnt/storage/usbtmp
mount -o remount,size=2G /mnt/storage/usbtmp/

The first problem is this isn't persistent and more importantly I ended up with a /rom & /overlay as RO.
If I move /tmp to an external partition, will there be a timing issue mounting this before the /usb storage is actually mounted by fstab?

Thanks in Advance

Mike

1 Like

/tmp is a RAM disk, which by default (possibly hard-coded in the kernel) has a maximum capacity of half of the RAM. The advantage is that access is very fast, and repeated writes (e.g. log files) don't wear out the flash chip. Also if /tmp is 100% filled by mistake, it will be erased on reboot.

So /tmp should be left where it is, and not used for very large files. Why can't the file be copied directly?

Hi Mk24,
Thanks for getting back.
One of the drives is a webdav mount , ie: usbA
the other is ext3 ie: usbB

When I'm using a cp command to copy from usbB -> usbA, this uses /tmp automatically. It fills up and the I get an I/O error for the file copy. Is it possible to copy directly from ext to davfs without utilising any tmpfs ?

Thanks

The tmpfs is stored on RAM, and expected to be used for small temporary files. You should not need to use tmpfs to copy from one drive to another.

You mentioned davfs, which is a network filesystem, but origin and destination seem to be on two local USB drives. Can you give us more info about this?