Multiple hard drives, only one active & need more space

24 posts / 0 new
Last post
#1 Mon, 12/10/2012 - 13:40
PepinYaco

Multiple hard drives, only one active & need more space

My System:
- HP ProLiant ML310 G3 server (http://h18004.www1.hp.com/products/servers/proliantml310/index.html)
- Embedded SATA with integrated SATA RAID 0, 1
- 4 hardDrive Bays (2x250GB and 2x750GB)
- Ubuntu Linux 10.04.4 On first 250HD
- Virtualmin version 3.96.gpl GPL

My question:
How can I add/merge at least one of the other inactive 3 hard drives so that I can have more storage space. Right now I have already use half of the sda (fisrt Drive). The other 3 hard drives are not active or in use.

NOTE: have none experience with RAID and the little I read, it said I may have to start fresh before even install OS, before I install Virtualmin. Can anyone help? thx

Mon, 12/10/2012 - 15:55
andreychek

Howdy,

What output do you receive if you run the command "mount"?

You may just need to temporarily mount your drive somewhere, copy all the home directory data to it, then mount it overtop of your current "/home".

But seeing how your drive is currently setup (which the "mount" command does) will help us offer the best way to move forward with that.

-Eric

Mon, 12/10/2012 - 19:52
PepinYaco

Here is that output:

marc@ns1:~$ mount
/dev/sda1 on / type ext4 (rw,grpquota,errors=remount-ro,usrquota)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
gvfs-fuse-daemon on /home/marc/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=marc)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
/dev/sdb1 on /media/2742B2BF6A4D87B4 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)

/dev/sda (232.88GiB) (250GB)
/dev/sdb (232.88GiB) (250GB)
/dev/sdc (698.64GiB) (750GB)
/dev/sdd (698.64GiB) (750GB)

Thx Eric

Mon, 12/10/2012 - 22:23
andreychek

Okay, it looks like you just have a standard drive setup for your / partition. You're not using LVM or software RAID.

So, what I'd recommend, is to mount one of your new drives temporarily... perhaps on /mnt/new_drive, and then copy your home directory contents there.

Once that is complete, you can re-mount that drive over-top of /home, which would then allow you to use that as your server's home directory.

-Eric

Tue, 12/11/2012 - 11:04
PepinYaco

Thx Eric for your respond.

OK, so it Sounds to me like LVM or software RAID would make things even more complicated.

Please excuse my ignorance, Im more of a windows person (not that im an expert on that topic ether) Windows Home Server is what Im use to run. Im learning Linux as I go (and not too familiar with all the command lines) and the reason why im using Ubuntu 10.04 is cos I HATE Ubuntu new interface/look (12.04).

I most of read your post 10 times trying to figure how to even start doing what ur subjecting, copying the home dir to one of the other drives should not be hard, but everything right after perhaps on /mnt/new_drive, and then copy your home directory contents there. Once that is complete, you can re-mount that drive over-top of /home, which would then allow you to use that as your server's home directory.

Im not 100% sure how to do this or the right steps.

It would be nice is there was an option in VirtualMin or Webmin that would allow us to expand storage space by selecting/adding an existing internal hard drive. Who know maybe in a next Virtualmin release lol.

- What would this do?
- would it expand my server storage space by combining the two drives?
- or just move the server from the smaller HD to the bigger HD without starting fres?
- Would I still have to do a LVM?

Tue, 12/11/2012 - 21:20
andreychek

Howdy,

That's a tricky one to automate, unfortunately, due to the large number of possible setups folks can have.

You don't need to use RAID or LVM to add a disk... but if you were already using them, the procedure for doing this would be different.

As you mentioned though, it's not really possible to begin using RAID or LVM after the fact though, that's something you'd need to use from the beginning when your OS is initially installed.

If you have an extra drive, and aren't using LVM or RAID -- that means that drive would be used just for the files where you mount it. The space would not be combined with your existing drive, the space would just be available for one particular mount point.

