Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"It is hard to overstate the debt that we owe to men and women of genius." -- Robert G. Ingersoll


computers / alt.os.linux / Re: Merge Linux partitions

SubjectAuthor
* Merge Linux partitionsInvalid
+- Merge Linux partitionsDavid W. Hodgins
+- Merge Linux partitionsPaul
+* Merge Linux partitionsJ.O. Aho
|+- Merge Linux partitionsPaul
|`* Merge Linux partitionsDavid W. Hodgins
| `* Merge Linux partitionsJ.O. Aho
|  `* Merge Linux partitionsPaul
|   `- Merge Linux partitionsDavid W. Hodgins
+- Merge Linux partitionsCarlos E.R.
`* Merge Linux partitionsInvalid
 +- Merge Linux partitionsPaul
 `- Merge Linux partitionsJ.O. Aho

1
Merge Linux partitions

<uaheh9$1irep$1@paganini.bofh.team>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1143&group=alt.os.linux#1143

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!paganini.bofh.team!not-for-mail
From: invalid@invalid.net (Invalid)
Newsgroups: alt.os.linux
Subject: Merge Linux partitions
Date: Fri, 4 Aug 2023 00:47:26 +0100
Organization: To protect and to server
Message-ID: <uaheh9$1irep$1@paganini.bofh.team>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 3 Aug 2023 23:51:05 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="1666521"; posting-host="lvwnlrZOTyXOUFTBTyWy3g.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
Cancel-Lock: sha256:OvqHba4DZtsH33aJQnb44Ex+jgcZjfoTystXbFLXD2I=
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.3
 by: Invalid - Thu, 3 Aug 2023 23:47 UTC

Is there anybody here who knows how to merge these partitions?

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 20G 0 disk
--sda1 8:1 0 7G 0 part /
--sda2 8:2 0 1K 0 part
--sda5 8:5 0 975M 0 part [SWAP]

I want to merge 20G with 7G to make it 27G or just to make everything 1
partition. It might be just 20G in total or 27G in total but I think it
is 20G in total.

Thank you.

Re: Merge Linux partitions

<op.184symnqa3w0dxdave@hodgins.homeip.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1144&group=alt.os.linux#1144

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dwhodgins@nomail.afraid.org (David W. Hodgins)
Newsgroups: alt.os.linux
Subject: Re: Merge Linux partitions
Date: Thu, 03 Aug 2023 22:53:00 -0400
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <op.184symnqa3w0dxdave@hodgins.homeip.net>
References: <uaheh9$1irep$1@paganini.bofh.team>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="12be1788b82d9269ce954d9995fcc846";
logging-data="1198465"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/v70uysrjpxQbcsI/AnaECX58uOMJNg0Q="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:Rck/WvoCYP7qk1XliOahqyjyHy8=
 by: David W. Hodgins - Fri, 4 Aug 2023 02:53 UTC

On Thu, 03 Aug 2023 19:47:26 -0400, Invalid <invalid@invalid.net> wrote:

> Is there anybody here who knows how to merge these partitions?
>
> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
> sda 8:0 0 20G 0 disk
> --sda1 8:1 0 7G 0 part /
> --sda2 8:2 0 1K 0 part
> --sda5 8:5 0 975M 0 part [SWAP]
>
> I want to merge 20G with 7G to make it 27G or just to make everything 1
> partition. It might be just 20G in total or 27G in total but I think it
> is 20G in total.

That's a 20GB drive, not 27GB.

It would be a good idea to make a backup copy before doing anything.

If that's all that is on it, I'd delete the swap and the extended partition
that currently contains it (sda2), resize sda1 to 18GB and then create a
new swap. You'll have to be careful if it's using the uuid to mount the
swap. Delete the swap from fstab before starting, and if using systemd run
dracut -f to update the initrd.

From the small size, I'm guessing it's an sd card. 20GB seems like a strange
number though.

Regards, Dave Hodgins

Re: Merge Linux partitions

