Tuesday, January 21, 2014
Extending an ext3 partition with LVM
LVM is quite technical but very powerful, here is extending an ext3 filesystem that is stored on a logical volume under Linux LVM.
Starting with a spare disk, setup with 4 LVM partitions:
[root@hpmicro ~]# fdisk -l /dev/sdb
Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 9727 78132096 8e Linux LVM
/dev/sdb2 9728 19454 78132127+ 8e Linux LVM
/dev/sdb3 19455 29181 78132127+ 8e Linux LVM
/dev/sdb4 29182 38913 78172290 8e Linux LVM
I make the first two into a LVM ext3 filesystem:
[root@hpmicro ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
[root@hpmicro ~]# pvcreate /dev/sdb2
Physical volume "/dev/sdb2" successfully created
Create a volume group "TempVG" that uses these two partitions:
[root@hpmicro ~]# vgcreate TempVG /dev/sdb1 /dev/sdb2
Volume group "TempVG" successfully created
Create a logical volume that uses storage from TempVG:
[root@hpmicro ~]# lvcreate --name TempVol00 --size 140G TempVG
Logical volume "TempVol00" created
Create the filesystem on the logical volume:
[root@hpmicro ~]# mkfs -t ext3 /dev/TempVG/TempVol00
Mount the filesystem
[root@hpmicro ~]# mkdir /store
[root@hpmicro ~]# mount /dev/TempVG/TempVol00 /store
Now create the other two PV's:
[root@hpmicro disc]# pvcreate /dev/sdb3
Physical volume "/dev/sdb3" successfully created
[root@hpmicro disc]# pvcreate /dev/sdb4
Physical volume "/dev/sdb4" successfully created
Extend the existing volume group:
[root@hpmicro disc]# vgextend TempVG /dev/sdb3 /dev/sdb4
Volume group "TempVG" successfully extended
Extend the logical volume:
lvresize -L+150G /dev/mapper/TempVG-TempVol00
Extending logical volume TempVol00 to 290.00 GB
Logical volume TempVol00 successfully resized
Now resize the filesystem on that logical volume (checking with df sizes before and after):
[root@hpmicro disc]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/TempVG-TempVol00
138G 4.8G 127G 4% /store
[root@hpmicro ~]# resize2fs /dev/mapper/TempVG-TempVol00
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/mapper/TempVG-TempVol00 is mounted on /store; on-line resizing required
Performing an on-line resize of /dev/mapper/TempVG-TempVol00 to 76021760 (4k) blocks.
The filesystem on /dev/mapper/TempVG-TempVol00 is now 76021760 blocks long.
[root@hpmicro ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/TempVG-TempVol00
286G 191M 271G 1% /store
Wednesday, January 1, 2014
Linux: Install ISO image from DVD (CentOS6)
From: http://wiki.centos.org/HowTos/InstallFromUSBkey
1. Use fdisk to setup partitions (about 250M for the boot partition, "a" makes bootable):
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 43 247657+ b W95 FAT32
/dev/sdc2 44 5324 30418560 83 Linux
2. Make filesystems:
mkfs.vfat -n BOOT /dev/sdc1
mkfs.ext3 -m 0 -b 4096 -L DATA /dev/sdc2
3. Copy the isolinux directory from the DVD1 to the first /dev/sdc1 partition root.
4. Rename isolinux to syslinux. Rename syslinux/isolinux.cfg syslinux/syslinux.cfg
5. Copy the images directory from DVD1 to the /dev/sdc1 partition root.
6. Create syslinux boot on the /dev/sdc1 partition. syslinux /dev/sdc1
7. Mount the /dev/sdc2 partition and copy the .iso files to the root.
8. During install Ctrl-Alt-F2 umount /mnt/isodir ; mount /dev/sda2 /mnt/isodir - as the installer needs to point to where the .iso files are kept.
1. Use fdisk to setup partitions (about 250M for the boot partition, "a" makes bootable):
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 43 247657+ b W95 FAT32
/dev/sdc2 44 5324 30418560 83 Linux
2. Make filesystems:
mkfs.vfat -n BOOT /dev/sdc1
mkfs.ext3 -m 0 -b 4096 -L DATA /dev/sdc2
3. Copy the isolinux directory from the DVD1 to the first /dev/sdc1 partition root.
4. Rename isolinux to syslinux. Rename syslinux/isolinux.cfg syslinux/syslinux.cfg
5. Copy the images directory from DVD1 to the /dev/sdc1 partition root.
6. Create syslinux boot on the /dev/sdc1 partition. syslinux /dev/sdc1
7. Mount the /dev/sdc2 partition and copy the .iso files to the root.
8. During install Ctrl-Alt-F2 umount /mnt/isodir ; mount /dev/sda2 /mnt/isodir - as the installer needs to point to where the .iso files are kept.
Film: The Lives of Others Directed by Florian Henckel von Donnersmarck
A foreign language film about life in East Germany under Stasi rule. It centres around the observation of a subversive playwright who has been placed under surveillance.
The officer in charge however becomes drawn into the lifes of those he is monitoring, to the point of withholding incriminating information.
The playwright manages to get an article published in the west about the covering up of suicide figures, which causes a storm in the party circles - eventually the agent is demoted to "steaming envelopes" for perceived incompetence.
When East Germany is re-united with the fall of the Berlin wall - the playwright finds out about this and dedicates his latest work to him.
The officer in charge however becomes drawn into the lifes of those he is monitoring, to the point of withholding incriminating information.
The playwright manages to get an article published in the west about the covering up of suicide figures, which causes a storm in the party circles - eventually the agent is demoted to "steaming envelopes" for perceived incompetence.
When East Germany is re-united with the fall of the Berlin wall - the playwright finds out about this and dedicates his latest work to him.
Thursday, December 26, 2013
Book read: A Captain's Duty by Richard Philips
I saw the film adaptation of this with Tom Hanks a couple of months ago. It was a really tense gripping film that described the hijacking of an American container ship by Somali pirates. It did a good job of also trying to explain the two sides of the story - although it did become a bit of a recruiting vehicle for the US navy toward the end.
I've now read the book account and that is just as interesting. It has lots of background detail of how Phillips became a captain, and I found that fascinating. The description of the hijack is equally good, how he prepared the crew beforehand, how quick thinking he had to be to stall and disrupt the pirates.
A really good read, and an eye opener into the merchant sailor world - something we all rely on but few people realise the threats they face.
I've now read the book account and that is just as interesting. It has lots of background detail of how Phillips became a captain, and I found that fascinating. The description of the hijack is equally good, how he prepared the crew beforehand, how quick thinking he had to be to stall and disrupt the pirates.
A really good read, and an eye opener into the merchant sailor world - something we all rely on but few people realise the threats they face.
Book read: Red Machine: The Players' Stories by Simon Hughes
A book with an interview per chapter of players from the 1960s-1980s in the Liverpool team.
If you followed football at that time, particularly the period in the 1980s where Liverpool were the team to beat then it is a really nostalgic look back at the times and allows lots of comparisons with how the game has changed.
The profile of football was so much lower then, and consequently the game was much less commercialised. The success of Liverpool toward the late 1980s was just the beginning of that revolution.
Although it did not seem amateurish at the time, a lot of the training, medical treatment was pretty basic. Liverpool had a simple philosophy, where they excelled was in buying players that would fit well into a team.
A really good read, and a nice piece of football history.
If you followed football at that time, particularly the period in the 1980s where Liverpool were the team to beat then it is a really nostalgic look back at the times and allows lots of comparisons with how the game has changed.
The profile of football was so much lower then, and consequently the game was much less commercialised. The success of Liverpool toward the late 1980s was just the beginning of that revolution.
Although it did not seem amateurish at the time, a lot of the training, medical treatment was pretty basic. Liverpool had a simple philosophy, where they excelled was in buying players that would fit well into a team.
A really good read, and a nice piece of football history.
Sunday, November 10, 2013
Twitter Economics
The Twitter flotation got a lot of press this week.
They floated at $26 a share, with 505 million shares in circulation leading to a market cap of $13.1 bn.
There was lots of interest in the shares and they rose above $50, and now stand at $41. That's a market cap of around $20 bn.
It's a very popular service, I can't deny that - and it has tentacles into all media outlets - as they have been suckers for feeling the need for a presence on it. Especially individuals of media who feel the need to self promote (despite the obvious danger of an ill judged tweet ending your career).
But this service has never made a profit, has yet to work out an advertising strategy - and could easily be replaced by a newer more trendy upstart.
I was dubious about Facebook - this is just crazy...
They floated at $26 a share, with 505 million shares in circulation leading to a market cap of $13.1 bn.
There was lots of interest in the shares and they rose above $50, and now stand at $41. That's a market cap of around $20 bn.
It's a very popular service, I can't deny that - and it has tentacles into all media outlets - as they have been suckers for feeling the need for a presence on it. Especially individuals of media who feel the need to self promote (despite the obvious danger of an ill judged tweet ending your career).
But this service has never made a profit, has yet to work out an advertising strategy - and could easily be replaced by a newer more trendy upstart.
I was dubious about Facebook - this is just crazy...
Facebook Economics IV
It has been a long time since I've looked at these shares, and the madness of the Twitter float has made me look back - I was pretty downbeat on them. Give Facebook their due, it looks like they are working out how to advertise to mobile/small screen users.
So how about the shares?
There are 2.43 billion shared in circulation.
$47.53 dollars per share, $115.50 bn market capitilsation
$38 dollars at floatation, indicating $92.34 bn value.
So an overall increase of $23.16 bn, a 25% rise in value.
Steady progress I say, and compared to Twitter this almost looks like a sensible business now...
So how about the shares?
There are 2.43 billion shared in circulation.
$47.53 dollars per share, $115.50 bn market capitilsation
$38 dollars at floatation, indicating $92.34 bn value.
So an overall increase of $23.16 bn, a 25% rise in value.
Steady progress I say, and compared to Twitter this almost looks like a sensible business now...
Subscribe to:
Posts (Atom)