-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Sat, Oct 14, 2017 at 01:21:58AM +0200, Wojtek Porczyk wrote:
> On Sat, Oct 14, 2017 at 01:20:13AM +0200, Marek Marczykowski-Górecki wrote:
> > You can't reload partition table while it is used (something from there
> > is mounted). At least Linux doesn't support it.
> 
> Just tested with loop device, fdisk, and ext4. Looks like it works. Unless it
> works only with loop?

No, it doesn't work, at least not directly:

    [root@testvm user]# truncate -s 10G test.img
    [root@testvm user]# losetup -f -P --show test.img
    /dev/loop0
    [root@testvm user]# fdisk /dev/loop0
    (...)
    Created a new partition 1 of type 'Linux' and of size 10 GiB.

    Command (m for help): w
    The partition table has been altered.
    Syncing disks.

    [root@testvm user]# blockdev --rereadpt /dev/loop0
    [root@testvm user]# mkfs /dev/loop0p1
    (...)
    [root@testvm user]# mount /dev/loop0p1 /mnt
    [root@testvm user]# truncate -s 20G test.img
    [root@testvm user]# losetup -c /dev/loop0
    [root@testvm user]# fdisk /dev/loop0
    (...)
    Command (m for help): p
    Disk /dev/loop0: 20 GiB, 21474836480 bytes, 41943040 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: 0x75e36dce

    Device       Boot Start      End  Sectors Size Id Type
    /dev/loop0p1       2048 41943039 41940992  20G 83 Linux

    Command (m for help): w
    The partition table has been altered.
    Calling ioctl() to re-read partition table.
    Re-reading the partition table failed.: Device or resource busy

    The kernel still uses the old table. The new table will be used at the next 
reboot or after you run partprobe(8) or kpartx(8).

I wonder on what conditions partprobe would work. And how would mounted
filesystem react for it.

- -- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJZ372sAAoJENuP0xzK19csCUYH/1Of/xg/fHvXsS1n1KB5YjJR
0qzlghXOouL3rIajw1GX2HmnIdGrDxs7sFF0+IUC5ruPp05svp/HocgJ91o5b33u
RnQBxiwqPrP75Bt/j9wisAF0jIoTtnqDDRGjDLzkxx3n0fq0K/GlrzKImqAe/RU8
k5Vn6G3ek/iP2umB6QOAnxjqPycb1Vr+PJXoUaDznL4jlr/CLaVehbhB/Di/wMb3
4HydEQBcrlTS3y8JuHFgyOtOCmlbl5YoCqo0l2CZkvfNop5RyorBA5/zfewylvSO
CnDHlHH8zFlSUnHF+daqXYngXl2eDPsHRU3LQ0G4YcdnwpyCWI8tuzdYEZk37G4=
=F/oP
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-devel+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-devel@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-devel/20171013234045.GO1059%40mail-itl.
For more options, visit https://groups.google.com/d/optout.

Reply via email to