LVM on Fedora / Red Hat
Posted by Luis Gallardo in Linux on 26/01/2012
Link to the video http://blip.tv/lgallardo/lvm-on-fedora-red-hat-5908557
On this video you can see the installing process using a LVM on Fedora (it’s also valid on Red Hat). As a side note, the directory that must be outside the LVM is /boot, altoogh I said it was the file system’s root directory /, which also includes /boot.
If you don’t understand some of the LVM terms, you can check out the previous article about basic LVM concepts and some commands to manage a LVM by hand.
How to install firmware 3.40 on PS3
Posted by Luis Gallardo in PS3 on 25/01/2012
If you have a PS3 with firmwares lower than 3.40 and you want to update to this firmware, here I leave the directions for upgrading your PS3 to firmware 3.40:
- Download firmware 3.40.
- Copy 340.PUP file to /PS3/UPDATE folder. Create any folder if necessary.
- Rename 340.PUP file to PS3UPDAT.PUP.
- Unplug the pendrive nicely from the PC, and connect it to the PS3.
- Go to System Update and select Update via Storage Media.
- Accept the license agreement and follow the installing directions.
Reference: [Recopilación] Firmwares Oficiales PS3 (in Spanish)
PlayStation Vita (PSVita)
Posted by Luis Gallardo in PSVita on 20/01/2012
Sony lanzó en Japón la nueva consola portátil PS Vita (prefirió no llamarla PSP 2) y en USA el lanzamiento será el 15 de febrero para quienes compren el First Edition Bundle especial o el 22 de febrero para quienes elijan otro pack. La PS Vita se ve muy atractiva y superior a cualquier consola portátil del mercado (si me refiero a los NDS/N3DS).Veamos las especificaciones técnicas para hacernos una idea:
Sony has released its new portable console PS Vita (PSP 2 was not chose) and it will be released on February 15th for those who had bought the special First Edition Bundle or February 22th for those who don’t. The PS Vita is really attractive and even superior than any portable console on the market (yes, I’m referring to the NDS/N3DS). Let’s see the technical specs to make an opinion:
Making room on external disks with tune2fs
Posted by Luis Gallardo in Linux on 15/01/2012
Referencia: man tune2fs
I bought an external USB disk of 1.5 TB (1.3 TB), and I decided to use 1 TB as ext4 partition. I used GParted for creating the partition and it doesn’t give “advanced” options, therefore I just accepted the default values. But then I remembered that on ext2, ext3 and ext4 partitions 5% is reserved for avoiding it fill up completely, so some privileged processes always have space to write (for example, syslogd), which otherwise it will compromise the service’s operativeness or even the system.
Making some room
Due to is a 1TB partition for backups, having 5% reserved will mean about 50 GB. Let’s see the available space on disk:
root@moody:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/sdb2 1.1T 430G 557G 44% /media/1TB
The command’s output was edited to show only the partition of interest. Now let’s remove the reserved percentage:
root@moody:~# umount /media/1TB root@moody:~# tune2fs -m 0 /dev/sdb2 tune2fs 1.41.12 (17-May-2010) Setting reserved blocks percentage to 0% (0 blocks)
Be aware tune2fs must run on unmounted filesystems. Let’s check the available space on the partition one more time:
root@moody:~# mount /media/1TB root@moody:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/sdb2 1.1T 430G 610G 42% /media/1TB
In this case, 610 GB – 557 GB = 53 GB extra space that now I have available…bad? Not at all!
Reference: man tune2fs
Repairing tables on MySQL
Posted by Luis Gallardo in Programming on 12/01/2012
If for any reason you come across next message when querying a table:
mysql> select * from data_values_queued; ERROR 1194 (HY000): Table 'data_values_queued' is marked as crashed and should be repaired
You can fix this problem as follow.
CHECK TABLE
First, proceed to check the table to determine the problem:
mysql> check table data_values_queued; +----------------------------+-------+----------+----------------------------------------------------------+ | Table | Op | Msg_type | Msg_text | +----------------------------+-------+----------+----------------------------------------------------------+ | datbas1.data_values_queued | check | warning | 4 clients are using or haven't closed the table properly | | datbas1.data_values_queued | check | error | Size of datafile is: 4200 Should be: 4220 | | datbas1.data_values_queued | check | error | Corrupt | +----------------------------+-------+----------+----------------------------------------------------------+ 3 rows in set (0.05 sec)
Here you can see the table wasn’t closed properly, for instance due to a abrupt shutdown. In my case a discard the first message because I’m using InnoDB as engine, which allows concurrency on tables.
REPAIR TABLE
Now for repairing the table you can use the following sentence:
mysql> repair table data_values_queued ; +----------------------------+--------+----------+----------------------------------------+ | Table | Op | Msg_type | Msg_text | +----------------------------+--------+----------+----------------------------------------+ | datbas1.data_values_queued | repair | warning | Number of rows changed from 144 to 143 | | datbas1.data_values_queued | repair | status | OK | +----------------------------+--------+----------+----------------------------------------+ 2 rows in set (0.00 sec)
With this you will have repaired the table . Let’s check it:
mysql> select * from data_values_queued; +---------+--------+----------+---------------------+ | id | iodbId | value | timestamp | +---------+--------+----------+---------------------+ | 1476194 | 170 | 297 | 2012-01-11 08:40:45 | | 1476193 | 170 | 296 | 2012-01-11 08:40:17 | | 1476176 | 71 | 11692 | 2012-01-11 05:06:46 | | 1476177 | 72 | 12061 | 2012-01-11 05:06:46 | | 1476178 | 73 | 11820 | 2012-01-11 05:06:46 | | 1476179 | 107 | 11703 | 2012-01-11 05:06:46 |
...
| 1476258 | 170 | 282 | 2012-01-11 11:07:43 | +---------+--------+----------+---------------------+ 143 rows in set (0.00 sec)
References
How to hack a PSP (all models)
Posted by Luis Gallardo in PSP on 03/01/2012

