One For The Linux Guys Initial Server Configuration Best Approach?
Howdy all I am in the process of setting up a Ubuntu Server now before I go live and actually build a system I am going to be practicing virtually
Because I am very new to Linux I will try and keep what I am trying to achieve simple In this example I will be using low sized Hard Disks just to try and get my head around things.
So in Virutal Box I have two 10 Gig Hard Disks ( sda and sdb)
I basically want to setup some kind of redundancy and have a share for data which can be accessed via SAMBA
I have kept the partitions low obviously in real life they would be alot bigger
SDA
/ boot - 200mb
/ 2 GIG
/HOME - 2GIG
/DATA - 2 GIG
SWAP - 2 GIG
SDB
Partition layout godknows*
Question is how does the Second disk fit in this? Like I said I want some kind of Raid or is LVM the best approach? I have read various documentation but am getting nowhere and am getting quite disheartened just need somebody to explain what is the best approach to setup a partition scheme on two drives
Given the scenario of having 2 small hard disks how would you best go about setting up a partition scheme I need the explanation to be very easy to follow and concise because I am a numpty haha
I do intend to document everything I do and give back to the community in a form of a blog once I have reached guru stage, Once again many thanks for your help I really do appreciate it
Because I am very new to Linux I will try and keep what I am trying to achieve simple In this example I will be using low sized Hard Disks just to try and get my head around things.
So in Virutal Box I have two 10 Gig Hard Disks ( sda and sdb)
I basically want to setup some kind of redundancy and have a share for data which can be accessed via SAMBA
I have kept the partitions low obviously in real life they would be alot bigger
SDA
/ boot - 200mb
/ 2 GIG
/HOME - 2GIG
/DATA - 2 GIG
SWAP - 2 GIG
SDB
Partition layout godknows*
Question is how does the Second disk fit in this? Like I said I want some kind of Raid or is LVM the best approach? I have read various documentation but am getting nowhere and am getting quite disheartened just need somebody to explain what is the best approach to setup a partition scheme on two drives
Given the scenario of having 2 small hard disks how would you best go about setting up a partition scheme I need the explanation to be very easy to follow and concise because I am a numpty haha
I do intend to document everything I do and give back to the community in a form of a blog once I have reached guru stage, Once again many thanks for your help I really do appreciate it
Microsoft's strategy to conquer the I.T industry
" Embrace, evolve, extinguish "
" Embrace, evolve, extinguish "
Comments
-
log32 Users Awaiting Email Confirmation Posts: 217not sure I understood the final goal but if you want to use your additional hard drive you can format it with ext3/4 and mount it as /backup, and if you want to replicate data you can do so with bash scripts or rsync
furthermore if you want to set up samba you need to download the appropriate packages and share that directory to your Win client, you can use this for more information regarding samba. -
ally_uk Member Posts: 1,145 ■■■■□□□□□□I think I am trying to over complicate things or am trying to bite off more than I can chew I have been reading about stuff like LVM for the last few days and am still failing to understand it.
I basically wanted to build a system with 2 hard disks and just wanted to know what is the best way to go about partitioning the disks.Microsoft's strategy to conquer the I.T industry
" Embrace, evolve, extinguish " -
log32 Users Awaiting Email Confirmation Posts: 217LVM allows you to combine several disks / partitions into a volume group, and then you can create logical volumes and reduce/extend them as you like, and you can always add more disks to that group if you wish.
for example:
we have a server with 2 physical disks (512GB each), and no partitions.
you need to "convert" these disks into physical volumes (PV)
you then execute a command such as pvcreate /dev/sda /dev/sdb to have them used later in our LVM.
now we need to gather those 2 physical volumes under our volume group, let's call the volumegroup TE-VolumeGroup.
so you execute a command like vgcreate "TE-VolumeGroup" /dev/sda /dev/sdb
so now we have a volume group with 2 HDDs, total of 1TB with the name "TE-VolumeGroup"
now after we have the volume group set, let's say you want to add a backup partition with 3GB of storage (from our 1TB VolumeGroup) to your system
you then need to create a logical volume that will be a part of the volume group TE-VolumeGroup.
so you do something like lvcreate -L+3GB TE-VolumeGroup -n NewBackupVolume
so now we have a new logical volume called NewBackupVolume and it is a part of the TE-VolumeGroup.
afterwards you can simply format it with ext4
mkfs.ext4 /dev/mapper/NewBackupVolume (example)
and mount it with:
mount /dev/mapper/NewBackupVolume /backup
and you have a 3GB partition mounted in backup
it's a little tricky, but once you practice LVM a little from CLI, you will get the idea
thought maybe if I visualized it for you youd understand better so:
-
ally_uk Member Posts: 1,145 ■■■■□□□□□□Thank you for the explanation thing is though with that example where is the main operating system installed? do you have a third drive strictly for the O/S? this is the confusing part for meMicrosoft's strategy to conquer the I.T industry
" Embrace, evolve, extinguish " -
log32 Users Awaiting Email Confirmation Posts: 217LVM is set up upon installation, normally you would get the / under a logical volume and /boot seperated from the LVM.
you can do so manually or let the installation do the dividing for you -
ally_uk Member Posts: 1,145 ■■■■□□□□□□Is there a idiots guide to actually getting a Linux Server off the ground?
A simple guide to setting up a Linux Server including setting up a partition scheme which incorporates multiple hard disks does such a easy to follow guide exist? or does anyone have any tutorials / easy to follow guides or blogs including configuration of basic services preferably without use of tools such as webmin or zentyal.
Sorry I am asking loads of questions I am absolutely clueless when it comes to Linux I have read numerous books designed for beginners but end up with nothing but a headache making the transition from Windows is hard
Any noob freindly documentation out there?
I think I may skip LVM for now it just goes over my head
The partition scheme I have in mind is this please feel free to critique and call me a idiot and point me in the right direction
* Allys Server Setup *
1X 250 GIG Hard disk (SDA)
/boot - 200MB
/root - 10Gig
/home - 20 Gig
/swap - 2 GIG
= Lot's of free space on this disk left over so I am left with about 218Gig unpartitioned space
*218 Gig free on SDA
Second Hard Disk (SDB)
250 GIG
I want to be able to create a share called /data and combine the 218 Gig leftover from SDA with SDB given a total of 468GB for data storage.
That is what I am trying to achieve and am failing to get my head around feel free to hurl abuse my way I have been having nightmares about partitioning seriously I kid you not
Thank you for being patient with me like I said the eventual aim oneday is to give back to the community document everything I learn in a clear concise idiot manner haha who knows my lack of ability to understand partitioning may aid somebody else in there quest to conquer LinuxMicrosoft's strategy to conquer the I.T industry
" Embrace, evolve, extinguish " -
log32 Users Awaiting Email Confirmation Posts: 217create a partition from the unpartitioned space you have left in sda, same goes for the 2nd hard drive
combine them both to a VolumeGroup like I showed, then you will have the storage combination of the two. -
UnixGuy Mod Posts: 4,570 ModAlways have your root disk redundant (Raid 1). Check your hardware if it has a built-in Raid driver, then you can use hardware RAID. Otherwise, just mirror everything using the software raid facility that you have with Ubuntu.
Best practice (in general), have your root disk mirrored, and then use an external storage for your data file system (where there is redundancy from the SAN itself).
Personally, I'd never run a server without the root disk mirrored -
ally_uk Member Posts: 1,145 ■■■■□□□□□□Thanks Unix Guy I do not have access to hardware raid so it will have to be at a software level. Do you have simple instructions and a partition layout to raid both disks?
basically am working with 2x250 Gig Hard Disks only urgent thing I need is a share which will be mounted for data
Many ThanksMicrosoft's strategy to conquer the I.T industry
" Embrace, evolve, extinguish " -
UnixGuy Mod Posts: 4,570 ModTo mirror everything, make sure that both disks have the exact same partition. 250 GB is a large and great.
I would do something like this:
/boot = 250MB (or 300 MB).
/ = 20 GB (including: /home, /var/,..everything.)
/swap = this is a controversial topic, you can assign twice the RAM or 1.5 the RAM, if your RAM is less than or equal 16GB.
/Data = the rest of your disk.
The software RAID 1 on linux is achieved with 'mdadm. (you don't need LVM since you only want to mirror your disk).
Check this for an example:
http://www.cyberciti.biz/faq/centos-redhat-rhel-linux-setup-create-raid1/
Adding a mirror to Ubuntu 9.10's boot drive with mdadm | Alchemy Computer Solutions -
ally_uk Member Posts: 1,145 ■■■■□□□□□□Many thanks unix guy for providing excellent links.
Reading through the advanced installation of Ubuntu it has a example which shows you how to configure a raid-1 mirror during install.
In the example you configure the partitions for swap and / on both disks before specifying and configuring the raid level you then set the / as a bootable flag.
This may be a silly question but why is there a boot partion in the example I thought everything linux install had to have a boot partition where the bootloader is installed to? or does adding the bootable flag to / override this?
ThanksMicrosoft's strategy to conquer the I.T industry
" Embrace, evolve, extinguish " -
UnixGuy Mod Posts: 4,570 ModGood question. Having /boot is not mandatory, you can simply install everything under "/", this will include /boot, /usr, /etc/,/home, or you can have /boot on a separate 200MB or 300MB partition. It's an old practice to have "/boot" on a separate file system, and that might have some advantages
Some opinions here:
Installing ubuntu do I really need a boot parition? - Super User
What is the recommended size for a linux /boot partition? - Server Fault
(Personally, I don't have a separate partition for /boot, I don't see any practical advantage )
As for the boot flag, during the initial installation, it is created for you by default. I think the step in your example was redundant perhaps just to show you how to create a bootable drive manually. Try the example again without manually installing a boot flag, I think it should work.
another installation tip: Once the installation/Configuration is done, update your packages, and maybe disable the unnecessary services that you don't use to harden your system -
ally_uk Member Posts: 1,145 ■■■■□□□□□□Many Thanks again you have explained things in a clear and concise manner ever considered becoming a Linux trainer?
How did your journey with Linux start? did you start out with UNIX? I have been a windows user all my life since 3.1 never heard of Linux or UNIX until a few years ago I was told to install Debian on a Pentium 3 machine at work for a firewall build I was like " ok what version of windows do you want? linux? wtf is linux?"
It has been a hobby ever since for me although I am now making a serious effort to build a foundation of knowledge I am going to start out by reading and working my way through
Linux Essentials Roderick Smith
Linux Command Line A Complete Introduction
Afterwards I will be working my way through Linux+ Roderick Smith in conjunction with the train signal videos in a attempt to obtain certification and follow my dream of working with Linux and Open Source Technologies I don't want to be able to just understand how to answer multiple choice questions I want to develop a clear understanding of the foundational skills hence the reading of the above books.
The partitioning originally for me was a bit scary although maybe I was jumping the gun a bit with LVM, You don't really tend to get a feel for LVM configuration until you start the RHCSA materials which for me is a long way away
But hey Rome wasn't built in a day and going with the foundation route and learn the basics is what I intend to do.
I have a basic understanding of the CLI can use commands like Grep to pipe commands and navigate around I can also use rpm and Apt and dpkg to manage packages. I have setup basic services in the past FTP and SAMBA but these were obviously from following guides ask me to do it off the top of my head and I wouldn't have a clue
I'm not a programmer I don't have the mentality I do have a stupid idea of teaching myself BASH scripting oneday whether I achieve this who knows the first mention of arrays, variables, loops and I go into meltdown
Thank you for the advice though it means alotMicrosoft's strategy to conquer the I.T industry
" Embrace, evolve, extinguish " -
UnixGuy Mod Posts: 4,570 ModMany Thanks again you have explained things in a clear and concise manner ever considered becoming a Linux trainer?
How did your journey with Linux start? did you start out with UNIX?
Glad that I could help I trained few clients after implementations. My journey started, little bit of programming on linux platform at uni, but my support/administration start was when I got a job with a company that sells and supports Unix solutions. I learned Linux on the side because most of my work was on Unix.I have been a windows user all my life since 3.1 never heard of Linux or UNIX until a few years ago I was told to install Debian on a Pentium 3 machine at work for a firewall build I was like " ok what version of windows do you want? linux? wtf is linux?"
ClassicIt has been a hobby ever since for me although I am now making a serious effort to build a foundation of knowledge I am going to start out by reading and working my way through
Linux Essentials Roderick Smith
Linux Command Line A Complete Introduction
Afterwards I will be working my way through Linux+ Roderick Smith in conjunction with the train signal videos in a attempt to obtain certification and follow my dream of working with Linux and Open Source Technologies I don't want to be able to just understand how to answer multiple choice questions I want to develop a clear understanding of the foundational skills hence the reading of the above books.
I haven't read those books, but Linux+ is a great start! Install Linux on VMware and do everything in the books until you master it. I strongly recommend this book:
Pro Linux System Administration (Expert's Voice in Open Source): James Turnbull, Peter Lieverdink, Dennis Matotek: 9781430219125: Amazon.com: Books
It's an excellent book and it doesn't assume any Linux knowledge. you will learn a lot from this book.
The partitioning originally for me was a bit scary although maybe I was jumping the gun a bit with LVM, You don't really tend to get a feel for LVM configuration until you start the RHCSA materials which for me is a long way away
But hey Rome wasn't built in a day and going with the foundation route and learn the basics is what I intend to do.
I have a basic understanding of the CLI can use commands like Grep to pipe commands and navigate around I can also use rpm and Apt and dpkg to manage packages. I have setup basic services in the past FTP and SAMBA but these were obviously from following guides ask me to do it off the top of my head and I wouldn't have a clue
Starting with LVM can be overwhelming and a bit disheartening. In production environments usually the local drives are mirrored (ideally using hardware RAID) and used only for the root disk, while the data comes from SAN storage, and thus LVM isn't needed. When you read LVM and practice, you will know that it is pretty straightforward. For the network services (FTP, Samba, DNS,..etc), I recommend the book I mentioned above to master those topics, and more
I'm not a programmer I don't have the mentality I do have a stupid idea of teaching myself BASH scripting oneday whether I achieve this who knows the first mention of arrays, variables, loops and I go into meltdown
you don't need programmer's mentality to learn scripting. Scripting is a basic form of grouping a set of commands in a file to perform repetitive tasks. Learn how to use a variable and how to do loops, and you are set. For that I recommend this book:
Linux Shell Scripting with Bash: Ken O. Burtch: 9780672326424: Amazon.com: Books
This is an excellent book that will teach you a lot. You don't need all the topics in the book though. It will give you what you need.
Start with Linux on VMware, and practice with those books, it will get your foot in the door for a full time Linux job. Enjoy