LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-06-2011, 04:27 AM   #1
Chriscrof
Member
 
Registered: Jul 2008
Location: France and UK
Distribution: 10.10
Posts: 86

Rep: Reputation: 15
How to partition a hard disc


Hi,

I would be very grateful for some help with the following:

My computer has two hard discs; one contains Windows 7 and the other is completely empty and has a capacity of 160 GB. I want to install Ubuntu and another distro - possibly Fedora - on the empty HD but I am stuck as to how to go about partitioning the drive.

Should I partition the drive first so that it is ready for two distros or should I install one of the distros first and then let the second one do its own partitioning?

If I should partition the drive first could someone point me in the direction of a step-by-step guide to this; preferably a guide for dummies. I already created /dev/sdb1 and /dev/sdb2 thinking that these would be the equivalent of two logical drives in Windows e.g. D:\ and E:\ but this didn't seem to be the case because when I started to install Ubuntu it asked all sorts of questions to which I did not know the answers so I have now returned the drive to its original state.

Any help would be greatly appreciated
 
Old 03-06-2011, 04:50 AM   #2
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,155
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
Hello,
personally, I would:
a) create an ISO on a CD (of the choosen distro; Ubuntu will make a FFFAAAATTTT install... something smaller like TinyCoreLinux, Antix or the Debian would be better?)
b) disconnect the Windows HDD
c) change the boot options for booting from the CD reader
d) boot...
Then the boot CD will make different things (automatic or bit manually..).
After you have install the linux distro, reconnect your windows HDD , change the bios setup for booting from the linux HDD, adapt the grub (or lilo or syslinux..) boot menue for having multi-choices (boot linux boot windows in case) etc.
Here are different advices in the net for such activities. Or ask again here.

TiNyCoreLinux: boot ext3 100MB for installing the base TinyCore
ext3 1GB for the tinyCoreExtensions
swap (?): 200MB
ext3 rest: for home, opt

Last edited by floppy_stuttgart; 03-06-2011 at 04:58 AM. Reason: an example for tinycorelinux: can be different for other systems
 
Old 03-06-2011, 05:27 AM   #3
janakiramulu
Member
 
Registered: Jan 2011
Location: mangalore
Distribution: ubuntu
Posts: 167

Rep: Reputation: 0
how to partition a harddisk

Hi,Chriscrof
here i am explaining some tips

1)take any ubuntu 10.10(any other linux)cd ,insert into system restart while restarting see below f9(boot menu or del key based on ur system),press that .it will give 4 or 3 option on black screen including cd-rom,click that option(cd-rom)
2)after some time it will give 2 options,ie-live,install,click that live
3)then it will boot into livecd,after some time ,ubuntu will appear as pink color(on desktop-install ubntu icon will appear)
4)on desktop see top menu bar will appear with 3options
applications,places,system
5)now click system>click administration>select gparted (partition editor)
6)which partition all types are here
u can read below link
http://ubuntuforums.org/showthread.p...home+partition
7)it will appear gparted ,on right corner there will be selection device options (may be urs a capacity of 160 GBclick-/dev/sd something) select ur device
now start partition
follow the below link

http://www.dedoimedo.com/computers/g...mozTocId801746


I hope this will help,how u done plz let me know
k thanku
 
Old 03-06-2011, 06:11 AM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Linux/Unix doesn't have a concept of logical drives. There is always only a single file tree starting with / (root) at the top. The sub-directories under it can exist on the same partition as /, a different partition or drive, or even a network share, all essentially transparent to the existence of the tree itself.

So you can mount (connect) any partition to any point on the tree, basically arbitrarily, with the only limitation being that the system expects to find certain system files in defined locations (most people stick to mounting non-system drives to traditional directories such as /mnt and /media). The files in /dev represent the physical devices that are available to the system. Their contents don't actually become available to the file tree until you mount them somewhere.

For example, if you define /dev/sdb1 as /, and then mount /dev/sdb2 to /home, all the files on the main tree will be on sdb1, except for the contents of /home, which exist on sdb2. Unmount sdb2, and /home will revert to being on sdb1 too. The files on sdb2 become inaccessible until it's remounted somewhere.

So at a minimum you'll need one partition for each distro you run, which will become / when that distro is active. Most of the system files and directories can reside on that partition. However it's also recommended (but not necessary) to put the /home directory on a separate partition, allowing you to reinstall without affecting your users' personal files and configurations. You can create a single /home partition which can be mounted and shared by all distros, but it's perhaps better to create separate users (which will have their personal subdirectories on it) for each distro, due to differences in the way they operate.

A modern desktop linux will probably occupy about 15-20GiB, excluding home, but you also need to take into account space for temporary files in /tmp and /var, so I recommend somewhere in the range of 30-40GiB per distro (operations such as updates can require lots of temp space).

You should also create a small (1~2GiB) swap partition, which can be shared by all distros, although if you have a lot of RAM you can probably get away with creating swap files instead. Finally, since you'll be dual-booting, it might be advisable to create a separate partition formatted in NTFS that can be accessed by both Windows and Linux.