<uahq30$14l99$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1145&group=alt.os.linux#1145

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@needed.invalid (Paul)
Newsgroups: alt.os.linux
Subject: Re: Merge Linux partitions
Date: Thu, 3 Aug 2023 23:08:16 -0400
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <uahq30$14l99$1@dont-email.me>
References: <uaheh9$1irep$1@paganini.bofh.team>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 4 Aug 2023 03:08:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b7594f98ac1b3a0ff2929ae6dcab5241";
logging-data="1201449"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NUs66xS5vmpwMHRFRwtGjfVxsVjAR8S0="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:yic8ONECDEoaVZvt+F27z0hwwIo=
In-Reply-To: <uaheh9$1irep$1@paganini.bofh.team>
Content-Language: en-US
 by: Paul - Fri, 4 Aug 2023 03:08 UTC

On 8/3/2023 7:47 PM, Invalid wrote:
> Is there anybody here who knows how to merge these partitions?
>
> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
> sda 8:0 0 20G 0 disk
> --sda1 8:1 0 7G 0 part /
> --sda2 8:2 0 1K 0 part
> --sda5 8:5 0 975M 0 part [SWAP]
>
> I want to merge 20G with 7G to make it 27G or just to make everything 1
> partition. It might be just 20G in total or 27G in total but I think it
> is 20G in total.
>
> Thank you.
>

[Picture]

https://i.postimg.cc/DZgtnBS2/msdos-extended-logical.gif

By using "lsblk" for this, you are not listing the free space on the disk.

That is what I hope to demonstrate in the picture.

I suspect if you used another utility, it would be apparent what
needs to be done to the disk. As it is, there is insufficient information
to say anything.

Since there are signs your disk is an Extended/Logical (which is why
I selected that particular disk for a screen shot), I must warn you that
it can take four or five operations in "gparted" to get the result you want.
Extended/Logical setups are some of the worst, when it comes to the amount
of time it takes to "get a result". Sometimes you need to move "free space"
from the Extended section, further towards the front of the disk. Which
is do-able, but is a pain.

I believe it was that particular disk drive, that has been hammering
this point home. I think I've had two very long sessions with that disk
already, when moving stuff around. Me leaving free space on the end like
that, that's one of my "little jokes". But you can see me leaving it
there, did come in handy, because it demos how free space is not showing
in all the utilities. So some good has come of my little joke (I spent so
much time messing with that disk, I did not want to leave it in "perfect
condition" as a joke -- I could have moved that bit of free space and
cleaned that up too).

Even if you'd told us how big the disk was ("what it says on the tin"),
that would have helped identify the missing space issue.

In my example, the disk is a WD1003FZEX 1TB drive. As "full disclosure".

You'll notice when I took my picture, I neglected to resize the column
in "gnome-disks", messing up the identifier label in the left column.

In the past, I have hand-drawn many a disk partition diagram, for
the benefit of an OP. But with "gnome-disks" handy and all, it's
also pretty easy to do a screenshot instead. The utility is sometimes
aliased to "disks", and may have been called "palimpsest" or something
at a previous time.

https://en.wikipedia.org/wiki/GNOME_Disks

If a partition is mounted, and you click on the partition in "gnome-disks",
it will graphically show you how full it is.

Be careful with that utility, because I believe some genius has added
a "partition delete" function to it. I wish I had a third-hand I could
use to smack utility people who do things like this :-) The developer
who did that, undoubtedly digs holes in his back yard and covers the
holes with green nylon outdoor carpeting. Then if you fell in the
hole, he would tell you to "be more careful next time!". Indeed.

Paul

Re: Merge Linux partitions

<kj3qhrFh08mU1@mid.individual.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1146&group=alt.os.linux#1146

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: user@example.net (J.O. Aho)
Newsgroups: alt.os.linux
Subject: Re: Merge Linux partitions
Date: Fri, 4 Aug 2023 10:18:03 +0200
Lines: 40
Message-ID: <kj3qhrFh08mU1@mid.individual.net>
References: <uaheh9$1irep$1@paganini.bofh.team>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net M2iWVs/8cK5nvMWbJ5zj6g2boYeo865q0UGaiFp9G986rQbyN2
Cancel-Lock: sha1:Eb9PJ4a6AFzEKou1iIocWBZZ3aE= sha256:vKxaCvC+FoYOPVxGlxsATLlq1G85nKMlFQF9clWSeNk=
User-Agent: Mozilla Thunderbird
Content-Language: en-US-large
In-Reply-To: <uaheh9$1irep$1@paganini.bofh.team>
 by: J.O. Aho - Fri, 4 Aug 2023 08:18 UTC

