NOTE THE WINDOWS BOX IS JOINED TO THE DOMAIN BUT NOT THE LINUX BOX, THIS MAKES NO DIFFERENCE BESIDES THAT I CANT LOG IN WITH GUEST CREDENTIALS (no user no password) SINCE DOMAINS DONT HAVE GUEST USERS (BY DEFAULT) SO I HAD TO MAKE A SAMBA USER
(step1)
Add the SATA disk to your system ( I added an 8 gb disk, because Im using a VM, but thats just extra unimportant information)
reboot or scan for disks so the system will recognize your new SATA disk
What to do?
First you need to find out how many host folders you have with the command: “ls /sys/class/scsi_host/” and it will show you all the scsi hosts. For me It shows “host0” and “host1” so that means I need to run the following command for each host.
So I will run the following command, this is the general form – where you see # is the host number:
# echo “- – -” > /sys/class/scsi_host/host#/scan
What I Did?
So since
# ls /sys/class/scsi_host
returns
host0 and host1
So to scan for disks
echo “- – -” > /sys/class/scsi_host/host0/scan
echo “- – -” > /sys/class/scsi_host/host1/scan
Why scan or reboot?
When you add a new disk to a system, the system will not awknoledge it till you reboot or scan the scsi hosts. After rebooting and or scanning the scsi hosts:
cat /proc/partitions will now show you the new added disk most likely as sdb (if you only had one disk before.)
see the name of the new disk
# cat /proc/partitions
(step4)
partition the disk that you see is new in my case I saw i had a new /dev/sdb
# cfdisk /dev/sdb
I partitioned 2 partitions 1gb and 7gb. Both just as primary partitions, but not as bootable partitions since im not going be booting from them. The first partition I made of the type “linux swap”, the second partition I left as default “linux”. 1 gb for swap and 7 gb for btrfs (sidenote “mkswap /dev/sdb1” and then “swapon /dev/sdb1” to make swap work)
# apt-get install btrfs-tools
# mkfs.btrfs /dev/sdb2
# mkdir /vol
# mount /dev/sdb2 /vol
/dev/sdb2 /vol btrfs defaults 0 0
# apt-get install samba
# vim /etc/samba/smb.conf
In [global] section unhash “# security = user” so it doesnt have # in front of it and simply reads:
path = /vol/
writable = yes
guest ok = yes
browsable = yes
(step 11)
# /etc/init.d/samba reload
(step 12)
# adduser samba1
I gave it the password 12345678
(step 13)
Add user to samba user list
# smbpasswd -a samba1
(step 14)
If you want to be able to write – either way make sure the UNIX/POSIX permissions are all access
# chmod 777 -R /vol
(step 15)
On windows open cmd and type
net use Q: \\172.20.18.201\vol
feed the username: samba1 and password: 12345678
HOW MY SMB.CONF LOOKS LIKE
usually I would “grep ^[^#] smb.conf” but they also have ; for comments need to add “\;” into the “[]” class section of the regular expression
This next command removes blank lines, comments that start with # and comments that start with ;
# grep ^[^#\;] smb.conf
server string = %h server
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
security = user
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
[vol] comment = btrfs
path = /vol/
writable = yes
guest ok = yes
browsable = yes