Skip to contentSkip to conversation

Creating partition devices after creating a partition on a harddisk?

DISCUSSION Anssi Saari 3 participants 5 messages Feb 23, 2006 – Feb 27, 2006

lore
Share & tools
lore
#0 lore raw

I added a partition to a harddisk yesterday, but after I exited fdisk I couldn't mkfs on it, because the device node didn't exist, /dev/hda7 to be exact. After manually creating it with mknod, I still couldn't mkfs. So I removed the manually created node and rebooted and then I had the node and could mkfs.

But what does one do to accomplish the same thing without rebooting?

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 8 lines · Anssi Saari

I added a partition to a harddisk yesterday, but after I exited fdisk I couldn't mkfs on it, because the device node didn't exist, /dev/hda7 to be exact. After manually creating it with mknod, I still couldn't mkfs. So I removed the manually created node and rebooted and then I had the node and could mkfs.

But what does one do to accomplish the same thing without rebooting?

You should be able to do 'bockdev --rereadpt /dev/hda' to force kernel to reread partition table. I would expect that fdisk (or whatever is used to repartition) does the equivalent IOCTL automatically.

blockdev is part of util-linux

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD/Z1mR6LMutpd94wRAqjdAJ9npurMfxg2UxA2oGYpx60dcdIqVACdFRmY 6IkyVQeFt4QRwZYQRNj0Wgo=JM7m
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw

Re: Creating partition devices after creating a partition on a

In reply to Anssi Saari
Quoted 3 lines · Andrey Borzenkov

You should be able to do 'bockdev --rereadpt /dev/hda' to force kernel to reread partition table. I would expect that fdisk (or whatever is used to repartition) does the equivalent IOCTL automatically.

I'm pretty sure this wont work on IDE unless someone fixed the IDE code in kernel recently. Is this the case?

David

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Anssi Saari
Quoted 7 lines · David Zeuthen
Quoted 3 lines · Andrey Borzenkov

You should be able to do 'bockdev --rereadpt /dev/hda' to force kernel to reread partition table. I would expect that fdisk (or whatever is used to repartition) does the equivalent IOCTL automatically.

I'm pretty sure this wont work on IDE unless someone fixed the IDE code in kernel recently. Is this the case?

Unfortunately I went and used up all the space on my new disk, so I can't easily test this right now. Maybe if I dig up the old disk and plug it in. This is a laptop, so that's harder than with a desktop...

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Anssi Saari

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 8 lines · David Zeuthen
Quoted 3 lines · Andrey Borzenkov

You should be able to do 'bockdev --rereadpt /dev/hda' to force kernel to reread partition table. I would expect that fdisk (or whatever is used to repartition) does the equivalent IOCTL automatically.

I'm pretty sure this wont work on IDE unless someone fixed the IDE code in kernel recently. Is this the case?

Well, it fails if some partition is mounted or otherwise busy, but this is not IDE specific. What makes IDE so different?

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)

iD8DBQFEA0ZAR6LMutpd94wRAq5IAKCouLLqln/ONDDaxGfBeHuck0E1CgCeMjC0 Fy7ahI9u3U3LrMeCYEnrKoI=lLc2
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel