<div dir="auto">Really nice of u Terry. Appreciated</div><div class="gmail_extra"><br><div class="gmail_quote">On 5 Oct 2017 5:59 p.m., "Terry Froy via Lincoln" <<a href="mailto:lincoln@mailman.lug.org.uk">lincoln@mailman.lug.org.uk</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Andrew,<br>
<br>
As long as the partition you need to grow is the one at the end of the disk, you can do this without using 3rd party tools.<br>
<br>
The first thing you do is to take a backup of the partition table:<br>
<br>
sfdisk -d /dev/vda > /root/sfdisk-part-backup.txt<br>
(the -d is for dump)<br>
<br>
Copy sfdisk-part-backup.txt over to removable media Just In Case(tm).<br>
<br>
Once you have done this, run regular fdisk as superuser and:<br>
<br>
* Print the partition table (making note of start sector and partition type).<br>
* Delete the partition - this removes the partition info from the partition table - but until you enter 'w' to write the partition table, nothing on disk will be touched.<br>
* Create a new partition - ensure the start sector matches what you noted down when you printed the partition table, the end sector should be higher than the one you noted down - otherwise, you won't be growing the partition.<br>
* Set the partition type to match that of what you noted down.<br>
* Print the partition table again (verifying that start sector and partition type match that of the old partition).<br>
* If the start sector and partition type do not match, 'q' and then ENTER to exit without committing changes to disk.<br>
* Write the partition table to disk ('w' and then ENTER).<br>
* Quit fdisk ('q' and then ENTER).<br>
* Reboot the machine.<br>
* When the machine comes back up, use resize2fs or whatever utility is necessary to grow the filesystem in that partition.<br>
<br>
It is perfectly safe to do this while the underlying filesystem is mounted as fdisk does not touch the contents of the partition, merely the information which is held about the partition.<br>
<br>
If you get it wrong and the machine does not boot (you hit problems, etc), boot with a Live CD, insert the removable media which has the partition table backup on and then do:<br>
<br>
cat sfdisk-part-backup.txt | sfdisk /dev/vda<br>
<br>
This will restore the backup of the partition table and you should then be able to boot your system without removable media.<br>
<br>
Regards,<br>
Terry Froy<br>
Spilsby Internet Solutions<br>
<a href="http://www.spilsby.net/" rel="noreferrer" target="_blank">http://www.spilsby.net/</a><br>
<br>
----- Original Message -----<br>
From: "Andrew Walmsley via Lincoln" <<a href="mailto:lincoln@mailman.lug.org.uk">lincoln@mailman.lug.org.uk</a>><br>
To: "Lincoln LUG mailing list" <<a href="mailto:lincoln@mailman.lug.org.uk">lincoln@mailman.lug.org.uk</a>>, "<a href="mailto:corenominal@corenominal.org">corenominal@corenominal.org</a>" <<a href="mailto:philip.newborough@gmail.com">philip.newborough@gmail.com</a>><br>
Sent: Tuesday, 3 October, 2017 11:37:23 PM<br>
Subject: [Lincoln LUG] disk size<br>
<br>
<br>
<br>
hi everyone<br>
<br>
<br>
Is there a way of resizing a disk that is in use? Running a debian server (no gui) with 1 drive that was set to 5gb, which is now running out of space. yes i know its a stupid size (not my fault). Increased the vm to see 10gb.<br>
<br>
<br>
diskpart is no good as i'm booting to the drive which is mounting.<br>
<br>
<br>
What is best way round? mount a live cd? add an extra drive?<br>
<br>
<br>
Help!<br>
<br>
<br>
<br>
<br>
<br>
<br>
andy<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
Lincoln mailing list<br>
<a href="mailto:Lincoln@mailman.lug.org.uk">Lincoln@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/lincoln" rel="noreferrer" target="_blank">https://mailman.lug.org.uk/<wbr>mailman/listinfo/lincoln</a><br>
<br>
--<br>
Lincoln mailing list<br>
<a href="mailto:Lincoln@mailman.lug.org.uk">Lincoln@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/lincoln" rel="noreferrer" target="_blank">https://mailman.lug.org.uk/<wbr>mailman/listinfo/lincoln</a></blockquote></div></div>