Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
TetraWiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Linux 101 hacks
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=='''Hack 65. Partition using fdisk'''== After youβve installed brand new disks on your server, you have to use tools like fdisk to partition it accordingly. Following are the 5 typical actions (commands) that you can execute inside fdisk. o n β New Partition creation o d β Delete an existing partition o p - Print Partition Table o w β Write the changes to the partition table. i.e save. o q β Quit the fdisk utility '''Create a partition''' In the following example, I created a /dev/sda1 primary partition. <nowiki># </nowiki>'''fdisk /dev/sda''' Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. The number of cylinders for this disk is set to 34893. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: # software that runs at boot time (e.g., old versions of LILO) # booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): '''p''' Disk /dev/sda: 287.0 GB, 287005343744 bytes 255 heads, 63 sectors/track, 34893 cylinders Units <nowiki>= </nowiki>cylinders of 16065 <nowiki>* </nowiki>512 <nowiki>= </nowiki>8225280 bytes Device Boot Start EndBlocks Id System Command (m for help): '''n''' Command action e extended p primary partition (1-4) '''p''' Partition number (1-4): '''1''' First cylinder (1-34893, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-34893, default 34893): Using default value 34893 Command (m for help): '''w''' The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. '''Verify that the partition got created successfully''' <nowiki># </nowiki>'''fdisk /dev/sda''' The number of cylinders for this disk is set to 34893. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: # software that runs at boot time (e.g., old versions of LILO) # booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) '''Command (m for help): p''' Disk /dev/sda: 287.0 GB, 287005343744 bytes 255 heads, 63 sectors/track, 34893 cylinders Units <nowiki>= </nowiki>cylinders of 16065 <nowiki>* </nowiki>512 <nowiki>= </nowiki>8225280 bytes {| style="border-spacing:0;" | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| Device Boot | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <div align="right">Start</div> | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <div align="right">End</div> | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <div align="right">Blocks</div> | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| Id | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| System |- | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| /dev/sda1 | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <div align="right">1</div> | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <div align="right">34893</div> | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| <div align="right">280277991</div> | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| 83 | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| Linux |- | colspan="2" style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| Command (m for help): '''q''' | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| | style="border:none;padding-top:0in;padding-bottom:0in;padding-left:0.075in;padding-right:0.075in;"| |}
Summary:
Please note that all contributions to TetraWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TetraWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)