Jeremys Linux Blog | don't take this blog for gospel. I'm a linux newbie!

CAT | disk

Karmic Koala instructions for installing and configuring Samba on my Server

1. I installed Samba

sudo apt-get install samba samba-tools system-config-samba

2. I created a backup of the original Samba configuration

cd /etc

cd samba

sudo mv smb.conf  smb.conf.old

3. Create a new smb.conf

sudo nano /etc/samba/smb.conf

4. I typed the following config file thanks to help from http://samba.netfirms.com/index.htm

#Global parameters

workgroup = WORKGROUP
netbios name = server
encrypt passwords = yes

[homes]
read only = no
browseable = no

[backup]
path = /mnt/raid/backup
browseable = yes
write list = jeremy
invalid users = mediaservice

[downloaded]
path = /mnt/raid/downloaded
write list = jeremy
invalid users = mediaservice

[downloading]
path = /mnt/raid/downloading
browseable = yes
write list = jeremy
invalid users = mediaservice

[high def movies]
path = /mnt/raid/high def movies
browseable = yes
write list = jeremy

[movies]
path = /mnt/raid/movies
browseable = yes
write list = jeremy

[music]
path = /mnt/raid/music
browseable = yes
write list = jeremy

[music dvd]
path = /mnt/raid/music dvd
browseable = yes
write list = jeremy

[netsys]
path = /mnt/raid/netsys
browseable = yes
write list = jeremy
#invalid users = mediaservice

[scratch]
path = /mnt/raid/scratch
public = yes
browseable = yes

[software]
path = /mnt/raid/software
browseable = yes
write list = jeremy

[sysnet]
path = /mnt/raid/sysnet
browseable = yes
write list = jeremy
#invalid users = mediaservice

[tv]
path = /mnt/raid/tv
browseable = yes
write list = jeremy

[watch]
path = /mnt/raid/watch
browseable = yes
write list = jeremy
invalid users = mediaservice

[wing chun]
path = /mnt/raid/wing chun
browseable = yes
write list = jeremy

5. I created a new user account called mediaservice (as mentioned above)

sudo useradd -d /home/mediaservice -s /bin/false -N mediaservice

sudo passwd mediaservice

*************

*************

sudo smbpasswd -a mediaservice

*************

*************

6. I set a samba password for my own account

sudo smbpasswd -a Jeremy

*************

*************

5. I restarted samba

sudo /etc/init.d/samba restart

5. I set permissions on the files

sudo nautilus

via nautilus I navigated to /mnt/raid and right clicked and selected permissions

Owner -> Root, Create and Delete Files

Group -> Users, Create and Delete Files

Others -> Create and Delete Files

5. I tested from a windows workstation

\\192.168.0.200

, , ,

Karmic Koala instructions for reassembling my RAID 5 software array on my Server after reinstalling the OS

I didn’t learn to do this by choice! I mucked up my video configuraiton and couldn’t boot into the gnome… after spending about 4 or 5 hours trying to fix it; I “bit the bullet” and reinstalled ubuntu.

1. I installed mdadm

sudo apt-get install mdadm

2. I (re) assembled the array

sudo mdadm –assemble /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1

3. I got the details of the array

sudo mdadm –detail –scan

Output on this occasion was as follows; do not copy and paste this directly – it will be a different UUID for future arrays I create

ARRAY /dev/md0 level=raid5 num-devices=6 metadata=00.90 UUID=58155936:66553965:01f9e43d:ac30fbff

I found out later that I needed to remove one of the zeroes from the metadata version… when I did a sudo mdadm -D it gave me an error for the version information.

ARRAY /dev/md0 level=raid5 num-devices=6 metadata=0.90 UUID=58155936:66553965:01f9e43d:ac30fbff

4. I copied and pasted the above line into mdadm.conf

sudo nano /etc/mdadm.conf

File now has the following entry:

# definitions of existing MD arrays

ARRAY /dev/md0 level=raid5 num-devices=6 metadata=0.90 UUID=58155936:66553965:01f9e43d:ac30fbff

5. I created somewhere for the array to be mounted

cd /mnt

sudo mkdir raid

6. I wanted the drive to be mounted automaticaly on startup

sudo nano /etc/fstab

7. I added the following line

/dev/md0                /mnt/raid                ext3                defaults                0                0

8. I mounted all arrays without rebooting

sudo mount -a

, , , , , , ,

Karmic Koala instructions for creating the RAID 5 Software array on my Server

Originaly found here http://www.jamierf.co.uk/2009/11/04/software-raid-5-using-mdadm-in-ubuntu-9-10/ but stored on my blog for reference incase their blog dies one day.

1. I installed mdadm

sudo apt-get install mdadm

2. I listed all the drives

sudo fdisk -l

3. I edited each drive that was to be part of the array, for me my system drive and spare drive was /dev/sdg and /dev/sdh respectively

sudo fdisk /dev/sda (but I also did this for the other drives in the array) /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf

4. I edited each drive that was to be part of the array, for me my system drive and spare drive was /dev/sdg and /dev/sdh respectively so obviously I didn’t touch them

n (for new drive)

p (for primary partition

1 (for partition 1)

enter (to select first cylinder

enter (to select last cylinder)

t (to set disk type)

1 (for partition 1)

fd (for Linux Raid Autodetect)

w (to write changes to disk)

5. I created the array

sudo mdadm –create –verbose /dev/md0 –level=5 –raid-devices=6 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1

6. I watched the progress

sudo mdadm -D /dev/md0

7. I got the details of the array

sudo mdadm –detail –scan

Output on this occasion was as follows; do not copy and paste this directly – it will be a different UUID for future arrays I create

ARRAY /dev/md0 level=raid5 num-devices=6 metadata=00.90 UUID=58155936:66553965:01f9e43d:ac30fbff

found out later that I needed to remove one of the zeroes from the metadata version… when I did a sudo mdadm -D it gave me an error for the version information.

ARRAY /dev/md0 level=raid5 num-devices=6 metadata=0.90 UUID=58155936:66553965:01f9e43d:ac30fbff

8. I copied and pasted the above line into mdadm.conf

sudo nano /etc/mdadm.conf

File now has the following entry:

# definitions of existing MD arrays

ARRAY /dev/md0 level=raid5 num-devices=6 metadata=0.90 UUID=58155936:66553965:01f9e43d:ac30fbff

9. I created the file system

sudo mkfs.ext3 /dev/md0

10. I removed the default 5% reserved space from the drive

sudo tune2fs -m 0 /dev/md0

11. I created somewhere for the array to be mounted

cd /mnt

sudo mkdir raid

12. I wanted the drive to be mounted automaticaly on startup

sudo nano /etc/fstab

13. I added the following line

/dev/md0                /mnt/raid                ext3                defaults                0                0

14. I mounted all arrays without rebooting

sudo mount -a

sudo fdisk -l

, , , ,

Find it!

Theme Design by devolux.org