Italian - ItalyEnglish (United Kingdom)
Appunti GNU/Linux
There are no translations available.

GRUB BOOTLOADER

To modify grub the file is /boot/grub/menu.lst
You'd better to do a backup before put your hands on it!
# cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
# nano /boot/grub/menu.lst

to add my Windows partition:

this doesn't work on my pc but it could be useful for someone or in other cases
# title Microsoft Windows
# root (hd0,0)
# savedefault
# makeactive
# chainloader +1

another option could be...
# title Microsoft Windows
# map (hd0) (hd2)
# map (hd2) (hd0)
# chainloader (hd2,0)+1


MOUNTING NTFS partitions..

About NTFS partitions
manual mounting is (you need ntfs-3g module)
# mount -t ntfs-3g /dev/sda5 /media/test

or automatically edit /etc/fstab
/dev/sda5 /media/test ntfs-3g defaults,locale=it_IT.UTF-8 0 0


MOUNT USING SAMBA..

# smbmount //servername/sharename /mountdirectory -o username=mywindowsusername,password=mywindowspassword
or
# mount -t smbfs //server/NTFS /media/test -o username=ciesko,password=******
or
# mount -t smbfs -o umask=2 -o dmask=777 -o umask=777 -o username=Ciesko,password=**** //172.16.1.199/HDD_1_1_1 /media/NSLU2


MOUNT USING CIFS..

# mount -t cifs -o user=<user-name> //<server-name>/<root-share-name> <mount-point>
or
# mount -t cifs -o ip=172.16.1.199,rw //NSLU2/DISK%201 /media/NSLU2
or
# mount -t cifs -o username=Ciesko,password=******,rw //172.16.1.199/folder /home/Ciesko/Scrivania/MEDIA
or
# mount -o username=Ciesko,password=****//172.16.1.199/HDD_1_1_1 /home/Ciesko/Scrivania/MEDIA
or
# mount -o umask=2 -o dmask=777 -o umask=777 -o username=Ciesko,password=**** //server/Posta /media/posta

 

NFS...

Server side:

If you want to share your folder using NFS you need portmap and nfs-server once you've them edit \etc\exports the configuration could be similar like this

# /share/hdd/data/public 172.16.0.0/255.255.0.0(rw,sync,all_squash,anonuid=0)

/share/hdd/data/public = the folder I wanna share
172.16.0.0/255.255.0.0 = which hosts I wanna share with (in this case all the hosts 172.16.X.X)
(rw,sync,all_squash,anonuid=0) = with these options everybody can read and write in this share

Client side:

You need portmap and nfs-client, then first try if it works manually

# mount -o vers=3,tcp,sync,nolock,intr,hard,rw 172.16.1.199:/share/hdd/data/public /media/NSLU2

if it works edit the file \etc\fstab to mount your shared forders

# 172.16.1.199:/share/hdd/data/public /media/NSLU2 nfs vers=3,tcp,sync,nolock,intr,hard,rw 0 0

172.16.1.199 = the ip of your server
/share/hdd/data/public = the folder shared by your server
/media/NSLU2 = the client's folder you'll mount the server-shared folder
nfs vers=3 = which nfs version are you using
tcp,sync,nolock,intr,hard,rw 0 0 = these options allow you to read and write on the shared folder..


SYMBOLICS LINKS

If you wanna create a shortcut Linux call them Symbolic links

# ln -s /mnt/<name-of-mount-point> /<path-of-symlink>

here some examples...

$ ln -s /media/Dati_DVD_Divx/ /home/Ciesko/Scrivania/Dati_DVD_Divx
or
$ ln -s smb://nslu2 //home/Ciesko/Scrivania/NSLU2


SAMBA

install samba
#apt-get install samba

add new user
#useradd ciesko

set pwd for the user (note: it can be different from linux user pwd)

#smbpasswd -a ciesko
edit /etc/ini.t/smb.conf

Then you need to edit /etc/samba/smb.conf for sharing configs
# Set your server basic options

[global]
workgroup = debian
netbios name = debianserver
server string = %h server (Samba %v)
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
security = share

# Example for a common directory

[common]
comment= Common Dir
path= /home/common
guest ok= yes
valid users = %S
read only= no
browseable= yes

# Example for a user directory

[ciesko]
comment= Directory home/ciesko
path= /home/ciesko
guest ok= no
read only= no
force user= ciesko


TIPS 'n TRICKS

Find something
# find / -name 'filename'

Wanna untar a tar.gz or a .tgz?
# tar zxvf <filename.tgz / filename.tar.gz>

The estension is just .gz?
# gunzip <filename.gz>

Check the free space of your disk
# df

Check the free space of your partitions
# du -sh *

Or if I wanna check the space used by some some subfolders I have just enter on the main folder and use the same command

EG:
# cd home
/home # du -sh *
23.4M ciesko
576.0k pinco


 

 

Online

We have 1 guest online

Domande?

Contattami tramite skype cliccando sul bottone sottostante

My state