You'll doubtless find different advice about other ways to configure things, but I think it's best to keep things simple when just starting out. One root partition for each OS, a separate home, and swap are good enough for a beginner.

If you know ahead of time what you want your final install to look like, I'd go ahead and partition everything first before you start to install the distros. Just make sure you choose the advanced installation options so you can configure the install program to use your pre-existing partitions. The basic settings on many install programs often assume you're starting with an empty drive, or one with only Windows pre-installed, and offer you only their own recommended partition breakdown.

It's possible, however, to repartition things later with programs like gparted, so you don't have to sweat it too much. But one last thing to remember is that a physical hard drive can only have a maximum of 4 primary partitions. If you intend to have more, you'll have to change one of them to an extended partition, which allows you to create more logical partitions under it. It may be better to take this into account at the beginning instead of trying to reconfigure it later.
 
1 members found this post helpful.
Old 03-06-2011, 07:20 AM   #5
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
You did not mention :
1) Can you change the boot order of you're hard drives in you're BIOS ?
If you can would you like to leaf the MBR of the windows drive untouched ?
Or did you like to have one boot menu for all the OS ?
The last option means that you change the MBR of the WINDOWS drive .
If you wish to let the MBR of the WINdows drive untouched be sure that the drive on which you're installing the linux distros is the first boot HD during installation .
And be sure that GRUB is written on the MBR of drive on which you are installing linux .
Result is that the windows drive is untouched .
But you have to change the boot order in you're BIOS when you like to change between linux and windows .
If you do have the install media of windows and you like to have one boot menu that is possible too
You need the install media of windows to put windows MBR back in place in case something is going wrong
In the last case do not change the boot order and write GRUB in windows MBR .
 
Old 03-06-2011, 08:13 AM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by Chriscrof View Post
My computer has two hard discs; one contains Windows 7 and the other is completely empty and has a capacity of 160 GB. I want to install Ubuntu and another distro - possibly Fedora - on the empty HD
The more complicated decisions will be in how you set up the initial boot code and the drive numbering to work with different OS's on different drives.

You must decide which drive should be physically drive zero (you might swap the cables at some point during install if the current drive zero isn't the one you want for drive zero).

Assuming your BIOS allows this, you would decide which drive boots first. The BIOS would then pass data to the boot code telling the boot code to pretend the booted drive is drive 0, even if it physically isn't.

If the Linux drive boots first, you can configure the menu choice for Windows to make it pretend the Windows drive is drive 0 when giving control to Windows. Since Windows was installed on drive 0, it would be quite difficult (but not impossible) to make it work when booted on what it is told is drive 1.

Windows will entirely accept whatever the next earlier boot step tells it about which drive is 0 vs. 1. I don't think the same is true of Linux. I forget details, but I think most parts of Linux will see the true physical drives 0 and 1 as sda and sdb. So if your boot process is messing around with which drive is which, you need to be careful of the details of which drive is which when.

The simplest method would be to swap the cables so the Windows is on physical drive 1. Linux boots first on the true drive 0, and its boot menu includes a choice for Windows, which swaps the drive identities, so Windows boots on physical drive 1, thinking it is 0. While that is the simplest choice, it is far from the only choice.

Quote:
Should I partition the drive first so that it is ready for two distros or should I install one of the distros first and then let the second one do its own partitioning?
I don't recall Ubuntu or Fedora install dialogs well enough to really guide you on that. Most of the times I have installed Linux, I have found it easiest to pre partition the entire drive the way I want it (using gparted in some Linux liveCD) before running any installer.

Most Linux installers I've used (especially Centos, which I've installed the largest number of times) have a fairly clear option for either "existing partitions" or "manual", in which you can select from existing partitions and set their mount points.

But I have used Linux installers in which I couldn't figure out the way to use existing partitions. Then I needed to select the choice to use unpartitioned space. Anyway, be careful not to choose "use entire disk", since it probably would take your windows drive instead of or in addition to the empty drive.

In your situation, I would create a swap partition to be shared by both Linux installs and a / partition for each Linux install. I would not split /home or /boot or /var or any of the other commonly split areas.

You got earlier advise to split /home from / because that supposedly makes reinstalls easier. I've done reinstalls on several different Linux versions and never found that having /home separate from / made anything easier. There are enough distribution specific user settings in /home that installing Linux without trashing a new /home has never been practical for me.

For reinstall, I always:
1) Use gparted on a liveCD to shrink all the partitions of the existing install small enough that there is room to install a new version in unpartitioned space.
2) Install.
3) Reboot back and forth between versions a few time while copying files and settings from old to new and testing and comparing.
4) Destroy the old partitions.
5) Use gparted to expand the new partitions.

