3

I rented a server from a provider and they won't install RAID0 without an additional fee.

So I'm trying to figure out how to link these two drives so that my programs that are installed on the hard disk will see the space from the second drive.

This is how it's setup:

df -h:

Filesystem                                    Size  Used Avail Use% Mounted on
rootfs                                        139G   93G   39G  71% /
udev                                           10M     0   10M   0% /dev
tmpfs                                         599M  208K  599M   1% /run
/dev/disk/by-uuid/e7a9cc0e-9caa-4d33-b60f-... 139G   93G   39G  71% /
tmpfs                                         5.0M     0  5.0M   0% /run/lock
tmpfs                                         2.7G     0  2.7G   0% /run/shm
/dev/sda1                                     961M   36M  877M   4% /boot
/dev/sda5                                     139G   93G   39G  71% /media/hd

fdisk -l:

Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders, total 312500000 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: 0x00066abb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2000895      999424   83  Linux
/dev/sda2         2002942   312498175   155247617    5  Extended
/dev/sda5         2002944   296499199   147248128   83  Linux
/dev/sda6       296501248   312498175     7998464   82  Linux swap / Solaris

Disk /dev/sdb: 160.0 GB, 160000000000 bytes
58 heads, 29 sectors/track, 185790 cylinders, total 312500000 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: 0x00088a99

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   312499999   156248976   83  Linux

I did my best with my n00bness to mount the 2nd drive. Does anyone know what I need to do to make the drives show up as one?

Runium
  • 28,811
  • Ditch your provider and get a better one that supports their hardware? Heck, I'll rent you a server with RAID 0 or 1. – Wesley May 28 '13 at 00:58
  • Probelm is they are the best in my small price range. They would do the raid for me but wanted 22$ to install it. So i was like hell with that. –  May 28 '13 at 01:03
  • What two drives are you going to RAID? /dev/sda5 and dev/disk/by-uuid/e7... are almost certainly the same volumes given their stats. I suspect your provider just provides the /media/hd mount point as a convenience. – jscott May 28 '13 at 01:07
  • That was the mount i made from /dev/disk/by-uuid/e7a9cc0e-9caa-4d33-b60f-f1a2b4ad0ae8 id i not have to mount the e7a9cc drive? –  May 28 '13 at 01:08
  • Do you have the ability to reboot into a rescue mode? Most providers offering dedicated servers give you either a rescue mode where it boots from the network or an IPKVM with virtual media. It can be done from there, but can't be done from the running OS. If you have that ability, I'll post instructions. I had the same issue with my provider. – Grant May 28 '13 at 01:26
  • I'm not sure if i have the ability to do that or not. They told me i could install raid myself using a control panel but would have to pay 10euros for that as well. Like my nick says i'm a scrub when it comes to linux, only know basic commands. –  May 28 '13 at 01:32
  • Can we get the output of fdisk -l in addition to the df output? It's a little unclear which ones are the drives you want to mirror. – Bratchley May 28 '13 at 02:00
  • http://pastebin.com/4WutGjAK that is the fdisk and http://pastebin.com/ByJnEEaq that is the df output – linuxscrub20 May 28 '13 at 02:05
  • @JoelDavis I don't think the OP wants to mirror. RAID-0 is striping. – Anthon May 28 '13 at 09:37
  • @Anthon Ah, yeah I guess I glossed over that part. – Bratchley May 28 '13 at 11:25
  • @linuxscrub20 There's a way to set up a mirror(that covers full LVM migration which you may or may not want, LVM natively supports striping logical volumes), either as a final point or an intermediary step. But since this is the root filesystem it would require a boot into rescue mode so you could re-size the filesystem down in order to make room for the metadata. I have to go to work but I can post more later on tonight. – Bratchley May 28 '13 at 11:25
  • Basically, my suggestion is to create analogous logical volumes on the new drive and then use mdadm to mirror the individual partitions to their LVM analogs, then once the mirror is completed, break the mirror, pvcreate the source volumes and expand out the new logical volumes as you see fit. – Bratchley May 28 '13 at 11:29

1 Answers1

1

If you just want to be able to store data in the extra space on the second drive you don't need RAID-0. If you just like mount it, as you indicate at the end of the post, you just have to make sure the sdb1 partition is formatted and mount it onto some specific place (just like /dev/sda1 can be accessed under /boot)

To see if /dev/sdb1 has a filesystem on it you can try:

sudo file -s /dev/sdb1

If there is no filesystem on /dev/sdb1, you need to format it. You best use the same format as you already have on some other partition to be sure it is supported by your system (use df -T to see the types of the mounted partitions).

To mount the filesystem, so you would have to determine where you want to mount it, make a directory there and issue the mount command:

mkdir /media/extra
mount /dev/sdb1 /media/extra

That would give you an extra 155Gb for your programs to use under /media/extra

If you really want to setup raid-0, which would give you the advantage of a bigger and faster virtual disc, you would have to partition disc sdb so you have two similar partitions to combine. That can be done, but one single false step and you have lost all your data. I would start with backing up your data. Then remove swap and make a /dev/sda6 a bootable installation and then combine sda5 and sdbX into a raid. I have done so for remote servers (with RAID-1, slightly easier), so it can be done. It is not something I would recommend if you don't absolutely need it and have experience at the level you indicate you have. (I have installed my first *nix in '84, but I still get sweaty hands doing a thing like that remotely, as it is really easy to loose contact with the machine completely if you forget something.)

Anthon
  • 79,293