There are several PSP models and for each one you must use a different method for hacking it that might not be compatible with oter model. To avoid problems with the upgrades I decided to sumarize this information in this post:
| Modelo | Firmware 5.00 | Firmware 6.20 | Firmware 6.35 | Firmware 6.60 |
| PSP 1000 (FAT)PSP 2000 (Slim liberables) |
|
|||
| PSP 2000 (Slim NO liberables) | - | |||
| PSP 3000 | ||||
| PSP Go | ||||
| PSP E100 |
Note: You must take into account that on PSP 3000, PSP Go and PSP E1000 there isn’t a custom firmware permanent for firmware higher to 6.20, hence you must repeat the procedure every time you turn off the console.
Downgrading
If you need to downgrade a version there are three methods that depends on the PSP model you have:
| Model | Firmware < 6.20 | Firmware 6.20 | Firmware 6.35 | Firmware 6.60 |
| PSP 1000 (FAT)PSP 2000 (Slim liberables) | ||||
| PSP 2000 (Slim NO liberables) | - | |||
| PSP 3000 | ||||
| PSP Go | ||||
| PSP E1000 | ||||
Side note: Take into account that on PSP 3000, PSP Go and PSP E1000 there isn’t a method for downloading a PSP.
PSP 2000 vs. 2001 vs. 2010
If you doubt about the PSP model you have, check this article that talks about the PSP versions.
References
- [Tabla] Libera tu PSP (in Spanish)
- Ten tu PSP a la última (in Spanish)
Setting ViewSonic G800 on Debian 6.0
Posted by Luis Gallardo in Linux on 17/12/2011
Some coworkers decided to install Debian on a PC with a ViewSonic G800 monitor and a ATI Technologies Inc Rage XL graphic card, but the best resolution they could get was 800×600. After checking out the X serverr’s drivers, which were installed correctly for the ATI card, and try some drivers variants (r128, radeon,k etc), I asked the monitor’s settings to the person who installed the system, and he said he didn’t know them or the manual’s whereabouts. By searching on the net I came across with the manual in the manufacturer’s web page, of particular interest is the table with the refresh parameters:
With this information I proceeded to created the X server configuration file, I mean, the /etc/X11/xorg.conffile:
Section "Device" Identifier "Configured Video Device" Driver "ati" EndSection Section "Monitor" Identifier "Configured Monitor" HorizSync 60.02 VertRefresh 75 EndSection Section "Screen" Identifier "Default Screen" Monitor "Configured Monitor" Device "Configured Video Device" EndSection
The monitor’s manual can be downloaded on the manufacturer’s web page, but you must enter the monitor code. If you don’t have it, here you have the manual in PDF.
References:
- Manual PDF ViewSonic G800 (PDF)
- ViewSonic User Guides
- man ati
How to root Samsung Galaxy Ace
Posted by Luis Gallardo in Android on 03/12/2011
Muchas aplicaciones necesitan que el teléfono este “rooteado”, es decir, que tenga privilegios de root o el administrador del sistema en Linux (hay que recordar que Android es Linux). Aunque suene complicado, realmente no lo es, es simplemente instalar una aplicación en el teléfono que permite conceder mayor privilegio a otras aplicaciones para, por ejemplo, poder acceder a la cámara. Dicho esto, ahora dejo los pasos para hacerlo en el Samsung Galaxy Ace S5830 / S5830L
Advertencias
- Recuerda que solo tú eres responsable de lo que haces con tu teléfono. Aunque este método lo seguí y lo comparto, no me hago responsable por bricks en tu teléfono.
- Realiza el procedimiento con la batería cargada a más de 75%.
- Válido solo para Gingerbread 2.3.3 / 2.3.4 / 2.3.5 (revisa la versión en Configuración > Acerca del teléfono > Versión de Android)
Instalación
- Descarga y copia en la raíz de la tarjeta SD del teléfono los archivos udp_1.zip y AceGingerRoot.zip
- Apaga el teléfono y enciéndelo en modo recovery (presionando la tecla del centro y el botón de encendido al mismo tiempo por algunos segundos)
- En el recovery, selecciona la opción Update from SD Card.
- Si la versión de Android es la 2.3.3 selecciona el archivo upd_1.zip. Si es la versión 2.3.4. escoge el archivo AceGingerRoo.zip.
- Una vez que haya terminado el proceso e indique “Install from sdcard complete”(ver segunda arriba), reinicia el teléfono con la opción Reboot in normal mode.
¿Cómo funciona?
Ahora tienes el teléfono rooteado. Es decir, si una aplicación requiere permisos de root, verás una imagen como la tercera mostrada arriba que te indicará si deseas aceptar o no. De igual forma puedes acceder a la aplicación de superusuario para que veas los programas a los cuales les has concedido permisos , y si lo deseas revocarlos.
Referencia: [How to] Root Samsung Galaxy Ace on Android 2.3.4 XXKPH Gingerbread Firmware
Many applications need the phone being “rooted”, I mean, that it has root or Linux’s system administrator permissions (take in account Android is Linux). Although it sounds complicated, it is not, you will install an application that grants permissions to other applications to be able to, for instance, use the camera. Now that it was clarified, here I leave the needed steps for roting a Samsung Galaxy Ace S5830 / S5830L.
Warnings
- Remember that only you are responsible of what you do to your phone. Although I followed this method, I won’t take responsibility if you brick your phone.
- Do this procedure with at least 75% of battery charge.
- This only works on Gingerbread 2.3.3 / 2.3.4 / 2.3.5 (check your phone’s version in Settings > About phone > Android version)
Installing
- Download and copy to the phone’s SD card this files udp_1.zip and AceGingerRoot.zip
- Turn off your phone and turn it on in the recovery mode (by holding down Middle key and press power on key at the same time for few secs)
- In the recovery, select Update from SD Card option.
- If you have android version 2.3.3 choose upd_1.zip. If your version is 2.3.4 choose AceGingerRoo.zip.
- Once it finishes and indicates “Install from sdcard complete”(look the second image above), reboot the phone by choosing the Reboot in normal mode option,.
How it works
Now your phone is rooted. So, if an application requires root permissions, you will see a screen like the third shown above that will ask you if you concede it or not. You can also see all programs you have conceded root permissions from by launching the super root application, and revoke the permission if you wish.
Reference: [How to] Root Samsung Galaxy Ace on Android 2.3.4 XXKPH Gingerbread Firmware
Error installing Gnome-Shell on Debian (Failed to load session “gnome”)
Posted by Luis Gallardo in Linux on 24/11/2011

