You are here
Nick Apperley - Wed, 2012/05/09 - 04:29
After doing the installation of the TurnKey File Server 11.3 appliance I realised that I forgot to partition the second disk. What is the name of the partitioning tool used by the TurnKey installer?
I need to partition the second disk before setting up disk mirroring (RAID). Will I need to do anything after partitioning the disk in the way of mounting? I'm not sure if the VIA SATA disk controller has hardware RAID support, is there a straightforward way to find out via the console?
Please bear with me as this is the first time I am setting up RAID in Linux. I'm so used to administering and using Linux desktop PCs that I havn't got much in the way of server side experience, and knowledge.
Forum:
Tags:
With the different options
With the different options for partitioning a hard disk in Linux I would prefer to use the same one used by the Turnkey installer. Right now I'm wondering if there is a straightforward way to copy the partition table from the hard disk used during the install to the empty one (hasn't got a partition table).
Bit lost with the command line partitioning tools since each one does the partitioning in a different way which seems alien. Busy guessing which one was used by the Turnkey installer. Attempted to use cfdisk but its output on the partition table for /dev/sda isn't very helpful, especially when trying to create an exact match on /dev/sdb. There doesn't appear to be any options to create each partition based on the start and end blocks with cfdisk so i'm a bit stuck.
Mirroring The System Partition
Got the partition table cloned from /dev/sda to /dev/sdb with sfdisk. After cloning the partition table I attempted to create RAID 1 between /dev/sda1 and /dev/sdb1 using mdadm. Ended up with an error message, see the details below:
mdadm --create /dev/md0 --level=raid1 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm --create /dev/md0 --level=raid1 --raid-devices=2 /dev/sda2 /dev/sdb2
Cannot open /dev/sda1: Device or resource busy
I know nothing about RAID
So can't be of much help with that but personally I use fdisk for partitioning and find it pretty straightforward.
Also keep in mind that by default TKL uses LVM. LVM inconjuction with RAID may add complexity to your config.
As for your issues with mdadm I have no idea...
If you keep in mind that TKL v11.x is Ubuntu 10.04 under the hood you should be able to find info that is relevant.
Not Using LVM
With the partitioning the File Server is not using LVM. Is it possible to mirror a partition that is already mounted (incl the system/root partition)?
Ubuntu page for raid
https://help.ubuntu.com/10.04/serverguide/advanced-installation.html
here is the ubuntu guide for raid and mdadm for 10.04 .
Follow the installation steps until you get to the Partition disks step, then:
Select Manual as the partition method.
Select the first hard drive, and agree to "Create a new empty partition table on this device?".
Repeat this step for each drive you wish to be part of the RAID array.
Select the "FREE SPACE" on the first drive then select "Create a new partition".
Next, select the Size of the partition. This partition will be the swap partition, and a general rule for swap size is twice that of RAM. Enter the partition size, then choose Primary, then Beginning.
Select the "Use as:" line at the top. By default this is "Ext4 journaling file system", change that to "physical volume for RAID" then "Done setting up partition".
For the / partition once again select "Free Space" on the first drive then "Create a new partition".
Use the rest of the free space on the drive and choose Continue, then Primary.
As with the swap partition, select the "Use as:" line at the top, changing it to "physical volume for RAID". Also select the "Bootable flag:" line to change the value to "on". Then choose "Done setting up partition".
Repeat steps three through eight for the other disk and partitions.
Advanced Install Guide Not Very Relevant
Unfortunately the guide you have pointed me to isn't very relevant. Have already gone through the TurnKey installer. Need a guide for setting up RAID 1 that solely uses the console, not the Ubuntu Server installer.
Unless there is a way to bring up the TurnKey installer again from the installation then the guide won't be of much use.
No Option To Setup Raid In TurnKey Installer
Ended up reinstalling TurnKey 11.3 (File Server) in order to follow the instructions for doing an Advanced Install but hit a major roadblock. No options in the installer for setting up RAID. Now i'm truely stuck.
Here's what google found
This looks like it is a pretty comprehensive step-by-step guide. It's actually for Debian but should be close enough (hopefully).
http://feeding.cloud.geek.nz/2011/03/setting-up-raid-on-existing.html
Have a crack and see if that works for you.
If a step doesn't work post back and I'm happy to help troubleshoot.
Mirroring Appears To Be Setup
Right now i'm at step 5 in Setting up RAID on an existing Debian/Ubuntu installation.
I had shutdown the server for the night and started it up again, and tried to mount /dev/md1 to /tmp/mntroot but ended up with the following message:
mount: you must specify the filesystem type
Now i'm wondering why the message has appeared. Need to have /dev/md1 mounted in order to alter the fstab file, otherwise there is no way to test if RAID is working. Even if I do make it to that point there is the issue of getting the GRUB menu to appear. Have tried repeatedly pressing right shift before TurnKey boots but to no avail.
I'm not sure what's happening.
A quick google suggests that something is not quite right. Others with similar message seem to be suffering from some sort of disk corruption, but my searching wasn't exhaustive so perhaps I missed something.
In the instructions it says to change fstab on both drives prior to boot, perhaps that's the issue? Or maybe the instructions are mistaken and you need to mount it as sdx1 in that instance?
All just guesses really...
As for grub stuff, you may need to adjust the grub timeout. Have a search for configuring grub2 and you should find info on how to do that. Otherwise you can probably ensure grub is setup to boot off the RAID prior to reboot.
Also it's probably worth reading the comments of that blog post (if you haven't already) as it looks like there may be some relevant stuff there.
Most Likely The VIA Disk Controller
Did notice during the rsync process that there were some data transfer errors. Been looking at the kernel log via dmesg and spotted a few DMA read errors. Looks as though the VIA disk controller has reared its ugly head again. Below is a section from the kernel logs:
Definitely something wrong
Also is it reporting as FAT too!? Or is that another drive?
Two SATA Disks - RAID 1 With Ext4
Puzzled with the FAT message, absolutely bizarre. None of the SATA drives contain a FAT filesystem. Both drives contain the same partition table and use the same file systems, Ext4 and Swap.
All seems very strange...
And TBH I'm out of ideas. Perhaps it's worth posting on the Ubuntu forums? Hopefully someone with more knowledge than me can help you out.
Or on another tangent, perhaps you could investigate mirroring via LVM instead of using RAID? I know it's possible but I've never done it.
Add new comment