<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>fdisk usage Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/fdisk-usage/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 10 Dec 2018 07:10:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Usage of “fdisk” on Linux</title>
		<link>https://www.osradar.com/usage-of-fdisk-on-linux/</link>
					<comments>https://www.osradar.com/usage-of-fdisk-on-linux/#respond</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Mon, 10 Dec 2018 07:10:40 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[fdisk]]></category>
		<category><![CDATA[fdisk linux]]></category>
		<category><![CDATA[fdisk usage]]></category>
		<category><![CDATA[linux tool]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=8199</guid>

					<description><![CDATA[<p>Linux is a beautiful platform that offers a number of built-in tools. Using those tools, it’s possible to perform a number of complex tasks without any additional toolkits. Having a good command over them can help in a number of situations. “fdisk” is such a tool that comes pre-installed on almost all the Linux distros. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/usage-of-fdisk-on-linux/">Usage of “fdisk” on Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Linux is a beautiful platform that offers a number of built-in tools. Using those tools, it’s possible to perform a number of complex tasks without any additional toolkits. Having a good command over them can help in a number of situations.</p>
<p>“fdisk” is such a tool that comes pre-installed on almost all the Linux distros. The tool works in the command line interface. Yet, it’s very simple and hassle-free. It’s a partitioning tool for HDDs, SSDs, USB thumb drives etc. Today, we’ll be checking out the usage of “fdisk”.</p>
<p>When you work with “fdisk”, it doesn’t immediately complete the operation. It holds the changes into memory and will perform the action only when you tell it to.</p>
<h1>Identifying the “device identifier”</h1>
<p>In the case of Linux, all the block devices or HDDs are identified by unique identifier names, for example, “sda”, “sdb” etc. Before proceeding, it’s important to make sure that you’re working on the right device. Otherwise, you may accidentally lose data from another device and find yourself in a mayhem of troubles.</p>
<p>Run the following command –</p>
<pre class="">sudo lsblk</pre>
<p><img loading="lazy" class="size-full wp-image-8201 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-1.png" alt="" width="1035" height="457" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-1.png 1035w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-1-300x132.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-1-768x339.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-1-1024x452.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-1-951x420.png 951w" sizes="(max-width: 1035px) 100vw, 1035px" /></p>
<p>You can easily find out what device you’re about to modify. In my case, my 4GB USB flash drive is tagged as “sdb”.</p>
<h1>Opening storage device with fdisk</h1>
<p>For performing operations on a device, you have to lock it under fdisk. For that purpose, no partition of the device is allowed to be mounted.</p>
<p>From the above command, you can find out what partition was mounted.</p>
<p>Unmount the partition –</p>
<pre class="">sudo umount /dev/sdb1</pre>
<p><img loading="lazy" class="size-full wp-image-8202 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-2.png" alt="" width="1038" height="101" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-2.png 1038w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-2-300x29.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-2-768x75.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-2-1024x100.png 1024w" sizes="(max-width: 1038px) 100vw, 1038px" /></p>
<p>Now, it’s time to lock “sdb” under fdisk.</p>
<pre class="">sudo fdisk /dev/sdb</pre>
<h1></h1>
<h1>“fdisk” usage</h1>
<ul>
<li>
<h3>Listing available partitions</h3>
</li>
</ul>
<p>Once the device is locked under fdisk, enter the following value –</p>
<pre class="">p</pre>
<p><img loading="lazy" class="size-full wp-image-8203 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-3.png" alt="" width="1036" height="426" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-3.png 1036w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-3-300x123.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-3-768x316.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-3-1024x421.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-3-1021x420.png 1021w" sizes="(max-width: 1036px) 100vw, 1036px" /></p>
<p>You’ll be presented with a list of available partitions.</p>
<ul>
<li>
<h3>Creating a new partition</h3>
</li>
</ul>
<p>A partition table is quite important as it holds the info about the partition(s) of the device. As of the time of publishing this article, there are a few available partition tables –</p>
<ul>
<li>DOS – One of the oldest partition tables developed by Microsoft. DOS partition table can’t hold more than 4 primary partitions. Highly suitable for small storage devices.</li>
<li>GPT – A newly developed partition table that allows more than 4 primary partitions. Extremely useful for big storage devices like HDD, SSD etc.</li>
</ul>
<p>If you wish to create a DOS partition table, enter the following value –</p>
<pre class="">o</pre>
<p><img loading="lazy" class="size-full wp-image-8204 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-4.png" alt="" width="1039" height="291" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-4.png 1039w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-4-300x84.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-4-768x215.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-4-1024x287.png 1024w" sizes="(max-width: 1039px) 100vw, 1039px" /></p>
<p>For a GPT partition table, use this value –</p>
<pre class="">g</pre>
<p><img loading="lazy" class="size-full wp-image-8205 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-5.png" alt="" width="1039" height="376" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-5.png 1039w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-5-300x109.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-5-768x278.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-5-1024x371.png 1024w" sizes="(max-width: 1039px) 100vw, 1039px" /></p>
<ul>
<li>
<h3>Creating/removing partitions</h3>
</li>
</ul>
<p>If you want to delete a partition, enter this value –</p>
<pre class="">d</pre>
<p><img loading="lazy" class="size-full wp-image-8206 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-6.png" alt="" width="1025" height="139" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-6.png 1025w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-6-300x41.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-6-768x104.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-6-1024x139.png 1024w" sizes="(max-width: 1025px) 100vw, 1025px" /></p>
<p>Then, you’ll be asked for entering the partition number. Make sure to find out the list of partitions using the previous method.</p>
<p>For creating a new partition, enter the following value –</p>
<pre class="">n</pre>
<p>&nbsp;</p>
<p>At first, you have to select the partition number. Hit “Enter” as the default value is always alright.</p>
<p>Now, you’ll be asked for the “First sector” number. Most of the cases, it’s also nothing to touch about (unless you’re sure what you’re doing). Just hit “Enter”.</p>
<p>Next, time to enter the size of the partition. For the partition size, it must not come up in fractions. For example, you want the partition size of 512MB, type “+512M” (without quotes). Similarly, for 2GB partition, the command will be “+1G”.</p>
<p><img loading="lazy" class="size-full wp-image-8207 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-7.png" alt="" width="1026" height="204" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-7.png 1026w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-7-300x60.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-7-768x153.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-7-1024x204.png 1024w" sizes="(max-width: 1026px) 100vw, 1026px" /></p>
<p>As you can see, the partition is created.</p>
<p><img loading="lazy" class="size-full wp-image-8208 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-8.png" alt="" width="1027" height="271" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-8.png 1027w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-8-300x79.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-8-768x203.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-8-1024x270.png 1024w" sizes="(max-width: 1027px) 100vw, 1027px" /></p>
<p>Another example &#8211;</p>
<p><img loading="lazy" class="alignnone size-full wp-image-8209" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-9.png" alt="" width="1027" height="405" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-9.png 1027w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-9-300x118.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-9-768x303.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-9-1024x404.png 1024w" sizes="(max-width: 1027px) 100vw, 1027px" /></p>
<ul>
<li>
<h3>Finalizing all the modifications</h3>
</li>
</ul>
<p>After you’ve performed all the modifications, you can now finalize the real changes in your drive. Enter the following value –</p>
<pre class="">w</pre>
<p>&nbsp;</p>
<p><img loading="lazy" class="size-full wp-image-8210 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-10.png" alt="" width="1026" height="162" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-10.png 1026w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-10-300x47.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-10-768x121.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-10-1024x162.png 1024w" sizes="(max-width: 1026px) 100vw, 1026px" /></p>
<p>The writing process is complete now but the partition(s) you created won’t be usable until you format them properly. Run the following command for formatting the partition in “ext3” format –</p>
<pre class="">sudo mkfs.ext3 -L demoPartition /dev/sdb2</pre>
<p><img loading="lazy" class="size-full wp-image-8211 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-11.png" alt="" width="1042" height="316" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-11.png 1042w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-11-300x91.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-11-768x233.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-11-1024x311.png 1024w" sizes="(max-width: 1042px) 100vw, 1042px" /></p>
<p>Here, “demoPartition” is the name of the partition. You can use any name as you like.</p>
<p>Now, the partition is ready for mounting. Run the following command –</p>
<pre class="">sudo mount /dev/sdb1 /mnt</pre>
<p><img loading="lazy" class="size-full wp-image-8212 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-12.png" alt="" width="1034" height="99" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-12.png 1034w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-12-300x29.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-12-768x74.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-12-1024x98.png 1024w" sizes="(max-width: 1034px) 100vw, 1034px" /></p>
<p>Verify the result –</p>
<pre class="">df -h</pre>
<p><img loading="lazy" class="size-full wp-image-8213 aligncenter" src="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-13.png" alt="" width="1038" height="507" srcset="https://www.osradar.com/wp-content/uploads/2018/12/fdisk-13.png 1038w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-13-300x147.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-13-768x375.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-13-1024x500.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/fdisk-13-860x420.png 860w" sizes="(max-width: 1038px) 100vw, 1038px" /></p>
<p>Enjoy!</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/usage-of-fdisk-on-linux/">Usage of “fdisk” on Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/usage-of-fdisk-on-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
