0

I added two extra entries in my fstab file in an attempt to move tmp directories off SSD to HDD:

/dev/sdb1 /tmp none bind 0 0
/dev/sdb1 /var/tmp none bind 0 0

However this stops my PC from booting up and there's an error: "mount: /var/tmp: mount(2) system call failed: Not a directory"

What am I doing wrong? How can I move those temp dirs from my SSD to HDD?

2
  • 1
    Why are you attempting to mount that partition into two different directories? If you want its contents to be on the HDD, then just create a directory on the HDD and change /etc/fstab to mount it there. Commented Jun 7, 2020 at 15:37
  • If you only intend to just move files from one disk to another, there is no need to add an entry to /etc/fstab. The file /etc/fstab holds items to be mounted by the system on every boot with mount -a. Instead, you should just temporarily mount the two disks with mount commands, mount /dev/sdXn /some_dir; mount /dev/sdYm /other_dir and then rsync(1) or cp(1) files from /some_dir to /other_dir. Commented Jul 10, 2022 at 13:22

2 Answers 2

1

The error is related to the /dev/sdb1 device (fstab field #1), not the /tmp directory (field #2).

You have specifed the bind mount option (fstab field #4) and in this case is the syntax of the mount call:

mount -o bind olddir newdir

and not the usual mount device mountdir.

0

Well, the message says that /var/tmp is not a directory. As you seem to have access to the filesystem, you should do an ls -l /var to see if /var/tmp exists and if it does, it is a directory. It depends a bit on your system, but it might be that /var/tmp is a link to /tmp.

4
  • i can confirm that both /var/tmp and /tmp are directories Commented Jun 7, 2020 at 16:02
  • Yet, mount does not see it. Is /var on a separate partition, that may not yet have been mounted when you mount /var/tmp? Commented Jun 7, 2020 at 16:08
  • /var is on the same partition as /tmp (some /dev/sdaX) Commented Jun 7, 2020 at 23:53
  • Can you add the full fstab to your question? Commented Jun 8, 2020 at 6:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .