Skip to main content

Lesson Learned On Logical Volume Management and RAID

The lesson is this; that just because you can doesn't mean you should.

I wiped off my RAID array and the data in it. It has around 300+G there, mostly downloaded, recoverable, and back-up'd to a CD/DVD content. I was trying to employ Logical Volume Management or LVM on an existing RAID array. After tackling RAID these couple of months, I figured I'm ready to face another monster. LVM is awesome because it can do partitioning, resizing, formatting, creating snapshots, while the system is online. You do not have to take it offline which to me is like magic.

Now that the data is gone, there really is no reason not to LVM the RAID. So after reinstalling my operating system (which is another long story), I reassemble RAID with:

#mdadm --assemble /dev/md0  /dev/sda  /dev/sdb  /dev/sdc

and checked the status of the array with:

#cat /proc/mdstat
or
#mdadm --detail /dev/md0

I checked the status of all the logical volumes with any of the following commands:

#pvdisplay     ;to check the physical volumes
#vgdisplay     ;to check the volume group
#lvdisplay      ;to check the logical volumes

I know that my home directory is going to need a lot of room for music and videos. I will have to create logical volumes for it to utilize the RAID which is now empty. I would leave some free space there for some flexibility.

To create logical volumes, I plan to extend the existing volume group first to include the newly assembled RAID. So I typed:

#vgextend ubuntu-vg /dev/md0

Then to create the logical volumes I need I typed:

#lvcreate -L size -n Musiclv ubuntu-vg
#mkfs.ext4 /dev/mapper/ubuntu-vg/Musiclv
#lvcreate -L size -n Videoslv ubuntu-vg
#mkfs.ext4 /dev/mapper/ubuntu-vg/Videoslv

I tested mounting them to home directory. I tried:

#mount /dev/mapper/ubuntu-vg/Musiclv /home/user/Music   ;since the Music folder already exist, I don't have to create them.
#mount /dev/mapper/ubuntu-vg/Videoslv /home/user/Videos     ;since the Videos folder already exist, I don't have to create them.

To check if they work, open the file manager, nautilus, and check out properties in particular. If you have trouble with permissions and ownerships of the files, then you should try:

#chmod 777 /home/user/Music
#chown user:user /home/user/Music
#chmod 777 /home/user/Videos
#chown user:user /home/user/Videos

These last series of commands will let you read and write your files and execute operations on them.

To make these changes more permanent so that even if you end your session and reboot they will stay, then we have to edit /etc/fstab file.

#gedit /etc/fstab

Put entries for each lv you created, something like:

                              
    filesystem       mount point        type         options        dump        pass

/dev/mapper/ubuntu-vg/Musiclv    /home/user/Music     ext4     defaults     0       0
/dev/mapper/ubuntu-vg/Videoslv   /home/user/Videos     ext4     defaults     0       0

As the names of the logical volumes imply, I plan to put music and videos on these folders.

Comments

Popular posts from this blog

Mailvelope, Encryption for Webmail

Encryption is the topic of week. I wrote about it in a related post here. While encryption is a very good idea, doing it and doing it every day as part of your work flow is another thing. My view is that if you're already using an email client then it is easier, simpler and more convenient to adopt encryption. That is not the case if you're using a webmail service. If you are using the browser to check, compose and send your email, what are your options? The answer is: it's complicated. Looking for a way to do encryption with Google Chrome and Gmail, I found this. I also read that Google just released code for email encryption as open source. But it's a long way to being used by end users. The extension for Google Chrome works fine if the recipient also uses Google Chrome. But I went ahead and check this on Evolution.

Donald Trump Is The 45th President of the United States

     and he is preparing to move with his transition team into the Oval Office. His election is a shock to many political observers and the world in general. Donald Trump, the president-elect, ran against Hillary Clinton, former Secretary of State and for many the most qualified candidate for the presidency in many years. This has led to many post election analysis of how this upset happened. The numbers of votes for each candidate and the comparisons with previous presidential elections point to the fact that the white vote for Mr. Trump is solid all throughout but the minority and black votes did not come for Mrs. Clinton. This is what happened in crucial States like Michigan and Florida. The Republicans kept Congress and the Senate. It is quite notable that Russia and in particular, Vladimir Putin, is happy that they are going to talk to Mr. Trump rather than Mrs. Clinton. It is also a ...

Webapps in Unity

So it has been 4 months since Ubuntu 14.04 came out. This is LTS and supported for 6 years by Canonical. The first mobile device with Ubuntu pre-installed is promised to come out later this year, 2014. It's time to check out how the apps perform so far. It is a good idea. I use Gmail and Twitter and Facebook. Why not a webapp in a desktop? So I start the Twitter and Gmail webapp. So far it has crashed my computer 6 times. Not a very good sign. On the other hand it does work but not as stable as opening them in Firefox. -- Use my PGP key if you want to encrypt your replies/messages to me. You are invited to also send me your PGP keys so we can communicate in private.