Re: Best HD Partitoning Scheme

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you partition drives routinely, or wish to experiment with a disk's partitioning, you might try sfdisk.
This allows use of a partitioning script, here is one I use *routinely* on tiny drives (10GB is "tiny" now... I remember saving up to buy a 500MB SCSI).

#!/bin/bash
# destroy all old partition table data and make linux rescue disks recognize the new partition.    
dd if=/dev/zero of=/dev/hdb bs=512 count=63

# Create the entire partition table in one swoop.
# 'man sfdisk', then sacrifice a few chickens, in order to understand this single invocation of sfdisk.
# The parameters are Start, Size, Type; missing parameters take default values.
# Default missing parameter is 'the lowest possible', missing size is 'as large as possible'.
# Partition type L (Linux), S (Swap), E (Extended).
# This creates the 8 partitions on the target disk; part 3 is swap, part 4 is extended (holds the rest of the disk for extended==virtual partitions).
# Partitions are boot (3 cylinders, EXT3), root (60 cylinders, EXT3), swap, extended containing var, tmp, home, and usr.
# usr is last so that differing size/manufacture disk drives will work with this script iff they are 4GB or more in size.
# The '*' indicates a bootable partition.  Linux does not need this. M$ needs this.  M$ will never touch this disk, so the '*' is documentational.
# Make first partition skip the first track, it has MBR and nada mas.
sfdisk --DOS --leave-last -uC  --quiet /dev/hdb << hdb
,3,L,*
,60,L,
,19,S
,,E
,130,L
,130,L
,130,L
,,L
hdb

sfdisk -V /dev/hdb

Brian Brunner
brian.t.brunner@xxxxxxxxxxxxxxx
(610)796-5838

>>> cochranb@xxxxxxxxxxxxx 09/21/03 11:35PM >>>
You can only have 4 primary partitions on any drive. Within one of the 
primary partitions you can create logical partitions. Check your fdisk 
documentation for how to create these. Each operating system has it's 
own fdisk, so if you want to create linux partitions read

man fdisk

or

info fdisk

and feel your way very carefully indeed. If you have unpartitioned free 
space on your drive, it should be relatively easy to create and format 
new partitions. But if the entire drive is partitioned, your job is 
going to be more complicated.

In either case always back up your data first before playing with fdisk. 
Let me go a little more into this ad nauseum.

If you have a spare hard drive laying around unused, why not use it to 
experiment with? Remove your 'production drive' (thus preserving it's 
contents) and install the 'spare drive' in it's place. Then do Linux 
installs on it using Disk Druid. This lets you play and have loads of fun.

You can also use a spare drive as a backup (straight copy of files from 
one drive to another) or 'upgrade' drive, as in jumping from a 20 Gb to 
60 Gb drive: in either case, create the same partitions as on the source 
drive and then copy these partitions to it. See the Hard Disk Upgrade 
How-To on the Linux Documentation Project.

Bob Cochran
Greenbelt, Maryland, USA


Stephen Liu wrote:

> Hi Joe,
> 
> I am running 4 partitions on my OS, namely boot, swap, root and home. 
> 'fdisk' only allows 4 partitons.  How can I create additional partitions
> such /var /tmp /usr /etc
> 
> Thanks
> 
> B.R.
> Stephen Liu
> 
> On Mon, 2003-09-22 at 11:00, Joe wrote:
> 
>>Randy Chrismon wrote:
>>
>>
>>>I have two hard drives on my computer. The "master" is 30Gb and has a 
>>>Windows partition on it -- although I can devote a portion of the 
>>>drive to another partition. My second drive is 160Gb. Both drives are 
>>>on the same controller. I can pretty much devote all of the second 
>>>drive to Linux. I will be running a MySQL development server which I 
>>>don't expect to have more than 2Gb data. My wife and daughter will 
>>>have accounts on the Linux system. Given all the above -- and whatever >>>else information I can provide that folks might deem appropriate -- 
>>>what would you all suggest as the "best" partitioning scheme? A swap 
>>>partition on the first drive? A separate home partition on the second 
>>>drive? A separate partition for the MySQL data? All Linux on one big 
>>>partition?
>>
>>With only 2 physical spindles you don't have a whole lot of room for 
>>creativity - but definitely, put the swap partition on the first drive, >>so it's a separate spindle for performance reasons. If you will be doing >>much swapping, I'd put one swap partition on each spindle so they can 
>>run in parallel for better performance.
>>
>>You'll want a small root partition, then add /home, /var, /tmp and /usr >>partitions, so that they can be mounted with different options than the >>root partition. mount all partitions with the noatime option, and mount >>/tmp and /var with the data=writeback option. If you have room on the >>first drive for one of these partitions it might be a good thing. I have >>heard horror stories about ms windows though, deciding to claim part of >>a linux partition on the sane disk as ms windows, and essentially 
>>scribbling on it, so I'd be a bit leery of that.
>>
>>Joe
>>
> 
> 
> 
> To Get Your Own iCareHK.com Email Address?  Go To www.iCareHK.com.
> 
> 

-- 
Bob Cochran
Greenbelt, Maryland, USA
http://greenbeltcomputer.biz/ 



-- 
Shrike-list mailing list
Shrike-list@xxxxxxxxxx 
https://www.redhat.com/mailman/listinfo/shrike-list


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept
for the presence of computer viruses.

www.hubbell.com - Hubbell Incorporated
**********************************************************************


-- 
Shrike-list mailing list
Shrike-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux