Re: Convert "bare partition" to RAID1 / mdadm?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



How about something like this:
Use find to process each file with a script that does something like this:
if foo not soft link :
     if foo open for output (lsof?) :
         add foo to todo list
     else :
         make foo read-only
         if foo open for output :
             add foo to todo list
             restore foo's permissions
         else :
             copy foo to raid
             replace original with a soft link into raid
             give copy correct permissions

move the todo list to where it will not be written the script
process the todo list files with the same script making a new todo list
rinse and repeat until the todo list is empty

for the endgame, make the entire source read-only
run find again, this time there is no need for most of the tests:
if foo not soft link :
     copy foo to raid
     replace original with a soft link into raid
     give copy correct permissions

after the last copy, make the entire source unreadable and unwriteable
wait for last user to close file
rename the old files' top directory
rename the raid's top directory
let users back in

-- 
Michael   hennebry@xxxxxxxxxxxxxxxxxxxxx
"SCSI is NOT magic. There are *fundamental technical
reasons* why it is necessary to sacrifice a young
goat to your SCSI chain now and then."   --   John Woods
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux