2008 January 24

Gt5 du-browser

By WladyX on 24 January, 2008 | General | A comment?

Ubuntu GFX Grub

First remove your old grub

Code:

sudo apt-get remove grub

Then Install the gfxboot-grub

Code:

sudo dpkg -i grub-gfxboot_0.97-5_i386.deb

then we’re going to move the message

Code:

sudo cp message.suse /boot/grub/

replace .suse with the .whatever you downloaded.

THE MESSAGE FILE MUST BE OWNED BY ROOT USER/GROUP WITH CORRECT PERMISSIONS

Code:

sudo chown root:root /boot/grub/message.susesudo chmod 644 /boot/grub/message.suse

replace .suse with the .whatever you downloaded.

Then edit your menu.lst

Code:

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backupsudo gedit /boot/grub/menu.lst

and make it use gfxboot, write this as the very first line of the file and save it.

Code:

gfxmenu /boot/grub/message.suse

replace .suse with the .whatever you downloaded.

Then do :

Code:

sudo grub find /boot/grub/stage1

it’ll print out (hdx,y), so following that type:

Code:

root (hdx,y)setup (hdx)quit

if you have multiple (hdx,y) entries, work out which one is your
current OS partition and use that (note: grub counts from 0 onwards,
eg. hd0,0 is first harddrive, first partition, and it includes extended
partitions in it’s count).

NOW REBOOT. technically the above should have installed grub correctly,
if so then you can stop here. but for whatever reason for quite a few
people here it’s not, so on we go…

find out your hard drive names:

Code:

sudo fdisk -l

this helps with both the above and below. if you don’t know if
your OS’s partition is on hda, hdb, sda or anything else, then find out
using the above.

Install grub to MBR but CHANGE HDA to your OS’s drive, so if it’s on hdb use /dev/hdb:

Code:

sudo grub-install /dev/hda

DO NOT use any numbering in this,
using hda1 will install grub to the first partition not the mbr. if you
do this, follow this guide tellingly titled Oh crap, I just typed ‘grub-install /dev/hda1′.

you could use grub-install hd0 as with the grub setup command but this
is bios dependent and i dunno if you could mess it up by altering bios
settings inbetween things (and i don’t wanna find out either…).

and that should be it. restart and pray you didn’t mess up

http://ubuntuforums.org/showthread.php?t=208855&highlight=gfxgrub&page=56

By WladyX on | General, Ubuntu | A comment?

Quick LVM Guide

1.Load the LVM2 module:

# modprobe dm-mod

2. Activating LVM

# vgscan
Reading all physical volumes. This may take a while...
No volume groups found
(Make any previously set up volume groups available)
# vgchange -a y

3. Prepare the partitions:

# pvcreate /dev/hda4 /dev/hdb1
No physical volume label read from /dev/hda4
Physical volume "/dev/hda4" successfully created
No physical volume label read from /dev/hdb1
Physical volume "/dev/hdb1" successfully created

4. Create a volume:

(Create a volume group named vg)
# vgcreate vg /dev/hda4
/etc/lvm/backup: fsync failed: Invalid argument (Ignore this warning)
Volume group "vg" successfully created
(Extending an existing volume group)
# vgextend vg /dev/hdb1
/etc/lvm/backup: fsync failed: Invalid argument (Ignore this warning, again and later as well)
Volume group "vg" successfully extended

5. Create a logical volume:

