You are not logged in.

#1 2022-10-17 11:00:42

0nep4th
Member
Registered: 2022-10-17
Posts: 5

[SOLVED] Merge partitions/SDA

Hello Dear Community,

I recently installed Arch (XFCE4) using the Arch Installer script. Initially I had some problems as the installation refused to install Arch. Somehow I managed to install it after all.

Now I noticed that it created several sda (see picture). In my laptop is only a ~900 GB hard drive installed. The home directory is on the sda2 19.5 GB. I would like to merge the sda3 with the sda2.

Since I've never done this before, and don't want to denigrate my system, I'd really appreciate it if someone could take me in hand.

Thank you very much, in advance.

HD

Link to the Picture

Last edited by 0nep4th (2022-10-18 05:59:29)

Offline

#2 2022-10-17 11:13:46

frostschutz
Member
Registered: 2013-11-15
Posts: 1,647

Re: [SOLVED] Merge partitions/SDA

never used the installer script before so not sure what it does

is there anything on /dev/sda3? you're probably supposed to mount that as /home. what does df -h show, what's in /etc/fstab?

if /dev/sda3 is empty and you have /home really on the /dev/sda2 / rootfs, it's just a matter of adding the fstab entry, and copying your existing /home over.

but I'm not clear if that is your situation. you also don't have to post text as a picture, you can copy paste it as a code block, or use a paste service

Offline

#3 2022-10-17 17:26:44

0nep4th
Member
Registered: 2022-10-17
Posts: 5

Re: [SOLVED] Merge partitions/SDA

i'm pretty sure that /home is in sda2. But if you tell me how to check the right way i would rather check it twice.

--(1919:Mo,17 Okt 22:$ )-- df -h
Dateisystem    Größe Benutzt Verf. Verw% Eingehängt auf
dev             3,9G       0  3,9G    0% /dev
run             3,9G    1,1M  3,9G    1% /run
/dev/sda2        20G     10G  8,1G   56% /
tmpfs           3,9G     25M  3,8G    1% /dev/shm
tmpfs           3,9G    912K  3,9G    1% /tmp
/dev/sda1       510M     71M  440M   14% /boot
tmpfs           781M     44K  781M    1% /run/user/1000
/dev/sda3       897G    103M  851G    1% /run/media/wiizz/4859336e-bd0d-4bf7-9853-8f126655f051

There is only one dir and one video file. thats all.

Fstab:

1 # Static information about the filesystems.
  2 # See fstab(5) for details.
  3 
  4 # <file system> <dir> <type> <options> <dump> <pass>
  5 # /dev/sda2^M
  6 UUID=36fdacb0-56c6-4fb2-bfcd-084e0719a874       /               ext4            rw,relatime     0 1^M
  7 ^M
  8 # /dev/sda1^M
  9 UUID=1805-C2CC          /boot           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro   0 2^M
 10 ^M
 11 # /dev/sda2^M
 12 UUID=36fdacb0-56c6-4fb2-bfcd-084e0719a874       /home           ext4            rw,relatime     0 2^M
 13 ^M

if /dev/sda3 is empty and you have /home really on the /dev/sda2 / rootfs, it's just a matter of adding the fstab entry, and copying your existing /home over.

how exactly do i apply this?

Last edited by 0nep4th (2022-10-17 17:27:25)

Offline

#4 2022-10-17 17:42:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,480
Website

Re: [SOLVED] Merge partitions/SDA

It looks like sda3 was supposed to be your home partition, but there is an obvious error in your fstab that needs to be fixed (if it isn't obvious to you, you need to actually look at the content of the file and understand it).

You can boot into single user mode, make sure sda3 is unmounted (or unmount it as needed), then remount it at /mnt, then just `mv /home/* /mnt`, unmount sda3, fix the fstab, the reboot.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2022-10-17 17:57:16

0nep4th
Member
Registered: 2022-10-17
Posts: 5

Re: [SOLVED] Merge partitions/SDA

It looks like sda3 was supposed to be your home partition, but there is an obvious error in your fstab that needs to be fixed (if it isn't obvious to you, you need to actually look at the content of the file and understand it).

You can boot into single user mode, make sure sda3 is unmounted (or unmount it as needed), then remount it at /mnt, then just `mv /home/* /mnt`, unmount sda3, fix the fstab, the reboot.

Thanks for your help.

I am very open when it comes to troubleshooting myself and understanding why a particular error occurred. My beginner eye only sees 2 things that may be relevant:

- errors=remount-ro 0 2^m
- There are two sda2. The sda3 is missing.

Nevertheless, I don't want to crash my system and I'd rather wait for a hopeful, detailed help and description for understanding.

Offline

#6 2022-10-17 18:14:46

frostschutz
Member
Registered: 2013-11-15
Posts: 1,647

Re: [SOLVED] Merge partitions/SDA

Your fstab should not contain line numbers nor ^M but I'm not sure if that is your problem or just a copy&paste issue.

Also if the filesystems were really mounted the way described in your fstab, then the mv command mentioned earlier would break your system for good — UUID for / and /home must not be identical but it is in the fstab you showed.

If it was actually mounted like that, then / and /home would be showing the same files, your homedir would be /home/user but also /user, and moving /home/* away would empty out your / instead. At this point your system will no longer boot at all.

You can check with `blkid` which filesystems and UUIDs you have, and then make sure to set it correctly in your fstab.

Offline

#7 2022-10-17 18:36:27

0nep4th
Member
Registered: 2022-10-17
Posts: 5

Re: [SOLVED] Merge partitions/SDA

When I type in blkid, nothing happens except this:

--(2035:Mo,17 Okt 22:$ )-- blkid
--(wiizz@wiizz)-(/home/wiizz)--

Offline

#8 2022-10-17 18:51:08

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Merge partitions/SDA

0nep4th wrote:

My beginner eye only sees 2 things that may be relevant:

The most obvious thing you are missing is that ^M shouldn't appear anywhere in the file.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#9 2022-10-17 21:01:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,480
Website

Re: [SOLVED] Merge partitions/SDA

Well to me the relevant thing is that the sda2 is in there twice and sda3 not at all.  The line numbers and ^M, of course, shouldn't be there - but it's a pretty safe bet they aren't actually in the file but are the result of copying and pasting from some text editor.  So lets not focus on that.

I'd wager that when you initially installed the system you made a simple single error in mounting your partitions.  You created three partitions of appropriate sizes, but then you did something like the following:

mount /dev/sda2 /mnt
mkdir /mnt/home /mnt/boot
mount /dev/sda1 /mnt/boot
mount /dev/sda2 /mnt/home # here's the error as it should have been /dev/sda3

That single error would explain all the symptoms as the subsequent use of genfstab would create an fstab just like the one you posted (again, ignoring the line numbers and ^M which seem obvious to me to be just copy-paste artifacts).

So the solution really is just to fix the fstab, and move any content under /home on sda2 to sda3.  The directory /home should exist on sda2, but it should be empty as it is just a mount point.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2022-10-18 05:57:59

0nep4th
Member
Registered: 2022-10-17
Posts: 5

Re: [SOLVED] Merge partitions/SDA

Trilby wrote:

Well to me the relevant thing is that the sda2 is in there twice and sda3 not at all.  The line numbers and ^M, of course, shouldn't be there - but it's a pretty safe bet they aren't actually in the file but are the result of copying and pasting from some text editor.  So lets not focus on that.

I'd wager that when you initially installed the system you made a simple single error in mounting your partitions.  You created three partitions of appropriate sizes, but then you did something like the following:

mount /dev/sda2 /mnt
mkdir /mnt/home /mnt/boot
mount /dev/sda1 /mnt/boot
mount /dev/sda2 /mnt/home # here's the error as it should have been /dev/sda3

That single error would explain all the symptoms as the subsequent use of genfstab would create an fstab just like the one you posted (again, ignoring the line numbers and ^M which seem obvious to me to be just copy-paste artifacts).

So the solution really is just to fix the fstab, and move any content under /home on sda2 to sda3.  The directory /home should exist on sda2, but it should be empty as it is just a mount point.

I now understood where the problem was and was able to solve it.

Thank you very much

Offline

Board footer

Powered by FluxBB