raid degraded started with ubuntu

fast command:
try with

 #mdadm -As /dev/md0 

if don’t start
 #mdadm --stop /dev/md0 
#mdadm --assemble --force /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 

good look

convert deb 32bit to 64 bit

I must remember how to conver deb package from 32 bit to 64 bit:
This are the steps
date i seguenti comandi

sudo fakeroot alien --to-tgz epson-alc1100-filter_1.2-1_i386.deb
sudo fakeroot alien --to-tgz epson-alc1100-filter-cups_1.2-1_i386.deb

and

sudo fakeroot alien --to-deb epson-alc1100-filter-1.2.tgz

sudo fakeroot alien --to-deb epson-alc1100-filter-cups-1.2.tgz

I need fakeroot and alien packages.

Install freedos on usb with ubuntu qemu firmware update

This are the steps:

install qemu for test usb disk

apt-get install qemu-kvm

Download freedos
wget http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/fdbasecd.iso

Format your key usb
sudo mkfs.msdos /dev/sdx1
sdx is your partition

Attention!!!
sudo qemu -boot d -m 512 -cdrom /path/fdbasecd.iso -hda /dev/sdx

sdx must be entire usb disk device

Press 1
Press 1
Choise your languages
Press 5 (Run FreeDOS from CD-ROM)
TYPE into DOS SHell
a:
sys c:
That’s all

Close Qemu Window
only 2 file must be into c: : command.com and kernel.sys

unplug the usb stick and plug in again
copy your firmware into usb drive

Bye

shrink o resize file system linux vmware machine – ridimensionare file system vmware

1) Turn on virtual machine
2) open bash and type this command
dd if=/dev/zero of=/empty_file; rm /empty_file
3) shutdown virtual machine
4) mv name_disk.vmdk name_disk-unshrinked.vmdk
5) vmware-vdiskmanager -r name_disk-unshrinked.vmdk -t 0 name_disk.vmdk
6) rm -f name_disk-unshrinked.vmdk

Original Link

clone virtual machine vmware server

I’ve Virtual Machine called “maps” and i want change into “mapsnew”

0) shutdown the virtual machine
For first i backup the directory :)
1) cp -arx maps/ maps.backup/
2) cd maps/
3) vmware-diskmanager -n maps.vmdk mapsnew.vmdk
4) i rename all file called maps into mapsnew
5) into configuration file mapsnew.vmx change all reference maps into mapsnew (this is possible use also sed command: sed -i ‘s/maps/mapsnew/g’ mapsnew.vmx

Bye…
Original Link

Split tar bz2 in dvd size


tar cvjf - directory/ | split -d -b 4G - filename.tar.bz2.

If you want to restore the file, first copy all te parts in one directory, and then type

cat filename.iso.tar.gz.* | tar xvzf -

howto openvpn ubuntu

install package openvpn

cp /usr/share/doc/openvpn/server.conf /etc/openvpn

cp /usr/share/doc/openvpn/examples/easy-rsa/2.0 /etc/openvpn

 cd /etc/openvpn/easy-rsa/2.0/

Vi vars and change
export KEY_COUNTRY=” “
export KEY_PROVINCE=”"
export KEY_CITY=” “
export KEY_ORG=”"
export KEY_EMAIL=”"

type the command

source ./vars

./clean-all

./build-ca

You will be asked to answer the questions you filled up top.

./build-key-server server

You will have to answer the same questions above. It will ask you for a password, I suggest you don’t put a password when it ask.

Click yes to sign the certificate.

Now to build the client files.

Type

./build-key client1

And once again you will need to answer the questions above. I still don’t recommend you putting a password as it can cause problems when I have tried.

Next you will want to type ./build-dh

cd /etc/openvpn/

vim server.conf 

and set correct path for keys
/etc/init.d/openvpn start

Bye

Howto Raid1 with LVM ubuntu

I’ve 2 disk 1T.
I partitioned the disk in this way:

fdisk /dev/sdx
x is letter of your disk (check it with command fdisk -l)
This is a sequence of command in fdisk
n
p
1
+500G
t
8e
… ecc … and in this way i created 3 partition primary and 3 partition in the extended area
500G 256G 124G 64G 32G 32G

Now i must clone the partition table in the second disk
sfdisk -d /dev/sdx | sfdisk /dev/sdy

I crete the device raid md0
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdx /dev/sdy
add the md0 in phisical lvm
pvcreate /dev/md0
group lvm
vgcreate backup-raid /dev/md0
logical volume
lvcreate -L+500G -n backupRaid backup-raid
format the new raid area
mkfs.ext4 -j /dev/backup-raid/backupRaid

Configure mdadm.conf
mdadm --detail --scan >> /etc/mdadm/mdadm.conf

Create a mount point
mkdir /media/backup
and modify /etc/fstab
/dev/mapper/backup--raid-backup--raid /media/backup ext4 rw 0 0

and now…
reboot for check if all this ok

Troubleshiting

Bye Bye
sorry for my english…
Feel free correct any word of this article… :) Bye

Create swap space with lvm (Creare swap con lvm)

This is a sequence of command that i use in “chimera” for create a swap space variable with lvm.
Turnoff swap area
swapoff -a
I prepare my swap space with lvm

fdisk /dev/sdx
(x is letter of your disk) … ecc ecc…
pvcreate /dev/sdxy (x is letter of your disk and y is number partition)
vgcreate swap /dev/sdxy
lvcreate -L+4G swap swap

now format partition

mkswap /dev/swap/swap

Turn on swap area
swapon -a

Check free memory swap
free -m

If the area swap not turn on i resolved in this way
I check the UUID for new swap area
blkid -c /dev/null | grep swap
Write in /etc/fstab the uuid mount the swap area

UUID=ff049cd2-b1a9-ff4a-9722-651b52beeda1 none swap sw 0 0

Write in /etc/initramfs-tools/conf.d/resume
RESUME=UUID=ff049cd2-b1a9-ff4a-9722-651b52beeda1

now
update-initramfs -u
and……
reboot

Bye bye bye
Sorry for my english…… You feel free for correct any word of this article.

controllare spazio disco directory

Comando magico bash per controllare quale directory occupa piu’ spazio all’interno del nostro hd:

du -sch *

« Voci più vecchie
Follow

Get every new post delivered to your Inbox.