Skip to contentSkip to conversation

Rereading disk geometry without reboot

DISCUSSION Andy 6 participants 8 messages Dec 6, 2004 – Dec 9, 2004

lore
Share & tools
lore

Andy

author
#0 lore raw

I am using linux kernel 2.6.9 on a san. I have file systems on non-partitioned disks. I can resize the disk on the SAN, reboot and grow the XFS file system those disks. What I would like to avoid rebooting or even unmounting the filesystem if possible.

Is there any way to get the kernel to re-read the disk geometry and change the information it holds without rebooting or reloading the module (which is as bad as a reboot in my case)?

Thanks,

Andy

#1 lore raw
Quoted 1 line

I am using linux kernel 2.6.9 on a san. I have file systems on

(What's a SAN?)

Quoted 7 lines

non-partitioned disks. I can resize the disk on the SAN, reboot and grow the XFS file system those disks. What I would like to avoid rebooting or even unmounting the filesystem if possible.

Is there any way to get the kernel to re-read the disk geometry and change the information it holds without rebooting or reloading the module (which is as bad as a reboot in my case)?

The fdisk tool will spit out an ioctl() to make the kernel reread the partition table (on normal computers, don't know about or what SAN). No need to reboot there at least.

Jan Engelhardt

Signature · 1 line
ENOSPC
#2 lore raw
Quoted 10 lines · Jan Engelhardt
Quoted 1 line

I am using linux kernel 2.6.9 on a san. I have file systems on

(What's a SAN?)

Quoted 4 lines

non-partitioned disks. I can resize the disk on the SAN, reboot and grow the XFS file system those disks. What I would like to avoid rebooting or even unmounting the filesystem if possible.

Quoted 8 lines
Quoted 3 lines

Is there any way to get the kernel to re-read the disk geometry and change the information it holds without rebooting or reloading the module (which is as bad as a reboot in my case)?

The fdisk tool will spit out an ioctl() to make the kernel reread the partition table (on normal computers, don't know about or what SAN). No need to reboot there at least.

There's 'blockdev --rereadpt' also, but neither of these work on a mounted filesystem afaik.

Signature · 1 line
~Randy
#3 lore raw
Quoted 2 lines

There's 'blockdev --rereadpt' also, but neither of these work on a mounted filesystem afaik.

Who said editing the ptab of something that's mounted is good?

Jan Engelhardt

Signature · 1 line
ENOSPC
#4 lore raw
In reply to Andy
Quoted 8 lines · Andy

I am using linux kernel 2.6.9 on a san. I have file systems on non-partitioned disks. I can resize the disk on the SAN, reboot and grow the XFS file system those disks. What I would like to avoid rebooting or even unmounting the filesystem if possible.

Is there any way to get the kernel to re-read the disk geometry and change the information it holds without rebooting or reloading the module (which is as bad as a reboot in my case)?

You can re-scan a scsi device via sysfs. You can, for example,

echo 1 > /sys/block/sdc/device/rescan

to rescan that device.

Mark.

Quoted 9 lines

Thanks,

Andy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 1 line
Mark Haverkamp <[email protected]>
author
#5 lore raw
Quoted 7 lines · Mark Haverkamp

You can re-scan a scsi device via sysfs. You can, for example,

echo 1 > /sys/block/sdc/device/rescan

to rescan that device.

Yes, and it reports the new size in dmesg, but when I try to grow the xfs it doesn't grow. It seems like some part of the kernel is not being told about the new size of the drive. Any ideas?

Andy

#6 lore raw
In reply to Andy
Quoted 8 lines · Andy

I am using linux kernel 2.6.9 on a san. I have file systems on non-partitioned disks. I can resize the disk on the SAN, reboot and grow the XFS file system those disks. What I would like to avoid rebooting or even unmounting the filesystem if possible.

Is there any way to get the kernel to re-read the disk geometry and change the information it holds without rebooting or reloading the module (which is as bad as a reboot in my case)?

Does anybody know if lvm can do this?

Quoted 9 lines

Thanks,

Andy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#7 lore raw

In article <[email protected]>,

Quoted 11 lines · Robin Holt
Quoted 8 lines · Andy

I am using linux kernel 2.6.9 on a san. I have file systems on non-partitioned disks. I can resize the disk on the SAN, reboot and grow the XFS file system those disks. What I would like to avoid rebooting or even unmounting the filesystem if possible.

Is there any way to get the kernel to re-read the disk geometry and change the information it holds without rebooting or reloading the module (which is as bad as a reboot in my case)?

Does anybody know if lvm can do this?

Yes, with LVM and XFS you can grow a logical volume and resize XFS to fit without taking the filesytem offline.

Mike.