A couple of friends insisted me in installing Gnome-Shell, so I installed it to see how good it is and because I didn’t want to feel excluded. I had to upgrade my Debian from stable to testing and install gnome-shell by typing:
aptitude install gdm3 gnome-shell
After upgrading, I rebooted the PC and tried to log in to Gnome’s session, but I got the error Failed to load session “gnome” as shown in the above picture. After commenting this to one of my friends he said it could be related to my graphic card, and indeed it was. So, I checked what graphic card I have:
root@buckbeak:~# lspci | grep -i vga 01:00.0 VGA compatible controller: nVidia Corporation G86 [GeForce 8400M GS] (rev a1)
Searching on Internet I came acrssos the Debian’s nVidia driver page for this card, and lucky me, It is listed. So I had to install these packages:
aptitude install nvidia-glx nvidia-xconfig
But the X server is not set up to load the nVidia driver by default, so I had to run the command:
nvidia-xconfig
This will create the file /etc/X11/xorg.conf (remember that newer distros don’t have this file by default ) with all the information needed to load the nVidia driver, in particular this section:
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
After that, I rebooted the computer and I could log in to the Gnome’s session:
References
Logical Volume Manager (LVM)
Posted by Luis Gallardo in Linux on 18/11/2011

In the traditional disk partitioning scheme, administrators plan ahead the use of each partition. For instance, a laptop with 120 GB hard drive, 1 GB RAM can have the following partition scheme:
- 1 GB for swap (/dev/sda1),
- 12 GB for root (/dev/sda2),
- 107 GB for /home (/dev/sda3), meaning, the remaining space.
So far so go, but what if the RAM is increased to 2 GB? In order to hibernate the system you must increase the swap, and because the whole hard drive was partitioned leaving no space there isn’t other way than repartitioning the hard drive using a utility, if the file system allows it (for instance, ext[2|3|4] file systems let you resize them).
There isn’t anything more flexible? Yes, it’s called LVM (Logical Volume Manager), and basically it lets you hot resizing of partitions. For example, you can release 1GB from /home (/dev/sda3) and give it to the swap partition (/dev/sda1).
LVM (Logical Volume Manager)
In order to use LVM, first you must assign physical volumes, then volume groups and finally logical groups. All this might be confusing at first, but let’s try to explain each of these terms and how they are related:
- Physical volumes: This is the support media where the data will be stored, and they can be made of several hard drives or partitions of a drive. They don’t have a direct relation with the mount points. Physical Volume examples: /dev/sda , /dev/sdb1, etc.
- Volume groups: It’s the grouping of logical volumes in a volume to see them as one device. Physical volume example: /dev/vg00
- Logical volumes: Here is were the file systems (for example, ext2, ext3,xfs,vfat) will reside and so the mount points (/, /home, swap, /usr, /var, etc). At this level the files systems are formated, and it’s where the data will be distributed logically, as you are costumed to with the traditional partitions. Logical volumes examples: /dev/vg00/lv_rootfs, /dev/vg00/lv_swap, /dev/vg00/lv_home.
Installing LVM
On Debian you can install LVM with this package:
aptitude install lvm2
On other distributions like Fedora, Red Hat or Ubuntu you must search the name of the package for LVM.
LVM commands
In order to create a LVM using physical, groups and logical volumes let’s see some commands available:
Physical volumes
| Command | Description |
| pvcreate | Initialize physical volume(s) for use by LVM |
| pvs | Display information about physical volumes |
| pvdisplay | Display various attributes of physical volume(s) |
| pvresize | Resize physical volume(s) |
| pvmove | Move extents from one physical volume to another |
Volume groups
| Command | Description |
| vgcreate | Create a volume group |
| vgs | Display information about volume groups |
| vgdisplay | Display volume group information such as attributes |
| vgextend | Add physical volumes to a volume group |
| vgreduce | Remove physical volume(s) from a volume group |
| vgremove | Remove volume group(s) |
Logical volumes
| Command | Description |
| lvcreate | Create a logical volume |
| lvs | Display information about logical volumes |
| lvdisplay | Display information about a logical volume |
| lvresize | lvreduce | lvextend | Resize a logical volume |
| lvmove | Remove logical volume(s) from the system |
Example of how to create a LVM
Let’ s suppose you have free 8 GB hard drive in /dev/sdb , with two partitions of 4 GB each (/dev/sdb1 and /dev/sdb2), and you want to create a LVM on those two partitions to use these mount points: 1 GB for the system’s root (/), 1 GB for swap (swap) and the remaining 6 GB for users directory (/home). To create the LVM you can type the following commands:
root@buckbeak:~# pvcreate /dev/sdb1 Physical volume "/dev/sdb1" successfully created root@buckbeak:~#pvcreate /dev/sdb2 Physical volume "/dev/sdb2" successfully created root@buckbeak:~# pvs PV VG Fmt Attr PSize PFree /dev/sdb1 lvm2 a- 4.00g 4.00g /dev/sdb2 lvm2 a- 3.99g 3.99g root@buckbeak:~# vgcreate vg_group01 /dev/sdb1 /dev/sdb2 Volume group "vg_group01" successfully created root@buckbeak:~# vgs VG #PV #LV #SN Attr VSize VFree vg_group01 2 0 0 wz--n- 7.99g 7.99g root@buckbeak:~# lvcreate -n lv_rootfs vg_group01 -L 1G Logical volume "lv_rootfs" created root@buckbeak:~# lvcreate -n lv_swap vg_group01 -L 1G Logical volume "lv_swap" created root@buckbeak:~# lvcreate -n lv_home vg_group01 -L 6G Volume group "vg_group01" has insufficient free space (1534 extents): 1536 required root@buckbeak:~# lvcreate -n lv_home vg_group01 -l 1534 Logical volume "lv_home" created root@buckbeak:~# lvs LV VG Attr LSize Origin Snap% Move Log Copy% Convert lv_home vg_group01 -wi-a- 5.99g lv_rootfs vg_group01 -wi-a- 1.00g lv_swap vg_group01 -wi-a- 1.00g
Now you can make the file system for each logical volume:
root@buckbeak:~# mkfs.ext4 /dev/vg_group01/lv_rootfs mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 65536 inodes, 262144 blocks 13107 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=268435456 8 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376 Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 34 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. root@buckbeak:~# mkfs.ext4 /dev/vg_group01/lv_home mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 393216 inodes, 1570816 blocks 78540 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=1610612736 48 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 20 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. root@buckbeak:~# mkswap /dev/vg_group01/lv_swap mkswap: /dev/vg_group01/lv_swap: warning: don't erase bootbits sectors on whole disk. Use -f to force. Setting up swapspace version 1, size = 1048572 KiB no label, UUID=e743b4f3-1c80-4503-be88-6934d575cd55 root@buckbeak:~# swapon /dev/vg_group01/lv_swap root@buckbeak:~# swapon -s Filename Type Size Used Priority /dev/dm-1 partition 2064376 8 -1 /dev/dm-5 partition 1048568 0 -2
If you want to use these logical volumes, you can mount them using the mount command or add them to the /etc/fstab file to be mount when the system boots.










Planeta Linux
Follow me