Persistent USB HDD mount as samba share

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
RyanDietPi
Posts: 7
Joined: Fri Mar 03, 2017 2:08 am

Persistent USB HDD mount as samba share

Post by RyanDietPi »

Hi,

I have an external HDD connected to my dietpi.

Code: Select all

/dev/sda1       466G  447G   20G  96% /mnt/Voyager
Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1        2048 976769023 976766976 465.8G  7 HPFS/NTFS/exFAT
I have installed the Samba, but I want to know if I need ntfs-3g to edit /etc/fstab to make this permanent past reboot?
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Persistent USB HDD mount as samba share

Post by Fourdee »

RyanDietPi wrote:Hi,

I have an external HDD connected to my dietpi.

Code: Select all

/dev/sda1       466G  447G   20G  96% /mnt/Voyager
Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1        2048 976769023 976766976 465.8G  7 HPFS/NTFS/exFAT
I have installed the Samba, but I want to know if I need ntfs-3g to edit /etc/fstab to make this permanent past reboot?
Hi,

We would recommend using dietpi-drive_manager to attach, mount external drives. Although, /etc/fstab is also fine.

If you want the Samba Server to point to the USB drive, and, you used dietpi-drive_manager to setup the USB drive, use dietpi-drive_manager or dietpi-software to move your DietPi user data, from SD to USB drive. Samba will then point to USB drive.
http://dietpi.com/phpbb/viewtopic.php?f=8&t=478#p2087

Or edit /etc/samba/smb.conf and change path = /mnt/dietpi_userdata accordingly.

ntfs-3g is installed by default.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
RyanDietPi
Posts: 7
Joined: Fri Mar 03, 2017 2:08 am

Re: Persistent USB HDD mount as samba share

Post by RyanDietPi »

OK!

I did this. This absolutely works.

Only question I have now is that the mount is now the UUID. Is there anyway to change that to a "familiar name"?
RyanDietPi
Posts: 7
Joined: Fri Mar 03, 2017 2:08 am

Re: Persistent USB HDD mount as samba share

Post by RyanDietPi »

This is so cool. It works so well.
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Persistent USB HDD mount as samba share

Post by Fourdee »

RyanDietPi wrote:OK!

I did this. This absolutely works.

Only question I have now is that the mount is now the UUID. Is there anyway to change that to a "familiar name"?
Not within DietPi currently, you'd need to edit this manually in /etc/fstab.

If you do the manual edit, you will also need to replace the symlink for /mnt/dietpi_userdata and point it to the new mount location, else, Samba server location will point to nowhere (rootfs).

You can get the current symlink status with:

Code: Select all

readlink /mnt/dietpi_userdata
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Post Reply