What is the best way to point a folder in one of my websites directory to a folder in a second HDD I just had installed? I see things about fstab and symlink but am lost at what is the best way to do it. My main HDD (sda) has almost filled up so I would like to move the uploads folder of one of my sites, which contains a few hundred GB of files, to the 2nd HDD (sdb). I want this folder to still be read and written to the same way it always has. Any ideas? Thanx
Point folder on main HDD to newly mounted 2nd HDD
linux;hard disk;symlink;fstab
In the following, LABEL can be anything you want, /dev/sdb1 is the partition you create and choose to use on your new HDD and /var/www/myfiles is where your files are currently located.  Alter these to suint your scenario.Partition the new HDD.  You can have one partition that takes up the whole disk, or make a smaller partition which leaves you space on the HDD for other partitions at a later date. gparted is probably the easiest way to create partitions.Create a filesystem on the new partition.  Name the filesystem.  The command needed to do this depends on which filesystem you choose to use.  If it's ext2/3/4 then use the e2label command - eg e2label /dev/sdb1 WebFiles. Alternatively, gparted can add labels to a partition.Mount the new partition on /mnt - mount /dev/sdb1 /mnt.Move the data from the old directory to the new HDD - mv /var/www/myfiles/* /mnt. Note - move the files; don't copy them; as the copy command (cp) can change owners of files.Unmount the new partition - umount /mnt.Mount the new partition on the directory where the files should reside - mount /dev/sdb1 /var/www/myfiles.If everything works, make this permanent by adding an entry to /etc/fstab:LABEL=WebFiles /var/www/myfiles            ext4 defaults 1 2Unmount it - umount /dev/sdb1; then check it mounts automatically using the fstab entry - mount -a.Hopefully, everything should work ;-)