External Storage AR750S-EXT - (Slate)

Ok new to all this Unix/Linux stuff. Trying to work out external storage nomenclature.

Hokay, played with a bit so original issue gone. Now understand what the situation is.

sda2 is a “leftover” drive from when I first put in an SD-Card with two partitions on it. I have reformatted the card into a single partition and as such should only have sda1 but sda2 is a leftover.

How do I remove this “device” sda 2 that doesn’t exist anymore?

Additionally is there any way I can put some “security” on the drive rather than just read/write access. Can I protect with a username/password ? Do I need to add additional packages to support SAMBA…?

You can modify the file /etc/config/samba, and then restart samba via /etc/init.d/samba.

Dependency Packages

# opkg update
# opkg install shadow-useradd

Create an Non-Root User

# useradd samba
# passwd samba

It will prompt enter a password. You just need to set your password.

Create a samba user

# smbpasswd -a samba

The same as above step, it will prompt enter a password.

User level access

To set user level access change security = share to security = user in /etc/samba/smb.conf.template.

Samba configuration

You should plug in your storage device into router. It will generate a share configuration for samba.

Then disable guest access as follow:

# uci set samba.@sambashare[0].guest_ok='no'
# uci commit samba
# /etc/init.d/samba restart

All things done, there is require username and password for file sharing, but it doesn’t work once router reboot. We have to change the file /etc/hotplug.d/block/50-samba line “uci delete samba.@sambashare[$i]” to “exit”. The code as follow.

if [ ! -e "$sharepath" -o "$d" = "$label" ]
then
    # uci delete samba.@sambashare[$i]
    exit                                                           
fi