Sometimes its a big problem to install OS on hdd’s after hardware raid. Because hdd contains RAID metadata and OS can’t be installed.
To remove RAID metadata, do following:
dd if=/dev/zero of=/dev/sda bs=512 count=20
– removing first 20 sectors of the drive
then check number of sectors via command fdisk -s /dev/sda
dd if=/dev/zero of=/dev/sda seek=(number_of_sectors – 20) bs=1k
– removing last 20 sectors of the drive
or
dd if=/dev/zero of=/dev/sda seek=$(( $(fdisk -s /dev/sda) -20)) bs=1k
Do this on all drives with RAID metadata
My server is dead now and I have 2 HDD drives with LVM on them. So I’ve decided to add these drives into another server, so I’ll be able to get data.
So what I’m going to do?
1. You need to add your drives into your server, and reboot it (if you have hot-swap HDDs, no reboot is required).
2. Your system should find those HDDs, check yourself:
fdisk -l
There should be few drives to be sure you see your new drives you can compare serials on the HDD side and via:
hdparm -i /dev/sd*
or
hdparm -i /dev/hd*
or
hdparm -i /dev/your_drive_name
(usually its sda hda, anyway correct name you can see in result of fdisk -l
)
3. Now you need to check, if your system can see your LVM Volume Groups:
vgscan
vgdisplay
Example of my one:
— Volume group —
VG Name vgdisk4
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 931,51 GB
PE Size 4,00 MB
Total PE 238466
Alloc PE / Size 238080 / 930,00 GB
Free PE / Size 386 / 1,51 GB
VG UUID 1yehuY-dAfQ-Ki2r-reMY-P33U-vlJg-Jyug7u
How to setup Django on the server with CPanel control panel. CPanel uses Python 2.4, but Django requires PHP mod_wsgi, which requires Python 2.6+.
We need to install 2 Python versions.
cd /usr/local/src/
wget http://www.python.org/ftp/python/2.6/Python-2.6.tgz
tar -xvzf Python-2.6.tgz
./configure --enable-shared
make install
cd /etc/ld.so.conf.d
echo "/etc/ld.so.conf.d/opt-local.conf" > python26.conf
ldconfig
Now Now you’re ready to build mod_wsgi through easy_apache. Download custom_opt_mod-mod_wsgi.tar.gz from this ticket at google code and run:
More »