Partitioning advice/help

C

ChristiW

Guest
Hi, I have spent the past week reading the articles and tutorials here on linux.org and I am still not able to wrap my head around partitioning. I understand it conceptually, but having a problem on LVM, Logical vs Primary and when to use what.

Right now I have Linux Mint with KDE installed. While it's great, it's not quite what I want in the long run. I have spent the past few days downloading different distros and playing around with them in a VM. I am either going to go with Debian 7.8.0 or Linux Mint Debian Edition. (Doesn't have the layer of Ubuntu on it, if I understand it correctly)

I ordered a new internal HDD for my laptop. My DVD player broke and instead of putting a new one in, I purchased an Optical Bay Caddy to replace the DVD with another HDD. Right now it has a very old HDD in it (only 149GB) and the new one will be 1TB.

The first drive is a 256GB SSD.

I have a dual boot system with Windows 8.1 and LM 17.1.

When the new HDD comes in, I will replace the old 149GB HDD with the 1TB HDD.

How I want the system to be (I will just put NTFS for the Windows Partition as it's not relevant for the partitioning, only the fact that it's there) once I reconfigure and install the new linux distro (whichever one I get) this is how I want to break it up.

what I have now:
sda
sda1 NTFS 350MB system reserve /boot
sda2 175GB NTFS (Windows)
sda3 /extended 63.1GB
sda5 ext4 / 20GB
sda6 linux/swap 8GB
sda7 ext4 /home

sdb
sdb1 NTFS 90GB
sdb2 extended
sdb5 etc4 media/christi/extra 59GB

I think I messed up and didn't know what I was doing when I set up the sdb drive. (Hence, my asking for help)

I would like (without going into sizing too much) is on the linux partition:
sda
/
/usr
/bin
/swap
(and everything else but the following)
on sdb
/home
/var
/tmp

I am going to be using a GUI to do this, so if someone can help and explain what I am doing (for example if the partition is to be set as primary -why is it primary?) I read a lot over at the Debian site, but a lot of that stuff was very very technical and went right over my head. I have been practising partitioning on the VMs I have created, but it's more or less hit and miss and I quite frankly, I just am not grasping what exactly what I am doing and why I am doing it.

I was hoping I wouldn't have to pose the question, as I know there is the information out there (and I have looked!), just all the sites, again, presume you know what the heck they are talking about and hardware really isn't my strong point.

What I really want, is not only "how" to do the partitioning, by the "why" I am doing it that way.

I am not well versed in the command line, I am pulling up the tutorials today for that... :)

Thank you everyone!

ETA: Since I am going to replace what I have, do I do any type of uninstall for Linux or just rewrite over the partitions on set up?