On 8/4/23 01:47, Invalid wrote:
> Is there anybody here who knows how to merge these partitions?
>
> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
> sda 8:0 0 20G 0 disk
This is the whole disk size you have 20G, so I make the assumption this
is a Linux run in a virutalbox.

> --sda1 8:1 0 7G 0 part /
> --sda2 8:2 0 1K 0 part
> --sda5 8:5 0 975M 0 part [SWAP]

All we can see is that you have a 7G root partition and then a 1K
partition which is quite useless and lastly you have an extended
partition where your swap is located and just under 1G in size.

There is 12G unused space, depending on where it is you could extend the
root partition, for being able to answer that you would need to do a

sudo fdisk -l /dev/sda

if there is space between sda1 and sda2 or if there is space between the
sda2 and the extended partition, then you there is hope to extend the
partition.

Depending on the file system or use of lvm, you could be able to extend
by creating the 12G partition and then add it to the file system
(btrfs/zfs) or add it to the lvm and then extend the root. In the lvm
case you will also need to grow the file system.

I think it may be easier if you create a new virtual machine, do a new
OS install on it and during the install tell it to maximize the use of
the disk, when everything is done, assign the old virtual machines disk
to the new one, copy the files you need from the old install and when
you finished you shut down the new virtual machine and remove the old
virtual machines disk.

--
//Aho

Re: Merge Linux partitions

<ujoupjxivl.ln2@Telcontar.valinor>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1147&group=alt.os.linux#1147

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: robin_listas@es.invalid (Carlos E.R.)
Newsgroups: alt.os.linux
Subject: Re: Merge Linux partitions
Date: Fri, 4 Aug 2023 10:14:22 +0200
Lines: 21
Message-ID: <ujoupjxivl.ln2@Telcontar.valinor>
References: <uaheh9$1irep$1@paganini.bofh.team>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net vfiti/vMQbM5W3jQmuIEvQKVDc7aqNHVOng22Qz8atUf/X6s//
X-Orig-Path: Telcontar.valinor!not-for-mail
Cancel-Lock: sha1:pn3VITs1qTmHn0CBXn0oKnXfJL0= sha256:ZyIqJU0sNMCIr1d+MuxROlCfNI2tgj7c5sWhYhzpCW4=
User-Agent: Mozilla Thunderbird
Content-Language: es-ES, en-CA
In-Reply-To: <uaheh9$1irep$1@paganini.bofh.team>
 by: Carlos E.R. - Fri, 4 Aug 2023 08:14 UTC

On 2023-08-04 01:47, Invalid wrote:
> Is there anybody here who knows how to merge these partitions?
>
> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
> sda 8:0 0 20G 0 disk

The entire disk is 20 Gigs.

> --sda1 8:1 0 7G 0 part /
> --sda2 8:2 0 1K 0 part
> --sda5 8:5 0 975M 0 part [SWAP]
>
> I want to merge 20G with 7G to make it 27G or just to make everything 1
> partition. It might be just 20G in total or 27G in total but I think it
> is 20G in total.

Better post the output of "fdisk -l"

--
Cheers, Carlos.

Re: Merge Linux partitions

<uaie9q$177ck$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1148&group=alt.os.linux#1148

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@needed.invalid (Paul)
Newsgroups: alt.os.linux
Subject: Re: Merge Linux partitions
Date: Fri, 4 Aug 2023 04:53:14 -0400
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <uaie9q$177ck$1@dont-email.me>
References: <uaheh9$1irep$1@paganini.bofh.team>
<kj3qhrFh08mU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 4 Aug 2023 08:53:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b7594f98ac1b3a0ff2929ae6dcab5241";
logging-data="1285524"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18prMf/8fffOCYWS/epTddTHNHfz2AWyCg="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:6Wc9bGuTVQPCrMlYESmzbsLAFgE=
Content-Language: en-US
In-Reply-To: <kj3qhrFh08mU1@mid.individual.net>
 by: Paul - Fri, 4 Aug 2023 08:53 UTC

