# How do I repopulate /dev? [SOLVED]

## Beetle B.

Any way to repopulate /dev? I made changes to the partition table of an unmounted drive, but /dev/sd* does not reflect those changes.

Thanks,

----------

## Jaglover

partprobe, comes with sys-block/parted

----------

## VoidMage

 *Jaglover wrote:*   

> partprobe, comes with sys-block/parted

 

If it were that easy.

He seems to refer not to automount, but to missing dev nodes.

That's either kernel/udev problem or he didn't use the partition tools correctly.

Are those partitions shown in /proc/partitions ?

----------

## xaviermiller

and restarting udev ?

----------

## Jaglover

 *VoidMage wrote:*   

>  *Jaglover wrote:*   partprobe, comes with sys-block/parted 
> 
> If it were that easy.
> 
> He seems to refer not to automount, but to missing dev nodes.
> ...

 

That's exactly why you need partprobe. To let the kernel know the partition table is changed, udev will be triggered, too.

----------

## VoidMage

 :Rolling Eyes: 

Again, if it was that then likely something like 'udevadm trigger <relevant parameters>' should have shown the partition in /proc.

----------

## Beetle B.

1. Partitions not shown in /proc/partitions

2. partprobe was run. Looking at its summary, it does see them.

3. Restarting udev solved the problem. 

Thanks,

----------

## Jaglover

Now when I'm thinking of it, partprobe and udev restart both may be needed. Partprobe updates kernel knowledge of partition table (this reflects in /proc which is an interface to the kernel) and then udev can do it's job and create relevant devices. Although I could swear last time I changed the partition table I did not restart udev, I just ran partprobe.

----------

## VoidMage

udev has stopped creating dev nodes when it switched to mandatory devtempfs.

Also, I certainly remember I didn't need no partprobe when I was using gptfdisk (and somewhat vaguely similar result for plain fdisk).

----------

## Jaglover

Hmm ... you mean gdisk? I used it and actually paid attention to what it said after exiting - use partprobe or <some other command I can't recall right now> to update kernel partition tables.

----------

## VoidMage

Well, OK, it seems it varies.

See 'int DiskIO::DiskSync(void)' in diskio-unix.cc (for gptfdisk) - it might fail, but it doesn't  partition table is updated without any other actions/tools.

There's something similar in fdisk - search for that ioctl.

----------

## Jaglover

Alright, now I understand why it worked for me. I ran gdisk (gptfdisk) on an SSD drive which had three partitions, removed them and created one single partition. Ran partprobe as suggested by gdisk and created a filesystem on sde1 ... the device node was still there from previous configuration. It seems the warning is printed depending whether *disk succeeded or not updating kernel tables.

----------