ETA: When I installed Debian in the VM, it had the guided with LVM and I did the option for doing the partitions the way I wanted, it worked perfectly and had the schema that I wanted, only the VM only allows you to have one drive (it may allow 2 drives, but I haven't figured out how to do it yet). When installing this way on my local system, will the guided with LVM partitioning allow you to set what drive the partitions go to?
 
Last edited:


M

Mitt Green

Guest
Since you have separated home partition, delete and then format everything (really need Windows?) with ext4 or xfs and install different distro. So you'll have three partitions:
Sda1 ext4(xfs) - for distribution itself,
Sda2 ext4(xfs) - for /home, bigger size,
Sda3 linux-swap - if you need it of course.
Don't forget about making a backup.
 
C

ChristiW

Guest
But I want them on different drives. I want the /home /var and /tmp on sdb and the rest on sda. I think / , /usr and /swap on sda.

I am mostly confused between when to do primary, logical and when to do extended in the partitioning. I think, because you can only have 4 primary partitions, I would have to do an extended on sda , but unsure on sdb.

I have an external hdd for backups and would like to set a backup plan after installing the new drive (sdb of 1TB).

Windows partition is business related and cannot be deleted.
 
A

atanere

Guest
But I want them on different drives. I want the /home /var and /tmp on sdb and the rest on sda. I think / , /usr and /swap on sda.

I am mostly confused between when to do primary, logical and when to do extended in the partitioning. I think, because you can only have 4 primary partitions, I would have to do an extended on sda , but unsure on sdb.

I have an external hdd for backups and would like to set a backup plan after installing the new drive (sdb of 1TB).

Windows partition is business related and cannot be deleted.
Your last statement is the one to strike me the most... I assume (and hope) that you are keeping a diligent backup of your Windows partition while you experiment with changing your partitioning scheme. I can tell from reading your posts that you are very intelligent and knowledgeable... but in one very quick "OH NO!" moment, you could have serious trouble with disk access. It is possible you could use disk rescue tools and get out of a jam, but I just don't want to see you get into a jam if it can be helped.

In my reply to you in another post, I lamented the current state of UEFI systems. So now is time for a turnaround to recognize that most modern computers using UEFI are also using GPT (GUID Partition Table) for hard disk layouts instead of Master Boot Record (MBR). Its hard teaching old dogs (me!) new tricks, but GPT gives some better partitioning options, with support for drives larger than 2 TB and up to 128 primary partitions.

OK, I'm in way over my head now. Good luck!
 
Z

ZZs

Guest
Boot needs to be primary and boot flag enabled. -sda ssd
LVM needs to be Primary -sdb sata
Swap needs to be primary -sda ssd
Everything else can be a LV- (logical volume) within your LVM if you choose.
I'd probably run / (root) on your sda ssd (25G) if you separate var on to sdb. If there together (50g-60g or more depending on your databases). If you're going to really go big on datatases consider 300g-500g on sdb for var. Or create sdb one LVM and +/- as necessary.
Use ext4 in the LVM. Xfs I think has issues in resizing.
Note: if var is segmented off from root in its own LV it will unmount before / (root) and it will splash an error during shutdown because the system can't wright to the log/journal. (Something like can't access var) In my opinion it doesn't matter at this point anyway, shes going down, but it does bug me. You may never see it running Mint depending on your "quiet" kernel setting.
Swap can actually go into the LVM but with the ssd and space I'd stay with the ssd if you think you'll need swap.
 
R

ryanvade

Guest
Here are a few tips:

If you are using an MBR partitioning system then you are limited to 4 primary partitions.

If you are using a GPT based partitioning system then you can have an unlimited number of partitions. BUT this is only compatible with UEFI and has the draw back of relying on UUIDs to locate partitions.

A primary partition is a set of blocks that are considered ONE file system. These are defaults for most OSs.

An extended partition is a special partition that can be thought of as a container of partitions. What this means is that you can have an extended partition that counts as 1 partition and inside of that extended partition you can have multiple logical partitions. The logical partitions do not count as real partitions as far as MBR is concerned but has the same draw back as GPT partitions.

When I dual boot with Windows, normally I put the entire Linux OS onto an extended partition divided into two logical partitions (/, and /home).

Logical partitions are named differently than primary and extended partitions.
Normally primary partitions start with /dev/sd(DRIVE LETTER)1 then /dev/sd(DRIVELETTER)2 and so on.

Logical partitions almost always start with /dev/sd(DRIVE LETTER)5 then /dev/sd(DRIVE LETTER)6 and so on. Normally the number is 2 higher than the extended partitions number.

If you want to use two different drives to hold different partitions you can.

Lets assume you have drives /dev/sda and /dev/sdb. You want /home, /var, and /tmp to be on drive sda and /, /usr, /swap on sdb.

To make things easy with windows we make an extended partition on sda1 (lets call it sda3)
then you can make an extended partition for each directory on sda
/home -> /dev/sda5
/var -> /dev/sda6
/tmp -> /dev/sda7

Now on sdb you don't care about the number of partitions so you simply make the partitions:

/ -> /dev/sdb1
/usr -> /dev/sdb2
/swap -> /dev/sdb3
 
Last edited:
C

ChristiW

Guest
@atanere - I am a database admin/programmer by trade and the only thing I am redundant about is backups! (backups of backups of backups!)I figure this is a Linux board so I don't speak about Windows, but I apply preventative measures for both systems. (Thank you for the compliment by the way :) )

@ZZs - Thank you! There reason I want /var on sdb is I am going to be doing database development and since it changes and writes and rewrites to disk, I want to extend the performance on my SSD. So, basically, I want most things that change often to be running on the HHD and programs that have hardly any change to be on the SSD.

