LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Possible to do live repartition and software raid install -- no reboot? (https://www.linuxquestions.org/questions/linux-server-73/possible-to-do-live-repartition-and-software-raid-install-no-reboot-4175415169/)

Sum1 07-06-2012 12:20 AM

Possible to do live repartition and software raid install -- no reboot?
 
Hello Group,

I have Slackware 13.37 server with 2 x 500 Gig hard drives (/dev/sda and /dev/sdb) running in RAID1 using mdadm software raid. I'm running out of space with my current partition configuration:

Code:

Filesystem            Size  Used Avail Use% Mounted on
/dev/root              99G  93G  4.5G  96% /
proc                    0    0    0  -  /proc
sysfs                    0    0    0  -  /sys
usbfs                    0    0    0  -  /proc/bus/usb
/dev/md2              60G  58G  1.5G  98% /mnt/arc_mon
/dev/md3              60G  58G  718M  99% /mnt/arc_tue
/dev/md4              60G  59G    0 100% /mnt/arc_wed
/dev/md5              60G  60G    0 100% /mnt/arc_thu
/dev/md6              60G  57G  2.2G  97% /mnt/arc_fri
/dev/md7              60G  57G  2.2G  97% /mnt/arc_sat
/dev/md8              3.0G  69M  2.9G  3% /mnt/arc_test
tmpfs                2.0G    0  2.0G  0% /dev/shm

I want Swap and Root partition (/dev/md0 and /dev/md1) left as they are; but try the following without rebooting --

I want to use mdadm --remove to delete /dev/md2 through /dev/md8;
Then use fdisk to delete primary and logical partitions that correspond to /dev/md2 through /dev/md8;
Then create new partitions, build new RAID1 arrays, install EXT4 filesystem, mount, and populate with data.

Can I do this without rebooting or damaging the the root partition?
It is critical the server remains "up" and Samba server clients remain connected on the root filesystem.

All guidance, tips, or how-to's are greatly appreciated.
Thank you for your time and patience.

I've included the current hard drive partitions too:

Code:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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
Disk identifier: 0x97120150

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              63    4112639    2056288+  fd  Linux raid autodetect
/dev/sda2  *    4112640  213841214  104864287+  fd  Linux raid autodetect
/dev/sda3      213841215  339694424    62926605  fd  Linux raid autodetect
/dev/sda4      339694425  976768064  318536820    5  Extended
/dev/sda5      339694488  465547634    62926573+  fd  Linux raid autodetect
/dev/sda6      465547698  591400844    62926573+  fd  Linux raid autodetect
/dev/sda7      591400908  717254054    62926573+  fd  Linux raid autodetect
/dev/sda8      717254118  843107264    62926573+  fd  Linux raid autodetect
/dev/sda9      843107328  968960474    62926573+  fd  Linux raid autodetect
/dev/sda10      968960538  975274019    3156741  fd  Linux raid autodetect

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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
Disk identifier: 0xd3e6af24

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              63    4112639    2056288+  fd  Linux raid autodetect
/dev/sdb2  *    4112640  213841214  104864287+  fd  Linux raid autodetect
/dev/sdb3      213841215  339694424    62926605  fd  Linux raid autodetect
/dev/sdb4      339694425  976768064  318536820    5  Extended
/dev/sdb5      339694488  465547634    62926573+  fd  Linux raid autodetect
/dev/sdb6      465547698  591400844    62926573+  fd  Linux raid autodetect
/dev/sdb7      591400908  717254054    62926573+  fd  Linux raid autodetect
/dev/sdb8      717254118  843107264    62926573+  fd  Linux raid autodetect
/dev/sdb9      843107328  968960474    62926573+  fd  Linux raid autodetect
/dev/sdb10      968960538  975274019    3156741  fd  Linux raid autodetect


Sum1 07-06-2012 10:30 AM

Looks like a job for parted and partprobe.
Sorry for the extra forum static -- for some reason I didn't bump into these with my initial round of search terms and phrases.

Now, all I need is the courage to give it a try on a live production server. [shiver]

Sum1 07-12-2012 06:11 AM

I wanted to report back on the results.
In my case, after using fdisk to make partition changes, partprobe reported:

Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.

My root partition was unharmed and continued function normally; but, I couldn't use the newly created partitions and install filesystems until rebooting.


All times are GMT -5. The time now is 04:08 PM.