# lvcreate -L10G -nusr vg
Logical volume "usr" created (Further similar messages not displayed)
# lvcreate -L5G -nhome vg
# lvcreate -L5G -nopt vg
# lvcreate -L10G -nvar vg
# lvcreate -L2G -ntmp vg
(As an example, let's extend a logical volume with 5 extra Gbytes)
# lvextend -L+5G /dev/vg/home

To create a 1500MB linear LV named ‘testlv’ and its block device special ‘/dev/testvg/testlv’:


# lvcreate -L1500 -ntestlv testvg
        

To create a 100 LE large logical volume with 2 stripes and stripe size 4 KB.

# lvcreate -i2 -I4 -l100 -nanothertestlv testvg

If you want to create an LV that uses the entire VG, use vgdisplay to find the “Total PE” size, then use that when running lvcreate.

# vgdisplay testvg | grep "Total PE"
Total PE              10230
# lvcreate -l 10230 testvg -n mylv

This will create an LV called mylv filling the testvg VG.

If you want the logical volume to be allocated from a specific physical volume in the volume group, specify the PV or PVs at the end of the lvcreate command line.

# lvcreate -L 1500 -ntestlv testvg /dev/sdg

6. Create filesystems:

# mke2fs -j /dev/vg/usr
# mke2fs -j /dev/vg/home
# mke2fs -j /dev/vg/opt
# mke2fs -j /dev/vg/var
# mke2fs -j /dev/vg/tmp

Other:

renaming a vg:

I did `lvchange -an` the logical volumes first, then `vgrename`, then `lvchange -ay` again.

http://www.gentoo.org/doc/en/lvm2.xml
http://tldp.org/HOWTO/LVM-HOWTO/
http://www.linuxquestions.org/questions/linux-general-1/how-to-rename-a-vol-group-433993/Â
By WladyX on | General, Gentoo | A comment?

UUID

Dupa cum destui dintre voi ati observat odata cu upgrade-ul la / instalarea Ubuntu 6.10 modul implicit de configurare a fisierului /etc/fstab (adica cel care contine o lista cu partitiile sistemului care se doresc a fi montate automat la pornirea sistemului ) s-a modificat un pic .

Astfel o linie care arata inainte ca :
Cod:

/dev/hda1 /               ext3    defaults,errors=remount-ro 0       1

Acum apare in forma urmatoare (ne avand si aceeasi valoare binenteles…) :
Cod:

UUID=9d0462b8-4038-483e-a43c-d814b8ac4f5e /               ext3    defaults,errors=remount-ro 0       1

Desi este o schimbare nu este tocmai o noutate faptul ca o partitie poate fi montata dupa UUID . E adevarat ca Ubuntu e una dintre putinele distributii care folosesc implicit acest mod de montare (nu mai stiu alta din pacate…) . Asta insa nu inseamna ca nu ati fi putut face montarea in acest mod folosind Ubuntu 6.06 sau o alta distributie linux. Pentru a intelege de ce va va ajuta sa stiti si ce este acel cod misterios.

UUID-ul (Universal Unique Identifier) este un cod cu lungimea de 128 de biti careare drept scop identificarea unui anumit “ceva” pastrand in acelasi timp un anumit grad de anonimitate. In cazul de fata acel ceva se intampla sa fie o partitie de tip ext3.

Anonimitatea este asigurata de numarul foarte mare de coduri unice si de modul de generare a lor. Cum sunt generate  exact nu are sens sa fie prezentat aici (si nici macar nu stiu cu exactitate) insa am inteles ca de obicei sunt bazate pe 3 componente : una fizica fixa (marimea partitiei s-ar incadra aici de exemplu) una temporala (partitia va primi un UUID in functie de data/ora la care este facuta formatarea) si cireasa de pe tort , una aleatorie .Si acum practic… Cat de multe lucruri stiti despre partitia/hard-discul meu din acel UUID ? tongue

Si acum de ce ? Care e sensul ? Pe langa faptul ca se poate este si folositor. Montarea folosind devece-ul de genul /dev/sda1′ are dezavantajul faptului ca la o mutare a hardiscului (de pe un cablu ata pe altul sau de pe master pe slave de exemplu) acea locatie va deveni invalida. Iar daca pe ea era un partitia root a unui linux atunci acesta nu va mai boota.

Montand partitia folosind UUID ne scuteste de acea problema, referirea facundu-se cu exactitate la o anumita partitie indiferent unde s-ar afla ea. Faprul ca majoritatea sistemelor de fisiere creeaza acel UUID la formatare de cativa ani buni a facut aceasta solutie una viabila.

Dezavantajul este ca e un pic mai greu de lucrat cu el. E usor sa tii minte ca hda1 e partitia root a linuxului insa nu se poate spune acelasi lucru si despre acel cod… Insa nimeni nu a spus ca trebuie sa-l tineti minte. Pentru a afla uuid-ul unei partitii puteti rula comanda “vol_id” astfel (aici pentru partitia hda1):
Cod:

thunderm@Zeus:~$ sudo vol_id /dev/hda1
Password:
ID_FS_USAGE=filesystem
ID_FS_TYPE=ext3
ID_FS_VERSION=1.0
ID_FS_UUID=9d0462b8-4038-483e-a43c-d814b8ac4f5e
ID_FS_LABEL=
ID_FS_LABEL_SAFE=

De asemenea puteti vedea si UUID-urile tuturor partitiilor ruland comanda
Cod:

ls /dev/disk/by-uuid -alh

Rezultatul va contine lista pe care o doriti avand UUID-ul scris cu albastru deschis adica ceva asemanator cu :
Cod:

thunderm@Zeus:~$ ls /dev/disk/by-uuid -alh
total 0
drwxr-xr-x 2 root root 160 2007-01-26 18:25 .
drwxr-xr-x 6 root root 120 2007-01-26 18:25 ..
lrwxrwxrwx 1 root root  10 2007-01-26 18:25 00FBAD1C33980F90 -> ../../hda6
lrwxrwxrwx 1 root root  10 2007-01-26 18:25 44e26abf-21ef-4998-b416-3af7154293cd -> ../../hda7
lrwxrwxrwx 1 root root  10 2007-01-26 18:25 7250EBA950EB7271 -> ../../hda5
lrwxrwxrwx 1 root root  10 2007-01-26 18:25 9d0462b8-4038-483e-a43c-d814b8ac4f5e -> ../../hda1
lrwxrwxrwx 1 root root  10 2007-01-26 18:25 C200916F00916AE5 -> ../../hda2
lrwxrwxrwx 1 root root  10 2007-01-26 18:25 F8D023D4D0239840 -> ../../hda8

Avand in vedere ca nu umblati toata ziua prin /etc/fstab nu cred ca este chiar atat de anevoios sa folositi UUID pentru montare. Daca este vorba de un hard-disc pe USB cu siguranta va veti multumi pentru efort mai tarziu tongue . La urma urmelor insa ramane la alegerea voastra ce sa folositi.

PS : se pot folosi si label-ul in cazul in care ati atribuit asa ceva partitiei. Pentru o partitie care are ca label ‘ubuntu’
veti scrie ceva asemanator cu
Cod:

LABEL=ubuntu /               ext3    defaults,errors=remount-ro 0       1

Putini insa sunt cei care definesc label-uri la partitii si chiar si mai putini cei care le folosesc pentru montare datorita faptului ca nu este o modalitate prea sigura.

By WladyX on | General, Ubuntu | A comment?