I am going to be going with the Debian distro (Wheezy) the latest stable release. I will follow the "guided install" with LVM and just tweek the mount points if needed. I think Mint is a great distro, but I think it's geared for more everyday non-programming people. I want to learn Linux, so I think going with Debian I will learn a lot. I started with DOS 4 way back in the 80's, so I am not afraid of a computer. I also want to use the ability to create a VM (Windows doesn't allow me to- no SLAT). I might, once I get Linux down, just put Debian on and run my Windows 8.1 in a VM. I have to have Windows for business reasons but since I have put Linux on a couple of weeks ago, I haven't even logged into it for very long. Just did what needed to be done and then re-booted into Linux.

Thank you for your recommendations and advice.
 
C

ChristiW

Guest
@ryanvade - THANK YOU! That really helped understand the difference between primary/extended and logical. I am going to follow what you have written, except switch them (sda and sdb).

For swap, should it be on one drive with one partition? Two partitions on one drive? Two partitions on two drives?

I have 4GB of RAM.
 
R

ryanvade

Guest
@ryanvade - THANK YOU! That really helped understand the difference between primary/extended and logical. I am going to follow what you have written, except switch them (sda and sdb).

For swap, should it be on one drive with one partition? Two partitions on one drive? Two partitions on two drives?

I have 4GB of RAM.
You can just add a 2-4Gb swap partition to either drive. Just make sure it is seen in the fstab as all the other partitions should be. Remember that where root is also make a difference on booting.
 
C

ChristiW

Guest
Oops, I was confused when I wrote that. I still don't have the lingo right, in gparted, it shows a flag on the 350MB partition (system recovery) is flagged as /boot, not /root. I just looked and it's actually just flagged as "boot". A year from now I will look at this thread and sigh at how elementary this question is.

but yes, / will be on the ssd. Since /root is root's "home" partition, when I put /home of the sdb will that also put /root on sdb or is that automatically included in / ?

of topic question - is this your site? (if so, great tutorials! did the Linux command line tutorial and working on the bash scripting now!)
http://ryanstutorials.net/bash-scripting-tutorial/bash-input.php

Well, even if they're not yours, they're great! :)
 
C

ChristiW

Guest
Just one more question then I think I am good to go.

Does it matter in what order I place the partitions? Should / be before /usr or /swap or any of the other partitions?

I can only mark one as best answer, but @ZZs @ryanvade together explained the information I was looking for in my initial post. ryanvade's answer was more detailed with the explanation so that's why I marked his best answer. I do want to thank everyone for their input.
 
Z

ZZs

Guest
Well there is no mounting point for /swap and its turned on by swapon and automatically turned on by listing it in /etc/fstab file. The swap partition should be created on the outside of the disk where it spins the fastest.
I always load /boot first it contains linux then / then the rest.

my battery!
 
C

ChristiW

Guest
Okay, I am installing debian (wheezy) now. I became panicked during the partitioning and just installed everything on the sda and left sdb alone. I did separate the /home /usr /tmp and /var partitions though. I am wondering if it's easy to move those partitions later OR if I should start over again. I just want to ask if I could do this during install if I decide to re-install instead of just creating new partitions on sdb and moving the partitions over:

During the setup, it gives you a chance to do a guided install and separate the /usr /var /tmp and /home partitions. IF I did that on both drives and then just went back and deleted the partitions /home /var and /tmp on sda and just kept the same on sdb and deleted what I don't want, would that work? I didn't think of this until I pressed "install" that this could be a possibility.

I feel like just an idiot :oops: :(
 
Z

ZZs

Guest
I can fix it. It will be a lil pain though but its doable. May be faster to start over but if you fix it you'll learn a lot. I will help. We have to boot off a disk, mount all partitions, chroot, copy over the data to the new partitions, replace the edited /etc/fstab.
1. Send me your /etc/fstab file and include theses:
a. Run blkid on all the partitions you need to ad from and send me it; /dev/sdb1 (var) "blkid#" ($blkid /dev/sdb1)
I will write the fstab.
 
R

ryanvade

Guest
Your not an idiot. When I first messed with partitioning I messed up my windows vista install.

Linux is flexible when it comes to partitions so you can move them around. As long as your FSTAB is setup properly. You can make a new partition, copy the files over, then edit FSTAB without causing any issues. ;)
 
C

ChristiW

Guest
@ZZs If I will learn more by doing it your way then let's do it that way.
It's finishing up the install.
Now, can you tell me what to do, line by line? I am not that well versed in command line, but if you tell me what to put, I can do it.

@ryanvade - thanks! I said earlier in the thread that I will look back at this in a year and see how simple what I want to do is. You've got to crawl before you walk!
 


Members online


Latest posts

Top