On 8/4/2023 4:18 AM, J.O. Aho wrote:
> On 8/4/23 01:47, Invalid wrote:
>> Is there anybody here who knows how to merge these partitions?
>>
>> NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
>> sda      8:0    0   20G  0 disk
> This is the whole disk size you have 20G, so I make the assumption this is a Linux run in a virutalbox.
>
>> --sda1   8:1    0    7G  0 part /
>> --sda2   8:2    0    1K  0 part
>> --sda5   8:5    0  975M  0 part [SWAP]
>
> All we can see is that you have a 7G root partition and then a 1K partition which is quite useless and lastly you have an extended partition where your swap is located and just under 1G in size.
>
> There is 12G unused space, depending on where it is you could extend the root partition, for being able to answer that you would need to do a
>
> sudo fdisk -l /dev/sda
>
> if there is space between sda1 and sda2 or if there is space between the sda2 and the extended partition, then you there is hope to extend the partition.
>
> Depending on the file system or use of lvm, you could be able to extend by creating the 12G partition and then add it to the file system (btrfs/zfs) or add it to the lvm and then extend the root. In the lvm case you will also need to grow the file system.
>
> I think it may be easier if you create a new virtual machine, do a new OS install on it and during the install tell it to maximize the use of the disk, when everything is done, assign the old virtual machines disk to the new one, copy the files you need from the old install and when you finished you shut down the new virtual machine and remove the old virtual machines disk.
>

They have made 20GB IDE hard drives in the past.

Multiples of 20 were popular at one time.

I have 40GB (a couple dead Maxtor ones), 60GB, 80GB, 120GB, 160GB
from that era. All retired. My SATA might start at 250GB or so.

And sure, it could also be a .img, a .vhd, a .vdi ...

These are details worth knowing.

Paul

Re: Merge Linux partitions

<op.185vb5kha3w0dxdave@hodgins.homeip.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1149&group=alt.os.linux#1149

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dwhodgins@nomail.afraid.org (David W. Hodgins)
Newsgroups: alt.os.linux
Subject: Re: Merge Linux partitions
Date: Fri, 04 Aug 2023 12:41:55 -0400
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <op.185vb5kha3w0dxdave@hodgins.homeip.net>
References: <uaheh9$1irep$1@paganini.bofh.team>
<kj3qhrFh08mU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="12be1788b82d9269ce954d9995fcc846";
logging-data="1426768"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/py0FZFXWVkD77+CEgzbvnMcz65exZwAY="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:8xQnNGJ3+vP89sEOSqqCkFZVdnE=
 by: David W. Hodgins - Fri, 4 Aug 2023 16:41 UTC

On Fri, 04 Aug 2023 04:18:03 -0400, J.O. Aho <user@example.net> wrote:

> On 8/4/23 01:47, Invalid wrote:
>> Is there anybody here who knows how to merge these partitions?
>>
>> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
>> sda 8:0 0 20G 0 disk
> This is the whole disk size you have 20G, so I make the assumption this
> is a Linux run in a virutalbox.
>
>> --sda1 8:1 0 7G 0 part /
>> --sda2 8:2 0 1K 0 part
>> --sda5 8:5 0 975M 0 part [SWAP]
>
> All we can see is that you have a 7G root partition and then a 1K
> partition which is quite useless and lastly you have an extended
> partition where your swap is located and just under 1G in size.

That 1K sda2 partition is the extended partition entry as shown by lsblk.
The sda5 partition is a logical partition inside of the extended partition.

The disk is using an mbr style partition table.

lsblk is correct in that physically the extended partition is one track with
nothing but a partition table in it. Partitioning tools will show the
extended partition as occupying all of the space reserved for it, which is
logically true, but physically in only uses one track.

Regards, Dave Hodgins