I might suggest using it for /home, for example (/home is the mountpoint).

You'd first need to format your spare drive, partition it, mount it somewhere temporarily, copy all your files to it, unmount it, mount it overtop of /home, and then add an entry for that in /etc/fstab.

So, there's a lot of steps involved in accomplishing this :-)

It can all be done from the command line, and that's probably the quickest way to do it.

If you aren't familiar with the command line procedure for those tasks, you should also be able to do all that from within Webmin.

You can partition (and format, I believe) in Webmin -> Hardware -> Partitions on local disks.

You can mount a drive using Webmin -> System -> Disk and Network Filesystems.

Once you've mounted your new drive on a temporary location, you can use a file manager to copy the current contents of your /home to that temporary mountpoint.

That should hopefully get you started :-)

-Eric

Wed, 12/12/2012 - 08:42
PepinYaco

Hi Eric, I really appreciate ur taking ur time to help, but as I mention before, I'm not a really experience person in Linux command lines or even using Virtualmin, but what ur subjecting, does sounds like something new to try.

I did bring a laptop into work today with an extra hard drive and as a test and for my own learning, I'm gonna try to set up an LVM just for the heck of it. And if that works and I have to start fresh on my home server , so be it.

Once again thx Eric. I do have one more question tho, I'm using Ubuntu 10.04 because I like the interface better that 12.04. If I have to start fresh, Is there any advantage to up to Ubuntu 12.04 to run Virtualmin versus staying with Ubuntu 10.04 ?

Wed, 12/12/2012 - 09:24
andreychek

Howdy,

I did bring a laptop into work today with an extra hard drive and as a test and for my own learning, I'm gonna try to set up an LVM just for the heck of it. And if that works and I have to start fresh on my home server , so be it.

Just to be clear, I'm not using LVM on most of my servers :-) There's nothing wrong with it, but it just depends on how you want to go about things.

If you are performing a fresh install though, and the OS installer can see all your drives, you'll have a lot of options available to you for how to configure your drive layout.

I'm using Ubuntu 10.04 because I like the interface better that 12.04. If I have to start fresh, Is there any advantage to up to Ubuntu 12.04 to run Virtualmin versus staying with Ubuntu 10.04 ?

I would highly recommend against using a GUI on servers... which would then become a great way to learn both the command line, and Virtualmin :-)

If I was starting fresh, I would personally use Ubuntu 12.04, purely because it has more recent software, and it's supported until 2017.

There's nothing wrong with Ubuntu 10.04 though, and it'll be supported for a little over two years now, until April 2015.

-Eric

Wed, 12/12/2012 - 09:53
Locutus

Actually, you CAN start using RAID even after the system is installed. :) The fact that RAID drivers get loaded doesn't mean the existing disks (where the system is currently booted from) MUST be RAID.

All you really need to do is go to Aptitude and install "mdadm". Then you can make RAID arrays, from the command line or Webmin's RAID module (after you rescan the available modules so it picks up the change).

Not sure if the same is true for LVM though, haven't really used that yet. But I guess it should be.

Of course you should first ponder if you really need it or what you intend to do with it. Both RAID and LVM add a considerable level of complexity to your setup, and especially as a newbie to Linux, you might want to keep things simple.

I agree with Eric that it's not recommended to have a GUI on a server.

Also I'd suggest using Ubuntu 12.04, for exactly the fact Eric mentioned -- it has much newer versions of most software packages. Installing Ubuntu 10.04 in the Linux world now is like using Windows XP as opposed to Windows 7.

Wed, 12/12/2012 - 10:41
andreychek

Actually, you CAN start using RAID even after the system is installed

Well, all I meant is that you can't, to my knowledge, convert an existing OS install to RAID5, or something similar, that would allow him to expand the storage of his current system on the fly.

You can do it, but not without migrating to a new set of disks :-)

That said, doing a little digging, I ran into the post... which is apparently a very intriguing way for brave folks to convert from RAID1 to RAID5 :-)

http://www.n8gray.org/blog/2006/09/05/stupid-raid-tricks-with-evms-and-m...

-Eric

Wed, 12/12/2012 - 12:59
PepinYaco

Thx Eric and Locutus for ur help. I will do some ready on that post u found Eric. I was just setting the LVM on the laptop when I had to rum out, so I'll let u guys know what the heck happen.

@ Locutus, I understand what u said about keeping things simple and I also apresiate the warming lol about things getting complicated on later times, for now I'm gonna give this LVM a try and if it don't work ( what I really mean is is I can't get it to work lol) them ill use my biggest hard drive for the sever n Virtualmin and keep learning as I go.

All I'm basically looking for is more space on the server to allow for more storage space, but had no idea it can be this complicate for someone like me that knows so little about the matter.

BTW maybe later I'll give mdadm a try, I mean is not like if I am some kind of Webhost or something like that.

Wed, 12/12/2012 - 15:18
PepinYaco

Well Im still at work and just install LVM and I dont think is was complicated at all (so I think i did). I would have to install it on the server whch has 4 HD's and play around with it,
here is the output i get when i use the command sudo fdisk -l


Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00043d16

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 206847 102400 83 Linux
/dev/sda2 206848 488394751 244093952 7 HPFS/NTFS/exFAT

Disk /dev/mapper/sysvg-lvswap: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/sysvg-lvswap doesn't contain a valid partition table

Disk /dev/mapper/sysvg-lvroot: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/sysvg-lvroot doesn't contain a valid partition table

Disk /dev/mapper/sysvg-lvhome: 227.4 GB, 227402579968 bytes
255 heads, 63 sectors/track, 27646 cylinders, total 444145664 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/sysvg-lvhome doesn't contain a valid partition table

Of course, this is a laptop so I only have one hd install on there but, just wanted to chek if this output looks abut right. thx

Thu, 12/13/2012 - 09:36
Locutus

Well, all I meant is that you can't, to my knowledge, convert an existing OS install to RAID5, or something similar, that would allow him to expand the storage of his current system on the fly.

Ooh, I'm sorry, misunderstanding there. :) I thought you were talking about RAID in general.

You're right of course, moving an existing installation from non-RAID to RAID would require migrating the stuff to a new filesystem. Which does work - I already did that several times in both directions. On virtual machines, but the principle is the same.

Thu, 12/13/2012 - 10:21
PepinYaco

Wow guys I hope that in the feature when I understand a little more of this, that I can come back here, read ur guys subjections and be able to do as subjected and laught at my self. Lol

Here is just an update. I don't think my system likes the LVM stuff because it keep saying that it could not find /dev/sda2 device or something like that. I only had about an hr to play with this, but I will give it another try over the weekend.

BTW Locutus, out of curiosity did you take a the server I have ( link is at the very first post here) to have a better idea of how my 4 hard drives are setup? It could be that, that the lvm instalaciĆ³n didnt like that hard drive setup in the machine.

Thx Guys, i wish i was more knowledgeable on the topic, I want to hit my self over the head right now lol.

http://h18004.www1.hp.com/products/quickspecs/12364_na/12364_na.html

Thu, 12/13/2012 - 11:09
Locutus

So you have one 250 GB HDD in use right now, for the whole filesystem, and have three HDDs (250, 750, 750 GB) unused, correct?

Well, there are many use cases, and it's a bit hard to give an advice that fits your requirements/filesystem layout. :)

Basic question is whether you want the three HDDs to appear as one big honkin' volume, or if you want/can spread their space out over several places (i.e. directories).

In the latter case, it's easiest to just create a standalone filesystem on each of them, and mount them where they are most useful, e.g. as "/home". You can also mount one HDD as "/home", and another as e.g. "/home/someuser", if that someuser needs especially much disk space.

If you need one big volume, you could use LVM, though as you experienced, its setup is not trivial. Webmin should help you set it up though, so that you don't need to fiddle with the myriads of parameters to the LVM management commands.

Another choice would be to make a RAID-0 (striping) out of the two larger HDDs. That's considerably easier to set up, and yields a huge performance boost, but has the disadvantage that the data on both drives are lost if one becomes defective.

Or you could make a RAID-1 (mirroring) out of the larger HDDs, which means double read speed, single write speed, but lose 50% of the capacity.

The possibilities are endless. :D

Thu, 12/13/2012 - 12:23
PepinYaco

hay hay hay lol i can see that the possibilities are endless.

- For your first question... one whole filesystem, and have three HDDs (250, 750, 750 GB) unused, is correct.

- For your second question... "one big honkin' volume, or if you want/can spread their space" One big volume would be nice, because I would not have any idea how to acomplish the "create a standalone filesystem" which in that case, would be me, that needs the most space. (what you explained on your 4th parrograph).

Other than that, sonds like LVM or RAID-0 would be the esiet way to go.

- You know how liitle i know about this, what would you say I go for?
- RAID-0 also need to be setup before I install anything else right?

Thu, 12/13/2012 - 13:56
Locutus

With "standalone filesystem" I just meant creating a filesystem directly on your HDDs, without a layer inbetween like LVM or RAID. You'll need to create an FS anyway, regardless. That's easily done with the "makefs" command or from Webmin.

RAID-0 is rather easy to set up, yes. Can't speak for LVM, not yet used productively. If you want one volume over all three HDDs, you'll need LVM, because RAID needs HDDs of equal size (or rather, the smallest HDD dictates the space on the final array).

RAID needs to be set up, yes. You need to install the mdadm package and then click your way through Webmin's RAID module. And no, I can't give you a step-by-step there, that'll be too much to type. :P

Thu, 12/13/2012 - 14:12
PepinYaco

thx Locutus, I will try LVM (again) next on the server, will post back as soon as I get eny results. i understand about the typing and the commands thx for helping

Sun, 12/23/2012 - 11:43
PepinYaco

Hi guys, Just a quick Update.

I manage to install LVM now Virtualmin see all drives and it saids that I have close to 2T of disk storage. But not without doing some extrat steps. At least I have a better Idea of what I have to do next time.

@ Eric and Locutus thx for all your help.

Sun, 12/23/2012 - 14:41
Locutus

Good to hear, and merry X-Mas! :D

Mon, 12/24/2012 - 16:58
PepinYaco

This is what I think worked for me, (a least I think id did). Please correct me If I did some that was not correctly done.

BUT: system disk still untouch, LVM was install on the extra hd, in other words, I installed LVM on the second 250GB drive, (sdb) not the 250Gb (sda) drive that alreaddy had Linux installed. Virtualmin System Information shows, Local disk space 1.75 TB total, 201.60 GB used, But I dot think I can use any of the other hard drives (sdc and sdd) for storage space yet.

As of right now vistualmin shows that I have Local disk space 1.75 TB total, 168.78 GB used. The Only problem is that I can not manually copy/paste files to any of the added drives and they all have a lost+found folder (dont know what that is for) inside the two 750Gb drives and the 250GB drive.

Install LVM in ubuntu 12.04

Part (1)
- login to a live ubuntu
- open text editor
- open gParted
- open terminal
- open url: https://help.ubuntu.com/community/UbuntuDesktopLVM (for a fully detaile instructions)
- clean all existing hard drives (formated them to ext4)
- Install lvm2: sudo apt-get -y install lvm2 (on the live section)

note: this command should had 'Create the physical volume', (sda2) but for some reason, it did not, I had to create the partition manually (30GB on a 250GB disk).

Part (2)
- make a sda2 partition manually (on the system disk)
-- click on Device -> Create partition tatle
-- click apply
-- right click -> new -> 30720MB -> add -> apply
-- right click the new partition (30GB) and select new
-- select ext4 -> add -> add -> apply

note: to delete a lvm partition, I had to delete the partition then restart the computer so the system would accept the new changes.

- Create the physical volume: sudo pvcreate /dev/sda2
- Create a group using our newly create physical volume: sudo vgcreate sysvg /dev/sda2
- creates a new volume group which is tided to a physical volume: sudo lvcreate -L 1G -n lvswap sysvg
- Create the root logical volume using the newly create sysvg group: sudo lvcreate -L 20G -n lvroot sysvg
- Create the home logical volume using the newly create sysvg group: sudo lvcreate -l 100%FREE -n lvhome sysvg
- Build linux file systems for all newly created logical volumes:

- sudo mkfs.ext4 /dev/mapper/sysvg-lvroot
- sudo mkfs.ext4 /dev/mapper/sysvg-lvhome
- sudo mkswap -f /dev/mapper/sysvg-lvswap

- Double click on "Install Ubuntu"
- select both "Download updates while installing" and "Install this third-party software" (optional)
- select 'Something else'
- Scroll down the list to the bottom and highlight /dev/sda1 and press the "Change..."" button.
- Use as: ext4journaling file system
- Mount point: /boot
- Now lets scroll up to the top and highlight the /dev/mapper/sysvg-lvhome partition that has the "ext4" next to it. Click on "Change"
- Use as: ext4journaling file system
- Mount point: /home
- Now lets scroll up to the top and highlight the /dev/mapper/sysvg-root and press the "Change..." button.
- Use as: ext4journaling file system
- Mount point: /
- Now lets scroll up to the top and highlight the /dev/mapper/sysvg-lvswap and press the "Change..." button.
- here just click Ok

note: I did not install any OS in this case. But you could press the "Install Now" button to start the installation process. Make sure you DO NOT PRESS "Restart Now". You want to press the "Continue Testing" We need to install lvm2 it onto your newly setup Ubuntu instance. The commands below will help do this.

- Install lvm2 onto your new Ubuntu Install. Mount your system into /mnt/:

- sudo mount /dev/mapper/sysvg-lvroot /mnt
- sudo mount /dev/mapper/sysvg-lvhome /mnt/home/
- sudo mount /dev/sda1 /mnt/boot (error: mount point /mnt/boot does not exist)

- We need to first mount your root file system to /mnt.
- sudo chroot /mnt (error: failed to run command `/bin/bash': No such file or directory)

All i wanted was to use all available hard drives on my system as if is was just one whole drive (about 2T).

merry xmas to all here too. thx

Mon, 12/24/2012 - 18:18
PepinYaco

wow this multiple hard dive stuff is driving me crazy. Im gonna start fresh installing LVM on a fresh disk and then install ubuntu 12.042 and Virtuamin on it. Will post result as soo as I can, but if anyone has a subjection, please post it here. Thx

Thu, 03/05/2015 - 12:29
stheoret

Hi !

I have installed virtualmin/webmin first on a 80GB disk. Then i cloned that disk on a 500GB with Clonezilla. Even if i have 420 GB free disk space on it, it do not show available for the system.

What actions do i have to do ( i do not want to loose data btw ), to merge the /dev/sda2 ( 74.04 gb ) with my /dev/sda3 ??

i have downloaded gparted but can't resize the /dev/sda2 ( lvm2 pv )... I have an option on right click ( deactivate ), but i am not willing to click it and loose data... Or do i have to click it in order to be able to resize it ?

Thanks for any help...

At final, i want only the /dev/sda2 to have the full disk space and no more /dev/sda3.

stephane

Fri, 03/06/2015 - 03:30
PepinYaco

I think ur problem is ur cloning... I'm not an expert tho, so I hope this helps (Here is what I did a while back. This is my own private server and I use for my own reference http://marcosaquino.noip.me/forum/showthread.php?13-Use-Clonezilla-to-cl...

Topic locked