Monday, July 25, 2016

Mina



July 2016 - San Mateo, Philippines
--
Donato Roque @ubuntu-16.04
mobile: 63-918-572-1710
and this is my blog.
Consider using my pgp keys for privacy.

Sunday, July 24, 2016

RAID: Added 1 x 2TB Hard drive

I talked about RAID in my system before here and here. My present set up is:
/dev/sda5      SSD      223GB   EXT4    /  
/dev/sdb1     HHD      2TB       Linux raid      /media/user
/dev/sdc1      HHD      1TB       Linux raid     /media/user

New:    
/dev/sdd1      HHD      2TB      unpartitioned - free space

RAID:
/dev/md0        2 devices    /dev/sdb1   /dev/sdc1


/dev/sdc1 is old. It has 27,500 hours of use according to smartctl. You can open the terminal and type:

#smartctl -a /dev/sdc

to get collected data from the device. Among other attributes see Power-on-hours to get the total hours this hard drive has been spinning. Also pay attention to 5 Attribute the allocated Sector Count. Any value you see other than 100 there, you should move your data somewhere else. 

I have a RAID5 which includes this device. So any warning notification I can fail and remove it. Replace it with a new hard drive. I am completing my RAID 5 array with a new hard drive today.

After installing the hard drive to your SATA cable and power cable. See if your computer detects it. Type:

#fdisk -l

Then partition the disk with fdisk.

#fdisk /dev/sdd

fdisk will create a new partition and create a partition table for you. 

-d     delete partition
-n     create new partition
-p     print new partition and details
-t      change to new type of filesystem
-l       list filesystem type 
-q      quit without saving
-w     write changes, and think first before typing enter


Once the new partition in the new hard drive is ready. I added the device to the RAID array.

Old RAID:
/dev/md0          2 devices         /dev/sdb1     /dev/sdc1

To add the new device to the RAID array:

#mdadm  -add /dev/md0 /dev/sdd1

Check the status of the array:

#cat /proc/mdstat

It will show that /dev/sdd1 is a spare. I have to grow the array to 3 devices.

#mdadm --grow --raid-devices=3  /dev/md0 

You can monitor the sync process of the array with:
#cat /proc/mdstat

 
--
Donato Roque @ubuntu-16.04
mobile: 63-918-572-1710
and this is my blog.
Consider using my pgp keys for privacy.

Monday, July 18, 2016

GNOME-terminal Rocks




Using Ubuntu 16.04 I was wondering if "avconv" is already installed. I am in fact curious if a bunch of packages are installed. I open GNOME-Terminal with Cntrl+Alt+T and type the name of the package. I get info and suggestions on how to install it. In the case of "avconv" it is called by another name. 

That's service and quite helpful.

--
Donato Roque @ubuntu-16.04
mobile: 63-9185721710
and this is my blog.
Consider using my pgp keys for privacy.

Sunday, July 17, 2016

Unpatched Software Is A Security Issue

Ubuntu Linux forum was hacked last July 14th. Canonical the company developing Ubuntu disclosed that the forum's database was hacked and data was compromised including hashed passwords of 2 Million users. The hackers used a known vulnerability in an unpatched software the forum is using in its servers. 

In the Linux world, the number one security isssue is updating the operating system and the software that we use with it. The first ones to violate this are the servers. Servers simply run old vulnerable software. 


--
Donato Roque @ubuntu-16.04
mobile: 63-9185721710
and this is my blog.
Consider using my pgp keys for privacy.

Saturday, July 16, 2016

GUI in Thunderbird Problem

After downloading Skype for linux yesterday and installing it, my desktop applications are fine. Today I opened Thunderbird and the GUI is back to a 90's theme. I downloaded evolution mail and configured my email accounts in minutes. 

In Linux, there's more than one way to skin a prey. 

Friday, July 15, 2016

Resized The RAID And the Data Is Safe

The <a href="https://donatoroque.blogspot.com/2016/07/resized-raid-array.html">last post,</a> I was talking about resizing a component of my existing RAID. I was worried about losing data.

Here's how I did it without data loss.

/dev/md0                   /dev/sdb1        2TB
                                  /dev/sdc1        1TB

I am increasing the size of the partition and it's an important distinction because the order of the steps would be different otherwise. Check the status of the RAID array with:

$cat /proc/mdstat

Put a fail flag on the partition and remove it.
$sudo mdadm /dev/md0 -fail /dev/sdb1 --remove /dev/sdb1

Then we have to use fdisk to handle the physical resizing of the device. fdisk is an interactive application in text mode. So-
$sudo fdisk /dev/sdb1
-h     for help
-p     for primary partition
-d     delete
-n     new partition
if unsure choose the default option.
-q     to quit without saving
-w    to write the changes, now think first before hitting enter here

I used fdisk to create a new partition utilizing the entire 2TB device. I made an additional step here to check the filesystem after I created a new partition. Use fsck to verify the integrity of the ext3/ext4 filesystem. You should make sure to unmount the partition before checking with e2fsck. It will offer to fix errors you have to press consent or y for the process to continue, otherwise, use the -p switch to allow e2fsck to automatically repair the filesystem without human or administrator intervention.

$sudo e2fsck /dev/sdb1

Re-add the partition to the RAID array.
$sudo mdadm -a /dev/md0 /dev/sdb1

I had to wait 2 hours for the RAID to synchronize and then proceed to the next partition or the next step. Check the status of the synchronization with:

$cat /proc/mdstat

Do this steps one partition at a time.

Increase the size of the array with:

$sudo mdadm --grow /dev/md0 -z max  
or
$sudo mdadm --grow /dev/md0 -z [size]

Increase the size of the ext3/ext4 filesystem with:

$sudo resize2fs /dev/md0 [size]

If the size is not specified, the default is the size of the partition.


--
Donato Roque@ubuntu-16-04
mobile:63-9185721710
I'm on twitter, facebook and this is my blog.
Consider using my PGP keys for privacy.

Wednesday, July 13, 2016

Resized RAID Array

RAID is Redundant Array of Independent Disks. It is a technology in virtualization which allows several devices to be grouped together and used as if there is only one device. If I have two or more hard drives I can group them together in a RAID and my computer will treat it as one device. RAID's purpose is for data redundancy and performance. I use software RAID in Linux. The other kind is hardware RAID in which you depend on chipsets to manage the RAID.

I have a RAID5 array consisting of 1x1TB and 1x2TB. I bought a new 2TB hard drive and I want to add it to the RAID.   To make matters complicated I only made a 1TB partition out of the 2TB hard drive when I created the original RAID. I want to use the entire 2TB capacity of the hard drive and then add the newly bought 2TB hard drive to the RAID.

I have been using the RAID array since April 2016, so there's data written on this array now.

old RAID array:
/dev/sdb1    -    935G (2TB)   -    raid5    -    /dev/md0
/dev/sdc1    -    931G (1TB)   -    raid5    -    /dev/md0

Can this be accomplished without data loss?


--
Donato Roque@ubuntu-16-04
mobile:63-9185721710
I'm on twitter, facebook and this is my blog.
Consider using my PGP keys for privacy.