I always split /tmp from / but as a tmpfs not a disk partition. Then /tmp uses ram or swap, whichever is dynamically best moment by moment. /tmp should only be used for files you don't mind being auto deleted on every reboot. Many Linux distributions do auto delete the contents of /tmp on reboot. With a tmpfs, those contents are already lost before reboot, which is no worse. For files that are stable and read many times, file caching works better than a ram disk, so the many people that ask how to use excess ram as disk in Linux are generally misguided. But for files that are typically created and read once then deleted, a ram disk or tmpfs works much better than caching. A large fraction of such files are in /tmp, so a tmpfs will produce better performance than a partition (or a portion of the / partition) for /tmp.

If you plan to have massive amounts of user data (such as if you plan to edit home movies on that computer) you should have a separate user data partition. That is very important for reinstall, since that data would be too big to have twice during the reinstall process I described earlier. Typically, you would then want several soft links in your /home/user directory pointing to subdirectories within the mount point of the user data partition. So operationally the data seems to be in subdirectories of your own home directory.

If your large data is things like home movies, that are best imported and edited in Linux, but you then want to be able to play them in Windows, it may be best to keep that data on the Windows drive.

Reading and writing data on a Windows partition instead of a Linux partitions is only a very minor inconvenience from Linux. (Linux programs and setting are somewhat trickier on a Windows drive because of differences in secrity semantics).

If you have big user data and want to access it from Windows and don't have room on your Windows drive, then you can make your user data partition for Linux be an NTFS partition compatible with Windows. That will take a little extra attention to security and permissions issues, but is quite workable. A key factor is that user data would not directly contain user home directories, only subdirectories linked from user home directories.

If user data or some other partition brings your partition count up to four or more, you will find it more flexible to work with logical partitions rather than primary. For best flexibility in resizing, you could make the entire drive one extended partition and make all the Linux partitions logical partitions inside that extended partition.

Last edited by johnsfine; 03-06-2011 at 08:51 AM.
 
1 members found this post helpful.
Old 03-14-2011, 03:21 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Moved: This thread is more suitable in <Linux-General> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 03-15-2011, 04:40 AM   #8
Chriscrof
Member
 
Registered: Jul 2008
Location: France and UK
Distribution: 10.10
Posts: 86

Original Poster
Rep: Reputation: 15
Hi everyone,

Sorry for the delay in getting back to you; I have been away from home for the past week and have not been at my computer. Thank you all for your help especially David the H and johnsfine who both went to such lengths to help. I think I know enough now to be able to partition my hard disc without error messages and other problems. I have just burned a live CD with GParted and am going to use that

Many thanks again
 
Old 03-15-2011, 04:48 AM   #9
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
The 2 linux distros that you mention have their own partition programs, so you can partition during installation.
 
Old 03-15-2011, 04:53 AM   #10
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
http://www.psychocats.net/ubuntu/installing
http://www.wonderhowto.com/how-to-du...-side-0123943/
 
Old 03-15-2011, 03:30 PM   #11
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,996

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
I would suggest that you try installing a free Virtual Machine if your system came with windows 7.

I don't bother with a dual boot anymore on supported systems. A VM is just as fast and it gets past any goofy hardware deals. It provides me with almost instant on and I can use two or more at the limits of my ram. I can connect to even unsupported hardware via the host.
 
1 members found this post helpful.
Old 03-15-2011, 05:27 PM   #12
Alexvader
Member
 
Registered: Oct 2009
Location: Japan
Distribution: Arch, Debian, Slackware
Posts: 994

Rep: Reputation: 94
hi

I have this HDD, 320 GB, which has

/dev/sda1 ext4 10GB empty
/dev/sda2 ext4 50GB / (debian squeeze )
/dev/sda3 ext4 239GB /home
/dev/sda4 swap

I am considering to install OpenIndiana ( assuming i am ballsy or drunk enough to risk losing the ability to boot my squeeze ) in my /dev/sda1 and use /dev/sda4 as swap... is this possible...?

I want to be able to choose between my OI and Squeeze at boot time, but AFAIK solaris grub is different from current Squeeze grub...
 
Old 03-15-2011, 08:34 PM   #13
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,996

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
Alexvader, a bit out of context but you should be fine with OpenIndiana. I doubt you'd loose any data but as with all installs, back up first. I wouldn't share swap space.

OI ought to be smart enough to work OK but it should be able to be fixed.
 
1 members found this post helpful.
Old 03-16-2011, 09:05 AM   #14
Alexvader
Member
 
Registered: Oct 2009
Location: Japan
Distribution: Arch, Debian, Slackware
Posts: 994

Rep: Reputation: 94
Thx jefro
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying root partition from Gentoo Live Disc to hard disk gregorian Linux - Newbie 12 02-15-2010 04:22 AM
Trying to reformat my hard disc Billy Makk General 15 12-16-2009 08:22 PM
Help - Installation on second hard disc bulle555 Linux - Software 8 06-18-2006 02:56 AM
Hard disc partition problems dual booting with windows randrake SUSE / openSUSE 1 02-17-2006 11:37 AM
How to install from hard disc partition? Al_Jones Fedora - Installation 2 03-28-2004 07:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration