LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-09-2010, 05:17 PM   #1
NaCo
Member
 
Registered: Jun 2002
Location: L.A.
Distribution: Fedora
Posts: 46

Rep: Reputation: 15
Creating a 10GB partition with FDISK help needed.


I have a physical drive of about 40GB, I want to create a partition of 10GB with FDISK on this drive.

This is the fdisk -l output:
Code:
[root@localhost tools]# fdisk -l

Disk /dev/hda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        1958    15623212+  8e  Linux LVM

Disk /dev/hdb: 42.9 GB, 42949672960 bytes
16 heads, 63 sectors/track, 83220 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1       10000     5039968+  83  Linux
I issue the fdsik /dev/hdb command, and enter n (for new partition) but I am not sure about the first and last cylinder specification for a partition of 10GB.

I will appreciate any help!
 
Old 12-09-2010, 05:28 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Quote:
Originally Posted by NaCo View Post
I issue the fdsik /dev/hdb command, and enter n (for new partition) but I am not sure about the first and last cylinder specification for a partition of 10GB.
Try first 10001: last 29400
 
Old 12-09-2010, 06:03 PM   #3
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by NaCo View Post
I issue the fdsik /dev/hdb command, and enter n (for new partition) but I am not sure about the first and last cylinder specification for a partition of 10GB.
If you want 10.0 GB in operating system math (10 * 1024 * 1024 * 1024 bytes = 10.0 GB), use this math to calculate the number of cylinders:

total_cylinders = 83220.0
total_bytes = 42949672960.0
desired_bytes = 10.0 * 1024 * 1024 * 1024
cylinders = total_cylinders * desired_bytes / total_bytes = 83220.0 * 0.25 = 20805.0

So your starting cylinder will be 10001 and your ending cylinder will be 30805.
 
Old 12-02-2014, 10:13 AM   #4
promitheas
LQ Newbie
 
Registered: Dec 2014
Distribution: Ubuntu
Posts: 8

Rep: Reputation: 0
how would i calculate which the first cylinder should be, after i figure out the cylinders?

Last edited by promitheas; 12-02-2014 at 10:23 AM.
 
Old 01-02-2015, 01:47 PM   #5
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Rep: Reputation: 50
Actually, I'm having a similar problem.
I need to know the 'last cylinder' number to create the size of my partition.

I have a 160gb hdd and I want to create a 40gb partition for a linux distro.
I am using the fdisk cmd but I don't know what the 'last cylinder' number should be.
The 'start cylinder' is simple. I simply hit ENTER and the partition will begin from the previous partition.

I can't find a site where something as important as the partition size is simplified. 40gb is a nice neat number. But the corresponding 'last cylinder' number is completely crazy.

Can someone help please?

fdisk /dev/sda

Code:
root@debian:/home/user# fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9b3c9b3c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63   312560639   156280288+   7  HPFS/NTFS/exFAT
 
Old 01-02-2015, 02:21 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,684

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Higgsboson,
You don't want to use fdisk. I assume you want to keep the existing windows OS. You can either use the windows disk management tool or gparted to shrink sda1 to 120 GB then let the installer create the additional partitions.
 
Old 01-02-2015, 02:42 PM   #7
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Rep: Reputation: 50
Quote:
Originally Posted by michaelk View Post
Higgsboson,
You don't want to use fdisk. I assume you want to keep the existing windows OS. You can either use the windows disk management tool or gparted to shrink sda1 to 120 GB then let the installer create the additional partitions.
Sorry, I should've supplied more info.
I have a seperate hdd which has Windows on it and is my main drive.

The hdd I want to partition is an old drive with everything deleted off it. So if I mess anything up, I'll be fine.

I want to create 4 partitions at 40gb each. Then I can install 4 seperate distros (which is like 3 more than I need!)

Using the installer is a good idea. But I'm using debian live USB which doesn't have persistence.
Also, the debian installer has been removed from the OS - but that's another story.

Consequently, I'm resorting to fdisk.
 
Old 01-02-2015, 02:59 PM   #8
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
@Higgboson -- How do you intend to install Debian if you have no installer?

EDIT: I've read through your post history and there is no way you should even be trying to install or use Debian -- it is not for newbies.

Do yourself a favour and use USBWriter to burn an .iso of Mint onto your USB stick and use that to install Mint to your hard drive.

Mint is aimed at users such as you.
http://linuxmint.com/

Last edited by Head_on_a_Stick; 01-02-2015 at 03:02 PM.
 
Old 01-02-2015, 03:43 PM   #9
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Rep: Reputation: 50
Quote:
Originally Posted by Head_on_a_Stick View Post
@Higgboson -- How do you intend to install Debian if you have no installer?

EDIT: I've read through your post history and there is no way you should even be trying to install or use Debian -- it is not for newbies.
I'm going to use debootstrap.
There's a sticky about the pgm on the debian forum. It could help you.

I used to work as a software developer. But I wrote in rpg400 - not unix.
Programming isn't new to me - but the linux language is. Debian is bringing back old memories.

I've just found that the 'last cylinder' number can have a simple input of '+40g' for a 40gb partition.http://www.howtogeek.com/106873/how-...ions-on-linux/
This makes sense, doesn't it?
I'll let you know if debootstrap works for me soon.
 
Old 01-02-2015, 04:01 PM   #10
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
Thank you for the advice.

There isn't enough space left on the drive you are working on and fdisk cannot resize partitions.

Also, the drive you are working on (/dev/sda) appears to have a Windows installation on it.

I may be wrong, but it looks to me as if you are about to damage your Windows system.

Last edited by Head_on_a_Stick; 01-02-2015 at 04:05 PM. Reason: didn't read his post properly -- sorry higgsboson!
 
Old 01-03-2015, 02:59 AM   #11
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Rep: Reputation: 50
Quote:
Originally Posted by Head_on_a_Stick View Post
Thank you for the advice.

There isn't enough space left on the drive you are working on and fdisk cannot resize partitions.

Also, the drive you are working on (/dev/sda) appears to have a Windows installation on it.

I may be wrong, but it looks to me as if you are about to damage your Windows system.
Yes. Windows has some system files on this old hard disk. I physically removed the hard disk and connected it back up again.
Now Windows won't start. I'm doing things to sort this problem out.
However, I can see I have a new problem related to this hard disk. It has an existing partition which needs to be deleted so I can use it to install linux distros. I'll have to start a new thread.
Thanks for your help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
If i deleted a partition using fdisk , will that delete the data on this partition? wmasry Linux - Newbie 8 12-15-2009 06:41 AM
Creating partition through fdisk??? your_shadow03 Linux - Newbie 1 06-27-2008 06:04 AM
Help needed in creating a partition for freebsd qanopus *BSD 1 08-11-2004 03:20 PM
Fdisk Expert !! Badly needed mickeyboa Fedora 1 07-18-2004 08:52 PM
automated fdisk problem -- advice needed Frustin Linux - Software 3 03-31-2003 02:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:31 AM.

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