Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Adding another drive to a VLM

  • 03-03-2010 11:07PM
    #1
    Moderators, Education Moderators, Technology & Internet Moderators Posts: 35,271 Mod ✭✭✭✭


    I've set up my own file server and before I have one partition spanned across two disks using VLM. If I choose to add another drive to the VLM and then increase the partition to incorporate that drive will I lose any of the existing data saved on the hard drives in the VLM. I'm pretty confident I won't (well there is always that risk when you start screwing around with partitions) but I'd like to be sure before I start transferring data across.


Comments

  • Registered Users, Registered Users 2 Posts: 545 ✭✭✭ravydavygravy


    I assume you mean LVM - if so, you should be able to do this without losing data - but as you said - messing with such things is also like playing with fire, so backup first.

    Without having docs to hand, you'd need to do something like this:

    1) Add the physical drive to the machine
    2) Add the drive to a new LVM physical group (pvcreate?)
    3) Add the new PV to the existing Volume Group (vgextend?)
    4) Use the new space to increase an existing logical volume (lvextend?)
    5) Resize the filesystem to fit the new LV size (resize2fs - does this do ext3?)

    Dave


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    Yeah, it's LVM and this kind of thing is well documented. It's the main value of an LVM over a standard partition (IMO anyway). I've done this before and (Not being smart but) google is your friend there. There are lots of guides.

    edit: You might consider using gparted for that actual partition messing (once you've extended the logical volume). It's actually a really good piece of kit these days and much nicer than arsing around on the command line.


  • Moderators, Education Moderators, Technology & Internet Moderators Posts: 35,271 Mod ✭✭✭✭AlmightyCushion


    Yeah it is LVM I'm talking about. I was trying to remember what three letter acronym it was and all I kept thinking was mkv, kvm, vlc etc. which are obviously all wrong. I got pretty close though which is all good.

    @Khannie - I've used gparted to create the current partition on the LVM and I've used it before a few times as well. It seems to work very well so I'll definitely be using it especially seeing as I'm new to linux and not familiar with the CLI. I'm pretty comfortable with the process of doing it I was just worried about the data.
    Thanks a million for the help guys.


  • Registered Users, Registered Users 2 Posts: 354 ✭✭AndrewMc


    5) Resize the filesystem to fit the new LV size (resize2fs - does this do ext3?)

    Yes, resize2fs does ext3. If it's recent enough, it can usually do the resize even while the filesystem is in use. If you don't specify the new filesystem's size it will just expand to fill the logical volume.


Advertisement