You are not logged in.
Pages: 1
Hello people , i just installed arch linux in my laptop ,
I had reserved space for my swap partition for about 2 Gb but when the os boots i get an error
[FAILED] failed to activate swap /dev/sda1.
see 'systemctl status dev-sda1.swap' for details
[DEPEND] dependency failed for swap.
systemctl status dev-sda1.swap gives
-----------------------------------------------------------------------------------------------------------------------------------------
* dev-sda1.swap - /dev/sda1
Loaded: loaded (/etc/fstab; generated; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2017-02-19 16:21:10 IST; 27min ago
What: /dev/sda1
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
-----------------------------------------------------------------------------------------------------------------------------------------
fdisk -l gives me :
---------------------------------------------------------------------------------------------------
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 99C20066-8D44-4C3B-9666-E6F084A4D329
Device Start End Sectors Size Type
/dev/sda1 2048 4196351 4194304 2G BIOS boot
/dev/sda2 4196352 976773134 972576783 463.8G Linux filesystem
-------------------------------------------------------------------------------------------------
the fstab file in /etc/fstab has
-------------------------------------------------------------------------------------------------
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
# UUID=d9b260e1-dac6-4c05-9150-1839acdf7974
/dev/sda2 / ext4 rw,relatime,data=ordere$
# UUID=aa8882d5-1b81-4940-b48d-0b54fb17ebec
/dev/sda1 none swap defaults 0 0
--------------------------------------------------------------------------------------------------
I am really confused now
Offline
/dev/sda1 is a BIOS boot partition rather than a swap partition.
Delete the sda1 partition and use `gdisk` to create a new one of type 8300 8200 and then use:
# mkswap /dev/sda1
# swapon /dev/sda1
EDIT: if you are booting in non-UEFI ("Legacy") mode then deleting the BIOS boot partition will cause your system to become unbootable, you will have to create a new BIOS boot partiiton (type EF02 in `gdisk`) and re-install the GRUB bootloader to the disk to fix this — I use the "spare" sectors 34-2047 for BIOS boot partitions, they should *not* be formatted.
EDIT2: corrected swap partition code.
Last edited by Head_on_a_Stick (2017-02-19 16:06:33)
Offline
I have a question , why is the fstab file in /etc/fstab shows that sda1 is a swap partition (posted in the question)
and can't just create a new swap partition without deleting the bios boot partition as i think i am booting in the legacy mode
Offline
why is the fstab file in /etc/fstab shows that sda1 is a swap partition
You must have done it wrong
But seriously, the `genfstab` script is not infallible and the Installation Guide does advise:
Check the resulting file in /mnt/etc/fstab afterwards, and edit it in case of errors.
can't just create a new swap partition without deleting the bios boot partition as i think i am booting in the legacy mode
Well, you can if you want to and that would work just fine as long as the swap line in /etc/fstab was either modified or deleted (systemd will automount swap partitions on GPT disks, no fstab entries are required).
However, a BIOS boot partition only needs to be a few hundred KiB in size so using a 2 GiB partition seems rather wasteful — the sectors between 34 & 2047 should be empty if your drive is aligned correctly are empty in your drive and that space is big enough for the GRUB files.
Last edited by Head_on_a_Stick (2017-02-19 13:40:20)
Offline
well okay , half of it i understood and half of it i didn't (sorry) . Can you please tell what should i exactly do now cause i dont want to mess something now
Offline
My advice would be to first remove the swap line from /etc/fstab because you do not need it.
Then change the partition code of /dev/sda1 from ef02 (BIOS boot partition) to 8200 (Linux swap), these are the codes used by the `gdisk` command, I think gparted uses named flags for this instead.
You should also create a new BIOS boot partiton ("ef02") starting at sector 34 and ending at sector 2047, do not format this new partition.
Once this is done, run the `mkswap` command and re-install the GRUB bootloader to the disk.
Offline
Oh now i completely understand the issue , while installing grub i had an error
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Installing for i386-pc platform.
grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: error: embedding is not possible, but this is required for cross-disk install.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
so i searched for the error and found the solution using these commands
-----------------------------------------------------
$ pacman -S parted
$ parted /dev/sda set 1 bios_grub on
$ parted /dev/sda print
-----------------------------------------------------
i guess these commands set my bios boot on sda1 , and maybe thats the reasons there are conflicting results for fdisk -l and fstab file , Now it all makes sense , thank you for sticking around with me , i guess i know the solution now .
So knowing my current scenario , is there anything else do you'd like to add ? and is safe to manipulate my partitions and won't cause any issue if done the correct way ?
Offline
and i wanted to learn more about efi and legacy mode , can you suggest some articles , because i read that bios is not used now , so would it be better to boot the system in uefi mode.?
Offline
So knowing my current scenario , is there anything else do you'd like to add ? and is safe to manipulate my partitions and won't cause any issue if done the correct way ?
All looks good to me.
Make it so.
i wanted to learn more about efi and legacy mode , can you suggest some articles
Offline
This is excellent material , thank you !!
Offline
You're welcome
If the problem is [SOLVED] then please mark the thread so for the benefit of others.
Offline
Pages: 1