adding external storage

I wanted to use the ASRock ION as a network file storage as well (besides from being a Mythtv Back and Frondend. The internal HD is limited to 320Gbyte. So I bought a LaCie Petit Hard Disk of 500GB. This is a 2.5" drive that gets its power through the USB socket. No adapter needed, and it has a low power consumption.

Fist I formatted the full HD as ext3 (the LaCie comes with multiple partitions and some data I don't need). I've labeld the drive "LaCie500GB".
Then created a mount point:
# mkdir /extdata
and added a line to /etc/fstab
LABEL=LaCie500GB /extdata  ext3    defaults        0       2

The drive was mounted by Mythbuntu when plugged in so unmount it first:
root@asrock:~# mount
/dev/sda5 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
/dev/sda1 on /boot type ext3 (rw)
/dev/sda4 on /data type ext4 (rw)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
/dev/sdb1 on /media/LaCie500GB type ext3 (rw,nosuid,nodev,uhelper=hal)

# umount /dev/sdb1
# mount -a

The drive is now ready to use and after a reboot will always be on the same location (/extdata)

nfs modifications:
# sudo vi /etc/exports
add the export for example: /extdata,async,no_root_squash,no_subtree_check)
if nfs is already running: reread /etc/exports
# sudo exportfs -ra

The NFS share can be mount from another Linux system by adding this to you /etc/fstab /extdata nfs defaults 0 0

On the remote machine, do a 'mount -a' or reboot the system to mount the files from the ASRock system.

samba modifications:
# vi /etc/samba/smb.conf

comment = ASRock Data
path = /extdata
browsable = yes
read only = no
writable = yes
force user = <fill in Linux username>

On a remote Linux machine add this to you /etc/fstab:
// /extdata cifs credentials=/root/credentials_data,dir_mode=0775,gid=<group name>,uid=<username> 0 0

The /root/credentials_data looks like this:

WARNING: don't insert spaces around the =
Make sure the file can be only read by root because the password is readable.

One of the functions of my ASRock was to be a backup location of my Internet Site Backup

OF course I setup my firewall to only allow port access from a specific IP-address (my webserver).
But to be extra save, I didn't want to use FTP (and send the userid and password in plain text over the Internet).

Using scp or sftp the passwords are encrypted but you get shell access as well! This is a real security issue. So I've setup scponlyc.
This package will give the user access to an isolated location on the server.

First install the package:
# apt-get install scponly
# cd /usr/share/doc/scponly/setup_chroot
# gunzip
# chmod +x
# ./
follow the instructions on the screen.

The installation didn't set the SUID-Bit for scponlyc
# chmod u+s /usr/sbin/scponlyc

     RSS of this page