You are here
Greg Milligan - Mon, 2014/03/17 - 00:39
Hi all, especially Jeremy Davis, I have a fairly simple task that trying to grasp LVM is making very difficult. I have an older Windows machine that will be a TKLFileserver with a bit of help. Its based on an older P4 with 2GB ram and three hard drives that are a 250 GB and 2 500 GB. I wanted to use 25 GB of the 250 for the TKL install with the rest of it and the 2 500s as the storage. I thought LVM was going to be my answer but I have been struggling now for a couple of days. It sounded simple enough, like dynamic volumes in Windows but I guess I don't have enough info to go by.
I managed to install it but the fine tuning and getting the two 500 GB drives and the remaining space on the 250 GB drive involved is turning into quite a task.
Forum:
There is a blog post for that! :)
Have a look at this blog post by Liraz. It's pretty straight forward IMO and should get you to where you want to be... If you have any specific questions or issues, post back here (or over there - whatever seems most relevant, perhaps bump this thread regardless as I sometimes miss comments on blog posts...) and I'll see what i can do! :)
This post helped me
Greg give it a read and see if helps your task at hand.
http://superuser.com/questions/454659/extending-lvm-partition-on-debian-...
This is where I ended up
This site helped a lot: http://www.howtoforge.com/linux_lvm . I had it working in my office but after I shut it down and moved it into the basement in the rack after I powered it up it doesn't work. I was using the torrent server version. On the next attempt I will used the standard fileserver version. The toughest part is having more than one hard drive and no documentation.
What exactly are the issues you are having?
When Liraz first wrote that post (that I linked to above) I was struggling with LVM and couldn't quite get my head around it... That post made it all click for me.
I still wouldn't call myself an expert, but have fiddled around with LVM quite successfully now on a number of occasions (both within TKL and on a couple of PVE servers) and find it pretty straight forward now...
If you are having specific issues perhaps post about them and we might be able to help with the details...?
This is where I am too
I am also experiencing the same issue. It was working fine at first but after shutting down and powering my device up, it didn't work as it used to.
Hey Eric
If you read down this thread further we talk about mounting the logical volumes from fstab. Did you add the required entries?
Hardware specs
If this machine has enough power why not run XenServer on it so you can host multiple ones? Always nice having an at-home lab to play with. :-)
Or ProxmoxVE
PVE (headless hypervisor server with Web UI) is the gear IMO... I use it at home and for a client and performance is incredible IMO (even on old hardware).
At home I have it installed installed on a 6yo desktop PC; currently have about 20 VMs running on it and performance is incredible consider the old specs.
For my client (my ex workplace); they have much better hardware but still only workstation grade (not 'proper' server hardware) and it's great, reliable and very low maintenance.
PVE supports both OVZ (for Linux) and KVM (for all OS inc Windows). Also TKL OVZ templates are available for download direct through the PVE Web UI! IMO the performance of OVZ containers can not be matched (although I have heard that LXC performance is the same - just haven't confirmed that first hand yet).
Proxmox!
At one point I actually downloaded it and added it to my ISO Repository in hopes to try it out yet after switching from VMware to XenServer (twice), I was tired of the setup process and just wanted my VM's online again. I've had to stick to XenServer as I'm in process of switching from being an Apple Server Admin, Casper Admin, package builder/testing, script writer and lead VIP support tech to working with our Citrix group (it's become VERY popular and a lot of money was recently dumped into it so I know it will be around for a while). I have a spare machine with a good'ol Core 2 Quad e6600 that I might throw PVE on to test out. Thanks for your post Jeremy as it's remided me of ProxMox all over again.
Greg, apologies for the post jacking but, glad you got everyhing sorted!
:-)
More apologies to you Greg
I'm sorry for hijacking your thread too Greg! Please post back if/when you want some more help/info...
@Snickasaurus - When I originally set up my server at home I was going to use Xen, then I found that too painful so looked at XenServer, but at that point it was still proprietary which turned me off. When I found PVE I loved it! :)
Now XenServer is fully open source, I wouldn't be surprised if it's popularity grows... I recall it looked quite nice and that was a few years ago now...
FWIW my home PVE server is a Core 2 Duo e6400 (with 8GB RAM) and it runs sweet. Some more RAM wouldn't go astray but the CPU is totally fine for my (light) workload (mostly media/file server, a couple of game servers fro my son, a couple of dev servers for myself and my son and otherwise mostly just testing...
Not to worry
Hey don't worry about it, I can never have too much info. My problem now is that I landed a bunch of work to the end of the month and don't have as much time for the file server/torrent server. I will still need some assistance since I have three to build and get working. Too tired to reallyget into it tonite. My main issue is that on all of them I have minimum of three hard drives, one for the appliance and two drives for storage. The added drives are what is giving me the most issues. I am addicted to Linux so it looks like TKL will become my friend once I master it.
What might really help
What are the minimum space requirements for the appliances? Would somewhere in the 6 - 8 GB range be enough?
Server1 will be a torrent server, a P4-2.53 GHz with 2 GB ram, with three hard drives, 2 500 GB for storage and a 120 with 8 GB partition for the appliance and the rest part of the LVM as additional storage with the 2 500 GB drives.
Server2 will be similar but in a file server appliance. Here we have a P4 2.8GHz with 4 GB ram with three drives too. But here we have a pair of 1 TB drives and another 120GB with the 6 - 8 GB partition brain and the rest part of the storage partition.
I have 2 more with E6750 dual core processors for other projects as hard drives become available. I should have three 2 TB drives and two 3 TB drives soon. I have been having issues with my WD external network drives dying on me all at once.
Getting ready to just go back to SUSE
Sorry guys, nice idea but it doesn't work here. Should be able to use a combined 1.013 TB as LVM but only able to use the small segment of the first drive. It gets nuked tomorrow unless you guys can figure it out. Let me know if you need anything.
Why do you want a separate partition for root?
I don't understand why you don't just use the same LV for the whole system and add your additional drives to it...? As per described in the blog post I linked to in my first post in this thread... I know that specifically relates to VMs but the theory is exactly the same for real HDDs - I successfully used those instructions when I added additional HDDs to my PVE setup (PVE also uses LVM).
Perhaps I am missing something in your setup scenario, but to me the most logical and straightforward way to do it would be to install from ISO to one of the HDDs (Possibly the 120GB, but wouldn't really matter) then once setup is complete, add the other drives to the LV... Done...!
FWIW here is what I did to add 2 HDDs to an existing LAMP
To test i just installed LAMP to a (K)VM instance with 3 vHDDs (2x5GB & 1x32GB).
I installed to one of the 5GB vHDDs then added the other 2 to the VG, then extended the LV by 30GB. Took me all of about 30 seconds...
Some more info (after I did the above):
Depends on your scenario I guess...
I guess if you wish to backup the data only (not the rest of the OS) using something like rsync, then having the data separate from the OS makes some sense (although as long as it's in a separate folder it wopuldn't make a huge difference).
If you are planning on making use of TKLBAM though it's probably irrelevant (by default TKLBAM will only backup important OS settings and the data).
If you had no plans for backups (and this setup is only for testing and/or hosting non-important data) then I wouldn't think that it would matter either...
The hardware shouldn't matter at all. AFAIK LVM will happily use IDE and/or SATA (and/or SCSI and/or USB sticks/drives and/or pretty much any other read/write storage device).
I had to google Windows dynamic volume to get an understanding of what that was. Once I did then I can say that generally LVM is somewhat similar to Windows 'simple volumes' (if you use LVM with only one disk) and/or 'spanned volumes' (with multiple disks). There are 3 layers to LVM:
In the case of a standard default install of TKL to a single drive it goes something like this (not to scale):
Note I added the MNT line to show mount points; i.e. /boot is mounted but is not part of the LVM; also that LVM root (aka turnkey-root; often logical volumes are expressed as [VG]-[LV]) is loaded as / (i.e. the filesystem root). /boot is a separate partition as the OS needs to start loading before LVM is up and running.
The scenario I am suggesting would look something like this (not to scale):
An alternate scenario (more like what you are suggesting) could look like this (not to scale):
In this scenario you will need to add the remainder of sda along with all of sdb and sdc to a new VG (which I called 'storage'). Then create your new LV within that (I called it 'data') and mount it wherever you want (I used /srv/storage as an example).
You could just make your data storage LV within the turnkey VG, however I don't think that there is any advantage to that usage (IMO you'd be better off just leaving the data and OS together as per the middle suggestion).
Does that give you a little more clarity? Or am I just confusing you more...?
Thanks Greg
The page you sent me probably still has some relevance, but in my (somewhat limited) experience I have never had need to make a separate partition for anything (other than /boot and swap). On Linux Desktops though I have been known to set up a separate /home partition. That allows for OS update without needing to start again... It has also caused me the odd issue though (different config for updated software for example)...
You are most welcome on the help. Hope you can get your systems up and running! :)
New Issue, 2nd and 3rd HD dont automount
I need to make one more hurdle to make it work right. When I reboot I lose HHD 2 and 3. Here is a copy of fstab, what did I forget?
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=84d250b6-b4ee-44fb-8029-7bf47864f6a9 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=5b42471a-dd80-442a-99e8-956e06db97a3 none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
/dev/torrentserver/share /var/share ext4 rw,noatime 0 0
I thought the last line would remount automatically but this happened.
Doesn't look good...
Are there perhaps issues with those disks... You mentioned they were 2nd hand. Perhaps they've died (although seems unlucky that they both go at the same time...)
I was going to double check on my PVE server but I was trying to get a Xen server hypervisor running nested on top of KVM (for testing) and it seems I've broken KVM so can't currently do any testing. Sorry Greg...
The only other possibility that springs to mind is that the device names may have changed (i.e. not /dev/sdb). Although that seems unlikely as surely at least one of them would have still been the same..Also lookng again it's complaining about both /dev/sdb and /dev/sbd1 - AFAIK you can only use one or the other (device name or partition name), not both...
FWIW your fstab looks fine at a glance.
New question, possible solution
For the most part, you have an idea of what I am after. What I need to know about now is do the three partitions that make up the LVM need to be listed in the fstab file? If so that explains part of my problem. Fstab is a list for auto mount correct? I only see it mentioning part 1, 5 and /dev/mapper/torrentserver-share. Shouldn't all of the following be included:
> blkid
/dev/sda1: UUID="84d250b6-b4ee-44fb-8029-7bf47864f6a9" TYPE="ext4"
/dev/sda3: UUID="HK3oax-xt2x-ocoj-3lV3-xF1P-Vx0H-viMu6N" TYPE="LVM2_member" missing
/dev/sda5: UUID="5b42471a-dd80-442a-99e8-956e06db97a3" TYPE="swap"
/dev/sdb1: UUID="D9Hx3T-LC3F-cr2D-WAxO-37np-gHjW-Vlf2PP" TYPE="LVM2_member" missing
/dev/sdc1: UUID="q6wVRB-cd5Y-mcT6-ZS5D-qto5-b0t0-0GDBUQ" TYPE="LVM2_member" missing
/dev/mapper/torrentserver-share: UUID="94ee69c0-e42e-4275-acff-bfc1d0476397" TYPE="ext4"
You only need to mount the Logical Volumes
Yes fstab is basically like a manually configure automount conf file. LVM should know how/which logical volumes relate to the PVs. So for example here is my Proxmox server fstab (I'd give you a better TKL example but as I said my Proxmox server is currently sort of broken...)
The current LVs:
The VGs:
And the PVs:
This is a bit of an odd setup I know but it is mostly because I had a heap of 500GB drives that i have since replaced and it was before I totally understood what I was doing so just moved the PVs to partitions on the new 2TB disk.
I hope it is of some value to you...
Also one other thing I just noticed is that you don't have a 'real' partition as /boot. Now AFAIK theoretically you can do what you've done, but best practice is to use a 'normal' real partition for boot (ideally the first partition on the first disk). Otherwise you can have issues. I wonder if your problems is a result of that? Perhaps I wasn't clear enough on that... I hope I haven't confused you...
Also FWIW here is my disks/partitions as per fdisk (notice the warnings/errors - these can be safely ignored, it's just because fdisk doesn understand/can't read the LVs):
Add new comment