Partition "in use" trouble prevents dual-boot install on new laptop

Get help: I just got an HP 15t laptop to try out some some server apps (e.g. mediawiki), do ham radio configuration, get a better feel for desktop linux (Manjaro looks great!). I want to dual-boot linux and Windows (it’s a cheap laptop, i3 CPU 4GB 1TB+16GB Optane), and I fear virtualizing either OS will be too slow).

My live USB stick with XFCE boots and runs fine, but attempts to install failed with volume “in use” errors. I did a factory reinstall of Windows from a recovery USB, then booted XFCE again to try first partitioning with GParted as suggested in another forum thread. GParted did not allow me to resize the big partition on the 1TB drive so I can add a linux partition. So, I used Windows diskmanager to resize and create an exFat partition, and (in another attempt) leave the space blank to have either the Manjaro installer or GParted create the new partition, both failed, with messages like “/dev/sda6 in use” (where sda6 was the new partition being created).

(I saved the GParted diagnostic file if that’s of interest.)

Also, launching GParted displays an error dialog titled “Libparted Error”: “Could not stat device /dev/mapper/isw: untested metadata version 1.4.01 found on /dev/sda - No such file or directory." I cancel the dialog to continue.

GParted warns about a backup map(?) being missing, then lists the partitions. Two have warning badges. Note that one of the bad “partitions" is actually the 16GB Optane SSD that came with this laptop. I wonder if that is causing trouble for GParted.

Should I look for a newer version of GParted or is there some library dependency I should install? Give up and virtualize one or the other?

Any suggestions? Thanks!

You probably need to turn off fast boot in windows.

What was the exact error message?

You guys are fast!
I turned off fast boot in windows. Did not have any apparent effect.
The error when I try to create partition in free space with GParted:
(operation:) mkfs.ext4 -F -O ^64bit -L "'/dev/sda6'
mke2fs 1.44.2 (14-May-2018)
/dev/sda6 is apparently in use by the system; will not make a filesystem here!

Is it mounted?

What is the output of mount and lsblk

Just to clarify, I retried creating a partition after turning off fast boot, which was on as @dalto suspected. The error message is from the latest try

Here you go @dalto (thanks)

[manjaro@manjaro ~]$ mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=1958340k,nr_inodes=489585,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /run/miso/bootmnt type iso9660 (ro,relatime,nojoliet,check=s,map=n,blocksize=2048)
cowspace on /run/miso/cowspace type tmpfs (rw,relatime,size=262144k,mode=755)
overlay_root on /run/miso/overlay_root type tmpfs (rw,relatime,size=2967584k,mode=755)
/dev/loop0 on /run/miso/sfs/livefs type squashfs (ro,relatime)
/dev/loop1 on /run/miso/sfs/mhwdfs type squashfs (ro,relatime)
/dev/loop2 on /run/miso/sfs/desktopfs type squashfs (ro,relatime)
/dev/loop3 on /run/miso/sfs/rootfs type squashfs (ro,relatime)
overlay on / type overlay (rw,relatime,lowerdir=/run/miso/sfs/livefs:/run/miso/sfs/mhwdfs:/run/miso/sfs/desktopfs:/run/miso/sfs/rootfs,upperdir=/run/miso/overlay_root/upper,workdir=/run/miso/overlay_root/work,index=off)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=44,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=10487)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /etc/pacman.d/gnupg type tmpfs (rw,relatime,mode=755)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=395676k,mode=700,uid=1000,gid=1000)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
[manjaro@manjaro ~]$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0  62.4M  1 loop /run/miso/sfs/livefs
loop1    7:1    0 281.8M  1 loop /run/miso/sfs/mhwdfs
loop2    7:2    0 954.6M  1 loop /run/miso/sfs/desktopfs
loop3    7:3    0 432.5M  1 loop /run/miso/sfs/rootfs
sda      8:0    0 931.5G  0 disk 
├─sda1   8:1    0   260M  0 part 
├─sda2   8:2    0    16M  0 part 
├─sda3   8:3    0 524.8G  0 part 
├─sda4   8:4    0   980M  0 part 
├─sda5   8:5    0  14.7G  0 part 
└─sda6   8:6    0 390.7G  0 part 

sdb      8:16   1   3.8G  0 disk 
├─sdb1   8:17   1   1.8G  0 part /run/miso/bootmnt
└─sdb2   8:18   1     4M  0 part

(sda6 was created by GParted before it errored)

Seems non of the sda devices are mounted. What is the output of sudo fdisk -l?

@philm

[manjaro@manjaro ~]$ sudo fdisk -l
Disk /dev/loop0: 62.4 MiB, 65433600 bytes, 127800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 281.8 MiB, 295501824 bytes, 577152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 954.6 MiB, 1000914944 bytes, 1954912 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 432.5 MiB, 453517312 bytes, 885776 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


The backup GPT table is not on the end of the device. This problem will be corrected by write.
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 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: 431DF77C-DBF6-4D30-B497-132A3BCD8414

Device          Start        End    Sectors   Size Type
/dev/sda1        2048     534527     532480   260M EFI System
/dev/sda2      534528     567295      32768    16M Microsoft reserved
/dev/sda3      567296 1101209599 1100642304 524.8G Microsoft basic data
/dev/sda4  1920614400 1922621439    2007040   980M Windows recovery environment
/dev/sda5  1922621440 1953511423   30889984  14.7G Microsoft basic data
/dev/sda6  1101209600 1920614399  819404800 390.7G Linux filesystem

Partition table entries are not in disk order.


Disk /dev/sdb: 3.8 GiB, 4009754624 bytes, 7831552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x89186580

Device     Boot   Start     End Sectors  Size Id Type
/dev/sdb1  *         64 3655995 3655932  1.8G cd unknown
/dev/sdb2       3655996 3664187    8192    4M ef EFI (FAT-12/16/32)
[manjaro@manjaro ~]$

(GParted complained about a bad GPT backup table too at some point, not today)

Well, lets get geeky then :wink: In the past we used the application cfdisk as we only had a cli installer back then.

Here the old guide to it. It is always good to know the basics of partitioning. You may try to delete and recreate the partition with it. Also you can try to force the unmount of the device first: sudo umount -f /dev/sda6 or sudo umount -l /dev/sda6


However I think your issue is some else. The system thinks the partition is somehow part of a RAID. Remember: don't delete unwanted partitions or files you still need. Always do a backup of your files first!

So you need to remove the RAID signature of it. First check if the needed applications are installed: pacman -Q mdadm dmraid. If not, install them via sudo pacman -Sy mdadm dmraid.

The following example goes for the drive sdb. You may need to change it to sda.

Check if you have some RAID signatures via sudo dmraid -r. You may get some like:

/dev/sdb: ddf1, ".ddf1_disks", GROUP, ok, 3904294912 sectors, data@ 0

You may find it then here via ls /dev/mapper/ddf*

You may fail with the command sudo dmsetup remove /dev/mapper/ddfs1_... like this:

device-mapper: remove ioctl on ddf1_49424d202020202010000073101403b141c2c9e96c8236dbp1 failed: Device or resource busy
Command failed

OK, the next step might be a little critical to do. Remove RAID status by dmraid via sudo dmraid -r -E /dev/sdb

In my example it still failed:

Do you really want to erase "ddf1" ondisk metadata on /dev/sdb ? [y/n] :y

ERROR: ddf1: seeking device "/dev/sdb" to 1024204253954048
ERROR: writing metadata to /dev/sdb, offset 2000398933504 sectors, size 0 bytes returned 0
ERROR: erasing ondisk metadata on /dev/sdb

Via the mighty dd I wiped the disk.

sudo dd if=/dev/zero of=/dev/sdb bs=512 seek=$(( $(blockdev --getsz /dev/sdb) - 1024 )) count=1024

So you may try that only for your partition sda6 via:

sudo dd if=/dev/zero of=/dev/sda6 bs=512 seek=$(( $(blockdev --getsz /dev/sda6) - 1024 )) count=1024

Checking via sudo dmraid -r should show now: no raid disks.

2 Likes

Wow- great! I will try those things, but first I'm nodding off and probably not in the best shape to do "critical". I will pick this up again tomorrow. FYI, while you were writing that massive reply, I looked around and found this recent topic Windows 10 - Manjaro - Dual-boot - Step by Step

I might find something useful there too. Thanks for taking the time to create that guidance. This territory is somewhat, but not entirely, unfamiliar. Much appreciated. --Paul

No problem. We are always keen to help. Have a good nap.

1 With cfdisk, I created a partition (tried types Linux filesystem, Linux home, and Linux extended boot, which sounded best since exFAT is not offered). GParted saw but did not recognize the partition (“unknown”). But it stopped putting up error alerts, so that’s new since running cfdisk.

dmraid -r already said "no raid disks” the first time I ran it, so there was no raid status to remove, I infer, and I did not try removing any. And GParted still cant create a partition, or at least put a filesystem on one from cfdisk.

On the plus side, windows stalls after I log in now :-).

I will keep at it.

Success! @philm was of course correct about a RAID, it was the Optane.

I turned that off in the built-in InsysdeH20 Setup Utility under System Configuration > Intel Rapid Storage Technology. I read the dire warning that I must intend to erase my hard drive (it didn't), and disabled Optane on one of the two physical drives. (It said I needed to also disable a partner device, presumably the other drive, but I saw no option to do that.) F10 Save and exit.
Then I followed the manual partition instructions in that Windows 10 install thread and it installed with no errors.

efibootmanager indicates that Windows boot is first, which I think is not what I'm supposed to do, but I will figure that out later. I used the startup escape key (esc on HP), choose EFI hard disk, got a Manjaro option, and it loaded my new Manjaro instance on the hard disk.

Thanks for the detailed help. I look forward to getting more familiar with Manjaro.

At terminal, 'efibootmgr' will show bootorder and manjaro bootentry. Do

sudo efibootmgr -o xxxx,yyyy,zzzz

where xxxx is manjaro bootentry.

Thanks @gohilp . efibootmanager does not list a "Manjaro", and I tried changing to a different order, but for me what worked was to install rEFInd, and in the Insyde setup utility, order it in front of the Windows boot manager. Pretty happy with that.

Good to hear rEFInd works well for you.
Can you please check something for us?
At terminal, please provide

efibootmgr
efibootmgr -v
sudo blkid

@AgentS & I suspect that the grub-install (and at OS grub bootloader installation) does not make grub bootloader into the device boot efi_file (bootx64.efi) and does not create a efi_bootentry for it as well. My rEFInd (and systemd-boot) does. I wonder if it does for you as well. Thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by