<?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>Resizing the boot partition in linux Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/resizing-the-boot-partition-in-linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 11 May 2020 15:41:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.13</generator>
	<item>
		<title>Resizing the boot partition in linux</title>
		<link>https://www.osradar.com/resizing-the-boot-partition-in-linux/</link>
					<comments>https://www.osradar.com/resizing-the-boot-partition-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[Mel]]></dc:creator>
		<pubDate>Mon, 11 May 2020 15:50:04 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Resizing the boot partition in linux]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=20252</guid>

					<description><![CDATA[<p>Last weeks I was confronted with resizing the boot partitioning issues on my server, I want to explain to you how to resize boot partition in Linux. /boot&#160;partition cannot be an LVM devices is because when the system boots, it first searches for&#160;/boot/vmlinuz, and at this time,&#160;lvm&#160;cannot be recognized because there is no module for&#160;lvm&#160;loaded [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/resizing-the-boot-partition-in-linux/">Resizing the boot partition in 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>Last weeks I was confronted with resizing the boot partitioning issues on my server, I want to explain to you how to resize boot partition in Linux.</p>



<p><code>/boot</code>&nbsp;partition cannot be an LVM devices is because when the system boots, it first searches for&nbsp;<code>/boot/vmlinuz</code>, and at this time,&nbsp;<code>lvm</code>&nbsp;cannot be recognized because there is no module for&nbsp;<code>lvm</code>&nbsp;loaded at this time. So, the&nbsp;<code>/boot</code>&nbsp;partition can not be a&nbsp;<code>lvm</code>&nbsp;partition. ( redhat) </p>



<h3>How to resize the boot partition in  Centos / Redhat 7/8 ? </h3>



<p><strong><em>Note: this document should also work for another Linux distribution like <a rel="noreferrer noopener" href="https://ww.osradar.com/tag/debian" target="_blank">Debian</a> / Gentoo/  <a href="https://ww.osradar.com/tag/opensuse" target="_blank" rel="noreferrer noopener">OpenSUSE</a>.</em></strong></p>



<p>I&#8217;m testing this solution in my VM.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="609" height="165" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2020/05/image-6.png" alt="" class="wp-image-20254" srcset="https://www.osradar.com/wp-content/uploads/2020/05/image-6.png 609w, https://www.osradar.com/wp-content/uploads/2020/05/image-6-300x81.png 300w" sizes="(max-width: 609px) 100vw, 609px" /></figure>



<p>  My boot partition is 1Gb. Let&#8217;s do an example how to expand this partition to 2 GB for  example. </p>



<p>You can use <code>fdisk</code> or parted commands to create another partition. Else you have to add extra storage like <code>sdb</code> or <code>sdc</code>.  </p>



<p>In my situation i have  add new storage <code>/deb/sdb</code> </p>



<p>Below is the command that you need to run to scan the host devices so it will show the new hard disk connected.</p>



<pre class="wp-block-preformatted">#echo "- - -" >> /sys/class/scsi_host/host_$i/scan
#fdisk  -l   | grep  dev
Disk /dev/sdb: 3 GiB, 3221225472 bytes, 6291456 sectors
Disk /dev/sda: 14.1 GiB, 15157231616 bytes, 29603968 sectors
/dev/sda1  *       2048  2099199  2097152    1G 83 Linux
/dev/sda2       2099200 29603839 27504640 13.1G 8e Linux LVM
Disk /dev/mapper/cl-root: 9.1 GiB, 9726590976 bytes, 18997248 sectors
Disk /dev/mapper/cl-swap: 1.4 GiB, 1518338048 bytes, 2965504 sectors
</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="648" height="133" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2020/05/image-7.png" alt="" class="wp-image-20255" srcset="https://www.osradar.com/wp-content/uploads/2020/05/image-7.png 648w, https://www.osradar.com/wp-content/uploads/2020/05/image-7-300x62.png 300w" sizes="(max-width: 648px) 100vw, 648px" /></figure>



<h3>Lets create partition sdb1  (2GB)  on Linux Disk </h3>



<pre class="wp-block-preformatted">[root@osradar-lvm ~]# fdisk   /dev/sdb

Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (1-4, default 1):
First sector (2048-6291455, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-6291455, default 6291455): +2G

Created a new partition 1 of type 'Linux' and of size 2 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

[root@osradar-lvm ~]#
</pre>



<h3>Create ext4 file system file system on  sdb1 </h3>



<pre class="wp-block-preformatted">[root@osradar-lvm ~]# mkfs.ext4 /dev/sdb1 
mke2fs 1.44.6 (5-Mar-2019) Creating filesystem with 524288 4k blocks and 131072 inodes Filesystem UUID: 3303ecb2-d97c-4dae-b6f6-157bc82c9b96 Superblock backups stored on blocks:         32768, 98304, 163840, 229376, 294912 Allocating group tables: done Writing inode tables: done Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done 
[root@osradar-lvm ~]# </pre>



<p>So, open terminal or shell prompt and type the following <code>dd</code> command:</p>



<pre class="wp-block-preformatted">[root@osradar-lvm ~]# dd if=/dev/sda1 of=/dev/sdb1 bs=512 conv=noerror,sync</pre>



<pre class="wp-block-preformatted">[root@osradar-lvm ~]# dd if=/dev/sda1 of=/dev/sdb1 bs=20M conv=noerror,sync<br>51+1 records in<br>52+0 records out<br>1090519040 bytes (1.1 GB, 1.0 GiB) copied, 6.22216 s, 175 MB/s</pre>



<p>The disk sda1 will be cloned to disk 2 even the size 2 will be the same size (don&#8217;t panic) </p>



<pre class="wp-block-preformatted">[root@osradar-lvm ~]# umount  /boot #( don't worry,  nothing will hapen to your system even your server is ON) </pre>



<pre class="wp-block-preformatted">[root@osradar-lvm ~]# umount  /boot </pre>



<p> Check  the file  system ext4 on <code>/deb/sdb1</code> </p>



<p><strong>e2fsck</strong>&nbsp;is used to check the <code>ext2/ext3/ext4</code> family of file systems. For ext3 and ext4 filesystems that use a journal, if the system has been shut down uncleanly without any errors, normally, after replaying the committed transactions in the journal, the file system should be marked as clean</p>



<p>Resize to the full  size (2GB)  with command <strong>resize2fs </strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" width="659" height="470" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2020/05/image-8.png" alt="" class="wp-image-20257" srcset="https://www.osradar.com/wp-content/uploads/2020/05/image-8.png 659w, https://www.osradar.com/wp-content/uploads/2020/05/image-8-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/image-8-100x70.png 100w" sizes="(max-width: 659px) 100vw, 659px" /></figure>



<p>Try to mount manually the <code>/dev/sdb2</code> to <code>/boot</code>  partition </p>



<pre class="wp-block-preformatted">[root@osradar-lvm ~]# mount -t ext4 /dev/sdb1 /boot</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="601" height="160" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2020/05/image-9.png" alt="" class="wp-image-20258" srcset="https://www.osradar.com/wp-content/uploads/2020/05/image-9.png 601w, https://www.osradar.com/wp-content/uploads/2020/05/image-9-300x80.png 300w" sizes="(max-width: 601px) 100vw, 601px" /></figure>



<p>Very fine. Now add  the line to  <code>/etc/fstab</code>  to make this permanent with next reboot.</p>



<pre class="wp-block-preformatted">[root@osradar-lvm ~]# vi  /etc/fstab</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="759" height="245" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2020/05/image-11.png" alt="" class="wp-image-20261" srcset="https://www.osradar.com/wp-content/uploads/2020/05/image-11.png 759w, https://www.osradar.com/wp-content/uploads/2020/05/image-11-300x97.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/image-11-696x225.png 696w" sizes="(max-width: 759px) 100vw, 759px" /></figure>



<p>Normally you are Done no need to reboot but if u still have some doubts  you may reboot your  server or machine  </p>



<h2>Reboot your server</h2>



<pre class="wp-block-preformatted">[root@osradar-lvm ~]# reboot</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="936" height="495" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2020/05/image-12.png" alt="" class="wp-image-20262" srcset="https://www.osradar.com/wp-content/uploads/2020/05/image-12.png 936w, https://www.osradar.com/wp-content/uploads/2020/05/image-12-300x159.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/image-12-768x406.png 768w, https://www.osradar.com/wp-content/uploads/2020/05/image-12-696x368.png 696w" sizes="(max-width: 936px) 100vw, 936px" /></figure>



<p>Cheers!! </p>



<p>Please join <a href="https://t.me/osradar" target="_blank" rel="noreferrer noopener">our Telegram Channel</a> and share this post.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/resizing-the-boot-partition-in-linux/">Resizing the boot partition in 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/resizing-the-boot-partition-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
