-1

I have Centos on my physical drive. new volume created like commands below:

dd if=/dev/zero of=cinder-volumes bs=1 count=0 seek=50G
losetup /dev/loop3 cinder-volumes
fdisk /dev/loop3
n
p
1
ENTER
ENTER
t
8e
w
pvcreate /dev/loop3

All things goes right and I was happy. but after reboot, this volume missed. whats is the problem? thanks Befor Reboot After Reboot

vahid kargar
  • 800
  • 1
  • 9
  • 23
  • I'm back, and I have added test steps for your help. I just hope this information is helpful for your issue. – Daein Park Nov 08 '17 at 13:49
  • dear @Daein data lost even after your new steps, why new drive missed? can I do some thing to prevent lose of loop3 while reboot? – vahid kargar Nov 08 '17 at 15:10

1 Answers1

-1

You can associate the /dev/loop3 with cinder-volumes files as using /etc/rc.d/rc.local conf.

CentOS 6 or less

# vim /etc/rc.d/rc.local

mknod -m 660 /dev/loop3 b 7 3
losetup /dev/loop3 /path/to/cinder-volumes

CentOS 7

# vim /etc/rc.d/rc.local

mknod -m 660 /dev/loop3 b 7 3
losetup /dev/loop3 /path/to/cinder-volumes

After modifying, you set the execution flag to /etc/rc.d/rc.local

# chmod u+x /etc/rc.d/rc.local

And more checks your OS rc-local.service as following,

# systemctl list-unit-files rc-local.service
UNIT FILE        STATE
rc-local.service static

or

UNIT FILE        STATE
rc-local.service disable

If the state is disable, you can be enable the rc-local service, but the state is static is not any more conf.

# systemctl enable rc-local.service

Updated: Adding restore steps based on hypothesis that refer from questions.

★★★In advance, I defined that these steps are just written as the provision of information, I won't be not responsible for data-loss caused by these steps.★★★

  1. Prepare the other server having same specifications as possible as you can.

  2. backup the data (here is cinder-volumes file) with dd or cp commands

  3. check the backup file whether same original data with md5sum command.

  4. the backup data transfer to the new server for testing.

  5. test command; losetup /dev/loop3 /path/to/cinder-volumes and blkid command for check UUID whether same with the original loop3 device.

  6. More tests was always conducted on the new server, not production or important environments.

the loop3 or loopN device is virtual device for using the non-block device as of block device. It is just mapping interfaces. The loop3 device is disappeared but if cinder-volumes is clear, no problem.

I hope you it's helpful.

Daein Park
  • 4,393
  • 2
  • 12
  • 21
  • thank u for your reply. but loop3 isnt exist while starting os, so losetup cant work in startup – vahid kargar Nov 08 '17 at 09:40
  • How about you add this command into rc.local ? `mknod -m 660 /dev/loop3 b 7 3` before `losetup` line. It's create loop3 device. – Daein Park Nov 08 '17 at 10:02
  • are you sure this command recover lost drive and not create new one? my data didnt lost? – vahid kargar Nov 08 '17 at 10:09
  • You need to test above command on non-production and testing env. I just provide you inspiration or information related the issues, I won't be not responsible for data-loss caused by this answer. – Daein Park Nov 08 '17 at 10:13
  • ok, you are not responsible for data-loss :)) , just I want to know your mentioned command create new drive or recover lost drive – vahid kargar Nov 08 '17 at 10:16
  • But I checked my testing server before posting , it's CentOS 7.3. – Daein Park Nov 08 '17 at 10:19
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/158494/discussion-between-vahid-kargar-and-daein). – vahid kargar Nov 08 '17 at 10:25
  • I'm so sorry, I can't chat at moment. I have schedule from now. – Daein Park Nov 08 '17 at 10:35
  • please let me to check it as I understand you are geek in Opnestack, can I have your email address Daein, for ask any question directly? Thank U if you get me your email address – vahid kargar Nov 08 '17 at 10:56
  • Thanks @Daein, your solution cause data-loss, please offer a solution which recover loop3 or, prevent losing it after restart. – vahid kargar Nov 08 '17 at 11:17