Skip to content
TheChatArchiveThe Chat Archive
gpt-4.1-2025-04-14· OpenAIHugging Face LMArena Human Preference 140K

How can I make linux kernel recognize my filesystems without rebooting? I have started…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Amazon Novaamazon.nova-pro-v1:0’s answer.
  1. User

    How can I make linux kernel recognize my filesystems without rebooting? I have started linux without usb and my pc will have no operating system to boot if i reboot so i am stuck here is terminal output of what I have tried

    linux@linux:partprobCommand′partprob′notfound,didyoumean:command′partprobe′fromdebparted(3.6−3)Try:sudoaptinstall<debname>linux@linux:  partprob Command 'partprob' not found, did you mean: command 'partprobe' from deb parted (3.6-3) Try: sudo apt install <deb name> linux@linux:~ partprobe linux@linux:sudopartprobeError:Partition(s)2on/dev/nvme0n1havebeenwritten,butwehavebeenunabletoinformthekernelofthechange,probablybecauseit/theyareinuse.Asaresult,theoldpartition(s)willremaininuse.Youshouldrebootnowbeforemakingfurtherchanges.linux@linux:  sudo partprobe Error: Partition(s) 2 on /dev/nvme0n1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. linux@linux:~ sudo partprobe Error: Partition(s) 2 on /dev/nvme0n1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. linux@linux:blockblock−attrblockdevblockdev−keygenblockdev−wipelinux@linux:  block block-attr blockdev blockdev-keygen blockdev-wipe linux@linux:~ blockdev blockdev: not enough arguments Try 'blockdev --help' for more information. linux@linux:$ blockdev --help

    Usage: blockdev [-v|-q] commands devices blockdev --report [devices] blockdev -h|-V

    Call block device ioctls from the command line.

    Options: -q quiet mode -v verbose mode --report print report for specified (or all) devices

    -h, --help display this help -V, --version display version

    Available commands: --getsz get size in 512-byte sectors --setro set read-only --setrw set read-write --getro get read-only --getdiscardzeroes get discard zeroes support status --getss get logical block (sector) size --getpbsz get physical block (sector) size --getiomin get minimum I/O size --getioopt get optimal I/O size --getalignoff get alignment offset in bytes --getmaxsect get max sectors per request --getbsz get blocksize --setbsz set blocksize on file descriptor opening the block device --getsize get 32-bit sector count (deprecated, use --getsz) --getsize64 get size in bytes --setra set readahead --getra get readahead --setfra set filesystem readahead --getfra get filesystem readahead --getdiskseq get disk sequence number --flushbufs flush buffers --rereadpt reread partition table

    For more details see blockdev(8). linux@linux:blockdev−−rereadpt/dev/nvme0n1blockdev:cannotopen/dev/nvme0n1:Permissiondeniedlinux@linux:  blockdev --rereadpt /dev/nvme0n1 blockdev: cannot open /dev/nvme0n1: Permission denied linux@linux:~ sudo blockdev --rereadpt /dev/nvme0n1 blockdev: ioctl error on BLKRRPART: Device or resource busy linux@linux:ududevadmudisksctllinux@linux:  ud udevadm udisksctl linux@linux:~ udevadm Command verb required. linux@linux:~$ udevadm --help udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]

    Send control commands or test the device manager.

    Commands: info Query sysfs or the udev database trigger Request events from the kernel settle Wait for pending udev events control Control the udev daemon monitor Listen to kernel and udev events test Test an event run test-builtin Test a built-in command verify Verify udev rules files wait Wait for device or device symlink lock Lock a block device

    See the udevadm(8) man page for details. linux@linux:lsblkNAMEMAJ:MINRMSIZEROTYPEMOUNTPOINTSloop07:002.8G0looploop17:102.4G0loop/rofsnvme0n1259:00238.5G0disk├─nvme0n1p1259:1064M0part└─nvme0n1p2259:20237.4G0partlinux@linux:  lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS loop0 7:0 0 2.8G 0 loop loop1 7:1 0 2.4G 0 loop /rofs nvme0n1 259:0 0 238.5G 0 disk ├─nvme0n1p1 259:1 0 64M 0 part └─nvme0n1p2 259:2 0 237.4G 0 part linux@linux:~ df -h Filesystem Size Used Avail Use% Mounted on tmpfs 1.2G 1.7M 1.2G 1% /run efivarfs 128K 80K 44K 66% /sys/firmware/efi/efivars /dev/shm 3.0G 2.8G 141M 96% /cdrom /cow 5.8G 394M 5.4G 7% / tmpfs 5.8G 4.0K 5.8G 1% /dev/shm tmpfs 5.0M 12K 5.0M 1% /run/lock tmpfs 5.8G 4.0K 5.8G 1% /tmp tmpfs 1.2G 2.6M 1.2G 1% /run/user/1000 linux@linux:systemctlrestartsystemd−udevd.servicelinux@linux:  systemctl restart systemd-udevd.service linux@linux:~ sudo partprobe Error: Partition(s) 2 on /dev/nvme0n1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. linux@linux:systemctlrestartsystemd−udev∗Jobfailed.See"journalctl−xe"fordetails.Jobfailed.See"journalctl−xe"fordetails.linux@linux:  systemctl restart systemd-udev* Job failed. See "journalctl -xe" for details. Job failed. See "journalctl -xe" for details. linux@linux:~ sudo systemctl restart systemd-udev* linux@linux:sudopartprobeError:Partition(s)2on/dev/nvme0n1havebeenwritten,butwehavebeenunabletoinformthekernelofthechange,probablybecauseit/theyareinuse.Asaresult,theoldpartition(s)willremaininuse.Youshouldrebootnowbeforemakingfurtherchanges.linux@linux:  sudo partprobe Error: Partition(s) 2 on /dev/nvme0n1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. linux@linux:~ udevadm trigger --subsystem-match=block; udevadm settle nvme0n1: Failed to write 'change' to '/sys/devices/pci0000:00/0000:00:1d.4/0000:02:00.0/nvme/nvme0/nvme0n1/uevent': Permission denied nvme0n1p1: Failed to write 'change' to '/sys/devices/pci0000:00/0000:00:1d.4/0000:02:00.0/nvme/nvme0/nvme0n1/nvme0n1p1/uevent': Permission denied nvme0n1p2: Failed to write 'change' to '/sys/devices/pci0000:00/0000:00:1d.4/0000:02:00.0/nvme/nvme0/nvme0n1/nvme0n1p2/uevent': Permission denied loop0: Failed to write 'change' to '/sys/devices/virtual/block/loop0/uevent': Permission denied loop1: Failed to write 'change' to '/sys/devices/virtual/block/loop1/uevent': Permission denied loop2: Failed to write 'change' to '/sys/devices/virtual/block/loop2/uevent': Permission denied loop3: Failed to write 'change' to '/sys/devices/virtual/block/loop3/uevent': Permission denied loop4: Failed to write 'change' to '/sys/devices/virtual/block/loop4/uevent': Permission denied loop5: Failed to write 'change' to '/sys/devices/virtual/block/loop5/uevent': Permission denied loop6: Failed to write 'change' to '/sys/devices/virtual/block/loop6/uevent': Permission denied loop7: Failed to write 'change' to '/sys/devices/virtual/block/loop7/uevent': Permission denied linux@linux:~$ sudo bash root@linux:/home/linux# udevadm trigger --subsystem-match=block; udevadm settle root@linux:/home/linux# partprobe Error: Partition(s) 2 on /dev/nvme0n1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. root@linux:/home/linux# fdisk /dev/nvme0n1

    Welcome to fdisk (util-linux 2.39.3). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.

    This disk is currently in use - repartitioning is probably a bad idea. It's recommended to umount all file systems, and swapoff all swap partitions on this disk.

    Command (m for help): q

    root@linux:/home/linux# lsblk -f /dev/nvme0n1 NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS nvme0n1

    ├─nvme0n1p1 │ vfat FAT32 604E-4BBB
    └─nvme0n1p2 ext4 1.0 01323b41-ecdc-4ba2-a564-41b8267871c3
    root@linux:/home/linux# lsblk -f /dev/nvme0n1 NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS nvme0n1
    ├─nvme0n1p1 vfat FAT32 604E-4BBB
    └─nvme0n1p2 ext4 1.0 01323b41-ecdc-4ba2-a564-41b8267871c3
    root@linux:/home/linux# ex't

    ^C root@linux:/home/linux# ^C root@linux:/home/linux# exit exit linux@linux:~sudokpartx−av/dev/nvme0n1device−mapper:reloadioctlonnvme0n1p1(252:0)failed:Deviceorresourcebusycreate/reloadfailedonnvme0n1p1device−mapper:reloadioctlonnvme0n1p2(252:0)failed:Deviceorresourcebusycreate/reloadfailedonnvme0n1p2linux@linux:  sudo kpartx -av /dev/nvme0n1 device-mapper: reload ioctl on nvme0n1p1 (252:0) failed: Device or resource busy create/reload failed on nvme0n1p1 device-mapper: reload ioctl on nvme0n1p2 (252:0) failed: Device or resource busy create/reload failed on nvme0n1p2 linux@linux:~ lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS loop0 iso966 Jolie Linux Mint 22.1 Cinnamon 64-bit 2025-01-10-16-16-21-00
    loop1 squash 4.0 0 100% /rofs nvme0n1

    ├─nvme0n1p1 │ vfat FAT32 604E-4BBB
    └─nvme0n1p2 ext4 1.0 01323b41-ecdc-4ba2-a564-41b8267871c3
    linux@linux:df−hFilesystemSizeUsedAvailUsetmpfs1.2G1.7M1.2G1efivarfs128K80K44K66/dev/shm3.0G2.8G141M96/cow5.8G401M5.4G7tmpfs5.8G4.0K5.8G1tmpfs5.0M12K5.0M1tmpfs5.8G4.0K5.8G1tmpfs1.2G2.6M1.2G1linux@linux:  df -h Filesystem Size Used Avail Use% Mounted on tmpfs 1.2G 1.7M 1.2G 1% /run efivarfs 128K 80K 44K 66% /sys/firmware/efi/efivars /dev/shm 3.0G 2.8G 141M 96% /cdrom /cow 5.8G 401M 5.4G 7% / tmpfs 5.8G 4.0K 5.8G 1% /dev/shm tmpfs 5.0M 12K 5.0M 1% /run/lock tmpfs 5.8G 4.0K 5.8G 1% /tmp tmpfs 1.2G 2.6M 1.2G 1% /run/user/1000 linux@linux:~ sudo dmsetup ls --target stripe No devices found linux@linux:sudokpartx−dv/dev/nvme0n1linux@linux:  sudo kpartx -dv /dev/nvme0n1 linux@linux:~ sudo partprobe /dev/nvme0n1 Error: Partition(s) 2 on /dev/nvme0n1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. linux@linux:~sudolsof/dev/nvme0n1sudolsof/dev/nvme0n1p1sudolsof/dev/nvme0n1p2lsof:WARNING:can′tstat()fuse.gvfsd−fusefilesystem/run/user/1000/gvfsOutputinformationmaybeincomplete.lsof:WARNING:can′tstat()fuse.portalfilesystem/run/user/1000/docOutputinformationmaybeincomplete.lsof:WARNING:can′tstat()fuse.gvfsd−fusefilesystem/run/user/1000/gvfsOutputinformationmaybeincomplete.lsof:WARNING:can′tstat()fuse.portalfilesystem/run/user/1000/docOutputinformationmaybeincomplete.lsof:WARNING:can′tstat()fuse.gvfsd−fusefilesystem/run/user/1000/gvfsOutputinformationmaybeincomplete.lsof:WARNING:can′tstat()fuse.portalfilesystem/run/user/1000/docOutputinformationmaybeincomplete.linux@linux:  sudo lsof /dev/nvme0n1 sudo lsof /dev/nvme0n1p1 sudo lsof /dev/nvme0n1p2 lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs Output information may be incomplete. lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc Output information may be incomplete. lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs Output information may be incomplete. lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc Output information may be incomplete. lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs Output information may be incomplete. lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc Output information may be incomplete. linux@linux:~ sudo bash root@linux:/home/linux# sudo lsof /dev/nvme0n1 sudo lsof /dev/nvme0n1p1 sudo lsof /dev/nvme^C1p2

    root@linux:/home/linux# lsof /dev/nvme0n1 lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs Output information may be incomplete. lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc Output information may be incomplete. root@linux:/home/linux# lsof /dev/nvme0n1p1 lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs Output information may be incomplete. lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc Output information may be incomplete. root@linux:/home/linux# lsof /dev/nvme0n1p2 lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs Output information may be incomplete. lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc Output information may be incomplete. root@linux:/home/linux# ex't

    ^C root@linux:/home/linux# exit exit linux@linux:~$ sudo partprobe Error: Partition(s) 2 on /dev/nvme0n1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes.

  2. Assistant

    You are running a live Linux system (probably from a USB or DVD), and you want the kernel to recognize new or changed partitions on your internal NVMe drive without rebooting. You are getting errors like:

    Error: Partition(s) 2 on /dev/nvme0n1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.
    

    Let's break down what's happening and what you can do.


    What's Happening?

    • The kernel cannot re-read the partition table because the device is in use.
    • This is common when:
      • Partitions are mounted (even read-only).
      • Swap is active on the device.
      • The device is being used by a process (including the live system itself, if it is using persistence or swap on the internal drive).

    What You Tried

    • partprobe, blockdev --rereadpt, kpartx, udevadm trigger, etc.
    • Checked with lsof for open files (but didn't see anything obvious).
    • lsblk shows the partitions and filesystems.

    What To Do Next

    1. Check if the device is in use

    You already ran lsof, but let's be thorough:

    sudo lsof | grep nvme0n1
    sudo fuser -vm /dev/nvme0n1*
    

    If you see any processes, stop/kill them if possible.


    2. Check for active swap

    Run:

    swapon --summary
    

    If you see /dev/nvme0n1p2 or similar, turn it off:

    sudo swapoff /dev/nvme0n1p2
    

    3. Check for mounted partitions

    Run:

    mount | grep nvme0n1
    

    If anything is mounted, unmount it:

    sudo umount /dev/nvme0n1p1
    sudo umount /dev/nvme0n1p2
    

    4. Try again

    Now try:

    sudo partprobe
    # or
    sudo blockdev --rereadpt /dev/nvme0n1
    

    5. If still stuck

    • If the device is not in use (not mounted, not swap, not open by any process), and you still get "device busy", it may be a limitation of the live environment or a kernel bug.
    • Sometimes, the live system itself (especially with persistence) may use the internal drive for overlay or swap, making it impossible to re-read the partition table.

    Alternative: Manual Mount

    If your goal is to mount and access the filesystems (not repartition), you don't need to re-read the partition table if the partitions are already visible in lsblk and lsblk -f (as in your output).

    You can just mount them:

    sudo mkdir /mnt/myroot
    sudo mount /dev/nvme0n1p2 /mnt/myroot
    

    And for EFI:

    sudo mkdir /mnt/efi
    sudo mount /dev/nvme0n1p1 /mnt/efi
    

    Summary Table

    StepCommand ExamplePurpose
    Check open files`sudo lsofgrep nvme0n1`
    Check swapswapon --summarySee if swap is active
    Turn off swapsudo swapoff /dev/nvme0n1p2Free the device
    Check mounts`mountgrep nvme0n1`
    Unmountsudo umount /dev/nvme0n1p1Free the device
    Re-read partitionssudo partprobe or sudo blockdev --rereadptInform kernel of changes
    Mount manuallysudo mount /dev/nvme0n1p2 /mnt/myrootAccess filesystems

    If All Else Fails

    • If you cannot free the device (because the live system is using it), you must reboot with a live USB that does not use the internal drive for persistence or swap.
    • Or, use a different live USB (e.g., Ubuntu, Mint, etc.) and disable persistence.

    TL;DR

    • Unmount and swapoff all partitions on /dev/nvme0n1.
    • Check for open files with lsof and fuser.
    • Try partprobe or blockdev --rereadpt again.
    • If partitions are already visible, just mount them.
    • If you can't free the device, reboot with a different live USB.

    If you post the output of swapon --summary, mount | grep nvme0n1, and sudo fuser -vm /dev/nvme0n1*, I can help you further!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.