Re: Merge Linux partitions

<kj4ssbFh08mU2@mid.individual.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1150&group=alt.os.linux#1150

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: user@example.net (J.O. Aho)
Newsgroups: alt.os.linux
Subject: Re: Merge Linux partitions
Date: Fri, 4 Aug 2023 20:03:55 +0200
Lines: 29
Message-ID: <kj4ssbFh08mU2@mid.individual.net>
References: <uaheh9$1irep$1@paganini.bofh.team>
<kj3qhrFh08mU1@mid.individual.net> <op.185vb5kha3w0dxdave@hodgins.homeip.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net uiPpwm9KdEaKesy9Jr9A7gND68Nfq9PtrjAIAx/oJKnx1rhj3q
Cancel-Lock: sha1:zLP5Q7uoWu36ygxEBknB4EJm6pc= sha256:2L5L798f1fx86aMn4fPzuFWnRZPsSIgxbhL1du8yRRA=
User-Agent: Mozilla Thunderbird
Content-Language: en-US-large
In-Reply-To: <op.185vb5kha3w0dxdave@hodgins.homeip.net>
 by: J.O. Aho - Fri, 4 Aug 2023 18:03 UTC

On 8/4/23 18:41, David W. Hodgins wrote:
> On Fri, 04 Aug 2023 04:18:03 -0400, J.O. Aho <user@example.net> wrote:
>
>> On 8/4/23 01:47, Invalid wrote:
>>> Is there anybody here who knows how to merge these partitions?
>>>
>>> NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
>>> sda      8:0    0   20G  0 disk
>> This is the whole disk size you have 20G, so I make the assumption this
>> is a Linux run in a virutalbox.
>>
>>> --sda1   8:1    0    7G  0 part /
>>> --sda2   8:2    0    1K  0 part
>>> --sda5   8:5    0  975M  0 part [SWAP]
>>
>> All we can see is that you have a 7G root partition and then a 1K
>> partition which is quite useless and lastly you have an extended
>> partition where your swap is located and just under 1G in size.
>
> That 1K sda2 partition is the extended partition entry as shown by lsblk.
> The sda5 partition is a logical partition inside of the extended partition.

Good you pointed out, it's a long time since I used mbr based with
extended partitions, I tended quite often just give the lvm or btrfs the
whole disk.

--
//Aho

Re: Merge Linux partitions

<uak13p$1etg2$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1156&group=alt.os.linux#1156

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@needed.invalid (Paul)
Newsgroups: alt.os.linux
Subject: Re: Merge Linux partitions
Date: Fri, 4 Aug 2023 19:20:25 -0400
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <uak13p$1etg2$1@dont-email.me>
References: <uaheh9$1irep$1@paganini.bofh.team>
<kj3qhrFh08mU1@mid.individual.net> <op.185vb5kha3w0dxdave@hodgins.homeip.net>
<kj4ssbFh08mU2@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 4 Aug 2023 23:20:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b92d171463ee26ebda727ac240bb8b13";
logging-data="1537538"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cD/2H3E0yQTmHlnCy5e9g4sX+WNDDSxg="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:VyqcnRTTW3G1YUrnyswTltXe+34=
In-Reply-To: <kj4ssbFh08mU2@mid.individual.net>
Content-Language: en-US
 by: Paul - Fri, 4 Aug 2023 23:20 UTC

On 8/4/2023 2:03 PM, J.O. Aho wrote:
> On 8/4/23 18:41, David W. Hodgins wrote:
>> On Fri, 04 Aug 2023 04:18:03 -0400, J.O. Aho <user@example.net> wrote:
>>
>>> On 8/4/23 01:47, Invalid wrote:
>>>> Is there anybody here who knows how to merge these partitions?
>>>>
>>>> NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
>>>> sda      8:0    0   20G  0 disk
>>> This is the whole disk size you have 20G, so I make the assumption this
>>> is a Linux run in a virutalbox.
>>>
>>>> --sda1   8:1    0    7G  0 part /
>>>> --sda2   8:2    0    1K  0 part
>>>> --sda5   8:5    0  975M  0 part [SWAP]
>>>
>>> All we can see is that you have a 7G root partition and then a 1K
>>> partition which is quite useless and lastly you have an extended
>>> partition where your swap is located and just under 1G in size.
>>
>> That 1K sda2 partition is the extended partition entry as shown by lsblk.
>> The sda5 partition is a logical partition inside of the extended partition.
>
> Good you pointed out, it's a long time since I used mbr based with extended partitions, I tended quite often just give the lvm or btrfs the whole disk.
>

The size of the Extended is *two sectors*.

It is a tiny linkage declaring the details of Extended.

In addition, as you add Logicals, there are additional 1KB "things"
which link them, but I've never bothered to investigate. All I
can tell you, is PTEDIT32.exe from PowerQuest was a free "readout"
for MBR partitioning, and it had some "weird behaviors" when you
walked what was supposed to be a linked list of Logicals. Something
seemed to be chopped up in pairs of Logicals. If you had five Logicals,
that would be two pairs, and the start of a third pair. Linkages of
that kind, are easier to break, the longer you make them. If you
created twenty logicals, there would be some non-zero risk caused
by the method they used for the representation.

PTEDIT32 would never read out all twenty logicals at the same time,
and you could only look at a "window" of a couple logicals and
get the numeric details. And I don't think this was purely a graphical
representation limit. A term that I remember from the interface,
was "EPBR", whatever that means.

https://en.wikipedia.org/wiki/Extended_boot_record

Paul

Re: Merge Linux partitions

<op.186i3kcea3w0dxdave@hodgins.homeip.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1160&group=alt.os.linux#1160

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dwhodgins@nomail.afraid.org (David W. Hodgins)
Newsgroups: alt.os.linux
Subject: Re: Merge Linux partitions
Date: Fri, 04 Aug 2023 21:15:10 -0400
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <op.186i3kcea3w0dxdave@hodgins.homeip.net>
References: <uaheh9$1irep$1@paganini.bofh.team>
<kj3qhrFh08mU1@mid.individual.net> <op.185vb5kha3w0dxdave@hodgins.homeip.net>
<kj4ssbFh08mU2@mid.individual.net> <uak13p$1etg2$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="5f49fcc28e7c5bebce83c34291db1afd";
logging-data="1694139"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KwLPw8htdnitWOQ2P10x8ncABfw9uXf4="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:RRenw2o/BUt+yqVFb8ReDig32Hk=
 by: David W. Hodgins - Sat, 5 Aug 2023 01:15 UTC

On Fri, 04 Aug 2023 19:20:25 -0400, Paul <nospam@needed.invalid> wrote:
> The size of the Extended is *two sectors*.
>
> It is a tiny linkage declaring the details of Extended.
>
> In addition, as you add Logicals, there are additional 1KB "things"
> which link them, but I've never bothered to investigate. All I
> can tell you, is PTEDIT32.exe from PowerQuest was a free "readout"
> for MBR partitioning, and it had some "weird behaviors" when you
> walked what was supposed to be a linked list of Logicals. Something
> seemed to be chopped up in pairs of Logicals. If you had five Logicals,
> that would be two pairs, and the start of a third pair. Linkages of
> that kind, are easier to break, the longer you make them. If you
> created twenty logicals, there would be some non-zero risk caused
> by the method they used for the representation.
>
> PTEDIT32 would never read out all twenty logicals at the same time,
> and you could only look at a "window" of a couple logicals and
> get the numeric details. And I don't think this was purely a graphical
> representation limit. A term that I remember from the interface,
> was "EPBR", whatever that means.
>
> https://en.wikipedia.org/wiki/Extended_boot_record

EPBR stands for extended partition boot record.

Though lsblk shows 1KB, it's actually just one 512 byte sector. In a disk
using dos style partition tables, the mbr has the bootstrap code, the primary
partition table, and a two byte signature (hex 55 AA). A total of 512 bytes.
The rest of the first track is not used by dos.

One of the primary partitions may be used to define an extended partition.

In an extended partition, the logical partitions each have a boot record
(one sector) with just a partition table that gives that partitions start and
size.

All of the logical partitions except the last one have a second partition
table entry that points to the location of the next logical partition.

I've used a hex editor the help people recover when they deleted the wrong
partition, without access at that time to a proper partition table editor.

Regards, Dave Hodgins

Re: Merge Linux partitions

<uamdqa$7bqt$1@paganini.bofh.team>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1175&group=alt.os.linux#1175

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!paganini.bofh.team!not-for-mail
From: invalid@invalid.net (Invalid)
Newsgroups: alt.os.linux
Subject: Re: Merge Linux partitions
Date: Sat, 5 Aug 2023 22:05:43 +0100
Organization: To protect and to server
Message-ID: <uamdqa$7bqt$1@paganini.bofh.team>
References: <uaheh9$1irep$1@paganini.bofh.team>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 5 Aug 2023 21:09:30 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="241501"; posting-host="lvwnlrZOTyXOUFTBTyWy3g.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
Cancel-Lock: sha256:BOM4EWuD6IhqU1AR3/10dFzsa7rXQ+vNtCjr1k3CcQ8=
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.3
 by: Invalid - Sat, 5 Aug 2023 21:05 UTC

On 04/08/2023 00:47, Invalid wrote:
> Is there anybody here who knows how to merge these partitions?
>
> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
> sda 8:0 0 20G 0 disk
> --sda1 8:1 0 7G 0 part /
> --sda2 8:2 0 1K 0 part
> --sda5 8:5 0 975M 0 part [SWAP]
>
> I want to merge 20G with 7G to make it 27G or just to make everything 1
> partition. It might be just 20G in total or 27G in total but I think it
> is 20G in total.
>
> Thank you.

Everything is now OK according to this image:

https://i.imgur.com/hWBih3w.png

From 20GB it became 21 GB and I don't know how but that's not a
problem. I guess it might be because I removed sda2 (1K ??? only)
completely as it was not necessary. Now there are just two partitions -
20GB and 1GB

The machine is used as a server to develop web sites so disk space is
enough for it. The access is via SSH or Webmin.

Thanks to all who responded with good comments.

Re: Merge Linux partitions

<uan3ic$23bj4$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1177&group=alt.os.linux#1177

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@needed.invalid (Paul)
Newsgroups: alt.os.linux
Subject: Re: Merge Linux partitions
Date: Sat, 5 Aug 2023 23:20:42 -0400
Organization: A noiseless patient Spider
Lines: 77
Message-ID: <uan3ic$23bj4$1@dont-email.me>
References: <uaheh9$1irep$1@paganini.bofh.team>
<uamdqa$7bqt$1@paganini.bofh.team>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 6 Aug 2023 03:20:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="71e07d16f41a931442ab422079b574e7";
logging-data="2207332"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/PTRRTNT3BIGXubwzMqiAuvVmFLHKd8Q="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:hRLVq3dAN8yOWTx9bnbSSiljM80=
Content-Language: en-US
In-Reply-To: <uamdqa$7bqt$1@paganini.bofh.team>
 by: Paul - Sun, 6 Aug 2023 03:20 UTC

On 8/5/2023 5:05 PM, Invalid wrote:
> On 04/08/2023 00:47, Invalid wrote:
>> Is there anybody here who knows how to merge these partitions?
>>
>> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
>> sda 8:0 0 20G 0 disk
>> --sda1 8:1 0 7G 0 part /
>> --sda2 8:2 0 1K 0 part
>> --sda5 8:5 0 975M 0 part [SWAP]
>>
>> I want to merge 20G with 7G to make it 27G or just to make everything 1
>> partition. It might be just 20G in total or 27G in total but I think it
>> is 20G in total.
>>
>> Thank you.
>
> Everything is now OK according to this image:
>
> https://i.imgur.com/hWBih3w.png
>
> From 20GB it became 21 GB and I don't know how but that's not a
> problem. I guess it might be because I removed sda2 (1K ??? only)
> completely as it was not necessary. Now there are just two partitions -
> 20GB and 1GB
>
> The machine is used as a server to develop web sites so disk space is
> enough for it. The access is via SSH or Webmin.
>
> Thanks to all who responded with good comments.

If you remove the Extended, that kills the Logical instantly :-)

Neat, eh ?

Think of the damage removing that 1KB causes.

You got an extra 1GB by zapping your swap partition.
Hmmm. What does "top" say, about your swap ?

*******

When you work with Extended/Logical, there is an "order"
to how you do things. I was not joking when I said some
operations might take five steps. Those are steps you take
so your swap does not get zapped.

If you use dynamically-expanding containers for a VM,
that gives you the most space efficient storage. With
some work, they can be compacted when internal
space is freed up.

For example, on a Windows Guest VM here, I do this:

sdelete -z C:

Then, shut down the Guest. Then, do a compact on the
container (and all the zeroed areas are removed from
physical storage).

Since I use nothing but dynamic containers here, I
generally assign 64GB virtual drives, and the physical
space taken, is only as much as the files stored in it.
The typical container storage is only about 20GB or so.
But there is room for expansion in an emergency.

The VM software can also "Pause" a VM in the event it
runs out of some resource. I've freed up enough RAM in
the Host before, to be able to "un-pause" a Guest
in that state.

*******

In a VM, you can "clone" from a too-small container,
to a larger brand-new container. That is one way to do
maintenance on them.

Paul

Re: Merge Linux partitions

<kj9382FimqcU1@mid.individual.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=1178&group=alt.os.linux#1178

  copy link   Newsgroups: alt.os.linux
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: user@example.net (J.O. Aho)
Newsgroups: alt.os.linux
Subject: Re: Merge Linux partitions
Date: Sun, 6 Aug 2023 10:17:06 +0200
Lines: 44
Message-ID: <kj9382FimqcU1@mid.individual.net>
References: <uaheh9$1irep$1@paganini.bofh.team>
<uamdqa$7bqt$1@paganini.bofh.team>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net aG77vTSmdto4IPQttp3jdQjAA4pO3HNNuxsQJWMdNz7RFE17lY
Cancel-Lock: sha1:oeQqADvRBk9ViULOR04KRi/k9eY= sha256:rc2o1wM6koZBBLG8kEPGPaKTWwb8V7G604Pxhg7Skoc=
User-Agent: Mozilla Thunderbird
Content-Language: en-US-large
In-Reply-To: <uamdqa$7bqt$1@paganini.bofh.team>
 by: J.O. Aho - Sun, 6 Aug 2023 08:17 UTC

On 8/5/23 23:05, Invalid wrote:
> On 04/08/2023 00:47, Invalid wrote:
>> Is there anybody here who knows how to merge these partitions?
>>
>> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
>> sda 8:0 0 20G 0 disk
>> --sda1 8:1 0 7G 0 part /
>> --sda2 8:2 0 1K 0 part
>> --sda5 8:5 0 975M 0 part [SWAP]
>>
>> I want to merge 20G with 7G to make it 27G or just to make everything 1
>> partition. It might be just 20G in total or 27G in total but I think it
>> is 20G in total.
>>
>> Thank you.
>
> Everything is now OK according to this image:
>
> https://i.imgur.com/hWBih3w.png
>
> From 20GB it became 21 GB and I don't know how but that's not a
> problem. I guess it might be because I removed sda2 (1K ??? only)
> completely as it was not necessary. Now there are just two partitions -
> 20GB and 1GB

You should have kept on reading the thread, then you would have seen the
mistake I did. I think it can be so bad that the sda1 is now considered
the whole disk and the swap partition (used to be sda5 which may now be
sda2) may be located in the end of the sda1 so the OS disk could in
worst case write something in the end of the disk and then the swap just
overwrites it, it then looks like the file exists when you do a 'ls' but
you will get read/write errors when you try to read a such file.

You should run "fdisk -l /dev/sda" in the virtual machine, so we can see
how the OS sees the disk, we may still have time to save things. If you
have a snapshot before you did the changes, I would recommend to revert
to that snapshot.

Also did you run "resize2fs /dev/sda1" in the virtual machine? for even
if the partition is now 20G

--
//Aho

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor