I have installed Debian Server on one of my servers and plugged in a extern hard drive to it through USB (sdb1, 2, and 5 on the image below) where I have all my files on right now. Before I used this WD Red hard drive (that are in a cabinet right now) in a NAS from Synology and I have not formatted it and I don't want that either. Now I want to manage these files through FileZilla over SSH.

I can't boot into Synology's operating system on my server because of unknown reasons. Therefore I installed Debian Server. I know that I can install Xpenology on a USB drive and boot it from there but I don't know how so Debian is the first choice at this moment. FreeNAS is no go since it requires 8 GB in RAM. My server only have 1 GB or 1,5 GB in RAM.

How can I access my files through FileZilla over SSH? Where can I find the location of the files on the extern hard drive and so on? Is mount the correct command for this? How can I use it?

enter image description here


To access the files on a disk, you need to mount the partition where they're stored. Mounting attaches a storage area to a directory; after mounting, the files in that storage area are accessible under that directory. Once the storage is mounted on a directory, just navigate to that directory in Filezilla.

fdisk is telling you that the external disk is split into three partitions, all of them apparently RAID volumes. I write “apparently” because the type indicated on the partition is only a convention, Linux doesn't actually care. It's a bit strange to have a single disk with RAID volumes. To see what's in those volumes, run

file -s /dev/sdb?

Another useful command to see a summary of available storage volumes is lsblk.

If you indeed have RAID volumes, you'll need to assemble them with mdadm -A. The command looks like this to assemble a two-disk RAID volume:

mdadm -A /dev/md0 /dev/sdb1 /dev/sdc1

Then, to mount it, use the mount command on an existing directory.

mkdir /media/md0
mount /dev/md0 /media/md0

(Picking the same name for the directory under /media and for the device under /dev is just a convention.)

It may turn out that you have, in fact, LVM volumes. If so, run pvs or pvdisplay to see a list of known LVM physical volumes (i.e. storage partitions). If the volumes you're looking for aren't listed, run pvscan and try again. LVM is an abstraction layer between storage volumes and content. Content is stored in logical volumes. To see a list of logical volumes, run lvs or lvdisplay. This will tell you the names of available logical volumes (LV) and the volume groups (VG) that they are in. To mount an LVM logical volume called mylv in the volume group called myvg, use

mount /dev/mapper/myvg-mylv /media/mylv

These complications are only necessary if the partitions do not directly contain filesystems. To mount a filesystem on a partition, you only need the mount command and an existing directory. With RAID and LVM volumes, everything is normally done automatically at boot time, but this doesn't take care of removable drives.

If the partitions contain filesystems, usbmount sets things up so that they're mounted automatically when the USB drive is inserted. I don't think it can handle RAID or LVM volumes however.

You may also be interested in pmount which allows mounting USB drives manually by non-root users.

Don't forget to unmount everything before unplugging the drive, otherwise data corruption is likely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.