LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-01-2014, 06:08 AM   #1
applehalf
Member
 
Registered: Oct 2013
Posts: 33

Rep: Reputation: Disabled
resize disk without reboot


Hello, my friends.
Today I have a problem in resizing disk in red hat linux.
I have several disks, added to my host.
One of them was resized on storage side.
I can't reboot my host.
I found that command "echo 1 > /sys/class/scsi_device/"my_device"/rescan" can help me.
But I can't find real path to my disk because I have multipathing:
backup_disk (*********************************) dm-2 *******,*******_******
size=3.0T features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=0 status=enabled
| `- 0:0:5:1 sdb 8:16 active faulty running
|-+- policy='round-robin 0' prio=0 status=enabled
| `- 0:0:7:1 sde 8:64 active faulty running
|-+- policy='round-robin 0' prio=0 status=active
| `- 1:0:5:1 sdi 8:128 active undef running
`-+- policy='round-robin 0' prio=0 status=enabled
`- 1:0:7:1 sdl 8:176 active undef running

I found:
# ls /sys/block/sdb/device/scsi_device/
0:0:5:1
# ls /sys/block/sde/device/scsi_device/
0:0:7:1
# ls /sys/block/sdi/device/scsi_device/
1:0:5:1
# ls /sys/block/sdl/device/scsi_device/
1:0:7:1
# ls /sys/block/dm-2/device/scsi_device/
ls: cannot access /sys/block/dm-2/device/scsi_device/: No such file or directory
# ls /sys/block/dm-2
alignment_offset bdi capability dev dm ext_range holders inflight power queue range removable ro size slaves stat subsystem trace uevent
#

How can I extend my multipathed disk without rebooting?
 
Old 10-01-2014, 10:04 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,848

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
You can try deleting the four paths, then rescan the two host controllers. Of course the disks need to be unmounted and not in use.

Code:
echo 1 >/sys/block/sdb/device/delete
echo 1 >/sys/block/sde/device/delete
etc.
 
Old 10-02-2014, 02:58 AM   #3
applehalf
Member
 
Registered: Oct 2013
Posts: 33

Original Poster
Rep: Reputation: Disabled
I can't delete pathes of this disk, because this disk is in production usage.
 
Old 10-02-2014, 07:48 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,848

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Since its multipathing, you might be able to do one path at a time. Stop the path, then do blockdev --rereadpart. I'm not sure if dm will figure out the new size, though.
 
Old 10-03-2014, 08:40 AM   #5
applehalf
Member
 
Registered: Oct 2013
Posts: 33

Original Poster
Rep: Reputation: Disabled
OK. I made:
multipath -ll
echo 1 > /sys/class/scsi_device/"my_device1"/rescan
echo 1 > /sys/class/scsi_device/"my_device2"/rescan
echo 1 > /sys/class/scsi_device/"my_device3"/rescan
echo 1 > /sys/class/scsi_device/"my_device4"/rescan
multipathd -k'resize map mpatha'
pvresize /dev/mapper/backup_disk
lvextend -L+1000G /dev/vg_backup_disk/lv_backup_disk

But the last trubble is:

# resize2fs /dev/vg_backup_disk/lv_backup_disk
resize2fs 1.41.12 (17-May-2010)
The filesystem is already 805305344 blocks long. Nothing to do!

# vgdisplay -v vg_backup_disk
Using volume group(s) on command line
Finding volume group "vg_backup_disk"
--- Volume group ---
VG Name vg_backup_disk
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 26
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 4.00 TiB
PE Size 4.00 MiB
Total PE 1048575
Alloc PE / Size 1048575 / 4.00 TiB
Free PE / Size 0 / 0
VG UUID

--- Logical volume ---
LV Name /dev/vg_backup_disk/lv_backup_disk
VG Name vg_backup_disk
LV UUID
LV Write Access read/write
LV Status available
# open 1
LV Size 4.00 TiB
Current LE 1048575
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:12

--- Physical volumes ---
PV Name /dev/mapper/backup_disk
PV UUID
PV Status allocatable
Total PE / Free PE 1048575 / 0

# df -h /u03
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_backup_disk-lv_backup_disk
3.0T 2.6T 242G 92% /u03
 
Old 10-14-2014, 10:51 AM   #6
applehalf
Member
 
Registered: Oct 2013
Posts: 33

Original Poster
Rep: Reputation: Disabled
Reboot helped me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Resize disk Suse sp2 DeWaRs Linux - Newbie 5 12-11-2013 05:45 AM
problem after copying 250GB disk to 1TB disk (cannot resize the old EXTENDED) pabelmont Linux - Newbie 5 02-04-2013 09:38 AM
resize a disk with lvm genderbender Linux - Software 7 07-17-2012 05:00 PM
[SOLVED] Resize linux disk? eyanu Linux - Hardware 9 07-11-2012 09:20 AM
how to resize disk !!! abhigo Linux - Software 3 01-23-2005 02:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration