<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: losetup at boot using udev? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/losetup-at-boot-using-udev/m-p/4583621#M39759</link>
    <description>ok well update to my (probably idiotic) above post, but I think the second step in the manual steps above, i.e. "raw /dev/raw/raw1 /dev/loop1" is probably uneccessary??  The device /dev/loop1 is already a "raw" disk (i.e. can do fdisk /dev/loop1) and see that there are no partitions yet defined, i.e.&lt;BR /&gt;&lt;BR /&gt;[root@rac1 rules.d]# fdisk /dev/loop1&lt;BR /&gt;Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel&lt;BR /&gt;Building a new DOS disklabel. Changes will remain in memory only,&lt;BR /&gt;until you decide to write them. After that, of course, the previous&lt;BR /&gt;content won't be recoverable.&lt;BR /&gt;&lt;BR /&gt;Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)&lt;BR /&gt;&lt;BR /&gt;Command (m for help): m&lt;BR /&gt;Command action&lt;BR /&gt;   a   toggle a bootable flag&lt;BR /&gt;   b   edit bsd disklabel&lt;BR /&gt;   c   toggle the dos compatibility flag&lt;BR /&gt;   d   delete a partition&lt;BR /&gt;   l   list known partition types&lt;BR /&gt;   m   print this menu&lt;BR /&gt;   n   add a new partition&lt;BR /&gt;   o   create a new empty DOS partition table&lt;BR /&gt;   p   print the partition table&lt;BR /&gt;   q   quit without saving changes&lt;BR /&gt;   s   create a new empty Sun disklabel&lt;BR /&gt;   t   change a partition's system id&lt;BR /&gt;   u   change display/entry units&lt;BR /&gt;   v   verify the partition table&lt;BR /&gt;   w   write table to disk and exit&lt;BR /&gt;   x   extra functionality (experts only)&lt;BR /&gt;&lt;BR /&gt;Command (m for help): p&lt;BR /&gt;&lt;BR /&gt;Disk /dev/loop1: 512 MB, 512000000 bytes&lt;BR /&gt;255 heads, 63 sectors/track, 62 cylinders&lt;BR /&gt;Units = cylinders of 16065 * 512 = 8225280 bytes&lt;BR /&gt;&lt;BR /&gt;      Device Boot      Start         End      Blocks   Id  System&lt;BR /&gt;&lt;BR /&gt;Command (m for help): q&lt;BR /&gt;&lt;BR /&gt;[root@rac1 rules.d]#&lt;BR /&gt;&lt;BR /&gt;So therefore I should be able to just reference /dev/loop1 directly from ASM - with no need to even bother with hooking things up to "/dev/raw" so maybe I do not even need that step - then if that is the case I just need to figure out how to code step 1,&lt;BR /&gt;losetup /dev/loop1 /u01/oradata/asmdisks/asmdisk1&lt;BR /&gt;&lt;BR /&gt;into udev&lt;BR /&gt;&lt;BR /&gt;things that make you go hmmmm.....&lt;BR /&gt;</description>
    <pubDate>Sun, 14 Feb 2010 16:48:51 GMT</pubDate>
    <dc:creator>Gilbert Standen_1</dc:creator>
    <dc:date>2010-02-14T16:48:51Z</dc:date>
    <item>
      <title>losetup at boot using udev?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/losetup-at-boot-using-udev/m-p/4583620#M39758</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;When I setup raw devices in udev for Oracle, I use something like this&lt;BR /&gt;&lt;BR /&gt;ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw1 %N"&lt;BR /&gt;KERNEL="sdd1", OWNER="root", GROUP="oinstall", MODE="0640"&lt;BR /&gt;KERNEL=="raw[1-2]", OWNER="root", GROUP="oinstall", MODE="0640"&lt;BR /&gt;&lt;BR /&gt;I'm now trying to do a similar thing with losetup and loopN devices (i.e. I made some fake raw disk by using dd and now I want to set these files up as "raw devices" at boot), so I (probably naively) imagined I could do this similar to the above commands, adding in at the beginning a udev command to associate the dd-created files with the loop device, then follow with the usual raw commands, i.e.&lt;BR /&gt;&lt;BR /&gt;ACTION=="add", KERNEL=="loop1", RUN+="/sbin/losetup /u01/oradata/asmdisks/asmdisk1 %N"&lt;BR /&gt;ACTION=="add", KERNEL=="loop1", RUN+="/usr/bin/raw /dev/raw/raw1 %N"&lt;BR /&gt;KERNEL="loop1", OWNER="oracle", GROUP="oinstall", MODE="0660"&lt;BR /&gt;&lt;BR /&gt;for the first command I also tried &lt;BR /&gt;&lt;BR /&gt;ACTION=="add", KERNEL=="/u01/oradata/asmdisks/asmdisk1", RUN+="/sbin/losetup /dev/loop1 %N"&lt;BR /&gt;&lt;BR /&gt;so as you can see not entirely sure I fully understand what needs to happen here.  I read this:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.reactivated.net/writing_udev_rules.html" target="_blank"&gt;http://www.reactivated.net/writing_udev_rules.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;but I still could not see where (or even if) losetup and loopN device can be handled in udev?&lt;BR /&gt;&lt;BR /&gt;but it doesn't work the way I thought it might - no raw devices get setup upon boot.&lt;BR /&gt;&lt;BR /&gt;How this could be accomplished at boot time? &lt;BR /&gt;&lt;BR /&gt;I do it manually as follows:&lt;BR /&gt;&lt;BR /&gt;losetup /dev/loop1 /u01/oradata/asmdisks/asmdisk1&lt;BR /&gt;raw /dev/raw/raw1 /dev/loop1&lt;BR /&gt;chown oracle:dba /dev/raw/raw1&lt;BR /&gt;chmod 660 /dev/raw/raw1&lt;BR /&gt;&lt;BR /&gt;it "seems" like their ought to be a way to do this with udev - rather than using a script or rc.local, etc.&lt;BR /&gt;&lt;BR /&gt;Thank You,&lt;BR /&gt;Gil&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 14 Feb 2010 06:56:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/losetup-at-boot-using-udev/m-p/4583620#M39758</guid>
      <dc:creator>Gilbert Standen_1</dc:creator>
      <dc:date>2010-02-14T06:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: losetup at boot using udev?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/losetup-at-boot-using-udev/m-p/4583621#M39759</link>
      <description>ok well update to my (probably idiotic) above post, but I think the second step in the manual steps above, i.e. "raw /dev/raw/raw1 /dev/loop1" is probably uneccessary??  The device /dev/loop1 is already a "raw" disk (i.e. can do fdisk /dev/loop1) and see that there are no partitions yet defined, i.e.&lt;BR /&gt;&lt;BR /&gt;[root@rac1 rules.d]# fdisk /dev/loop1&lt;BR /&gt;Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel&lt;BR /&gt;Building a new DOS disklabel. Changes will remain in memory only,&lt;BR /&gt;until you decide to write them. After that, of course, the previous&lt;BR /&gt;content won't be recoverable.&lt;BR /&gt;&lt;BR /&gt;Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)&lt;BR /&gt;&lt;BR /&gt;Command (m for help): m&lt;BR /&gt;Command action&lt;BR /&gt;   a   toggle a bootable flag&lt;BR /&gt;   b   edit bsd disklabel&lt;BR /&gt;   c   toggle the dos compatibility flag&lt;BR /&gt;   d   delete a partition&lt;BR /&gt;   l   list known partition types&lt;BR /&gt;   m   print this menu&lt;BR /&gt;   n   add a new partition&lt;BR /&gt;   o   create a new empty DOS partition table&lt;BR /&gt;   p   print the partition table&lt;BR /&gt;   q   quit without saving changes&lt;BR /&gt;   s   create a new empty Sun disklabel&lt;BR /&gt;   t   change a partition's system id&lt;BR /&gt;   u   change display/entry units&lt;BR /&gt;   v   verify the partition table&lt;BR /&gt;   w   write table to disk and exit&lt;BR /&gt;   x   extra functionality (experts only)&lt;BR /&gt;&lt;BR /&gt;Command (m for help): p&lt;BR /&gt;&lt;BR /&gt;Disk /dev/loop1: 512 MB, 512000000 bytes&lt;BR /&gt;255 heads, 63 sectors/track, 62 cylinders&lt;BR /&gt;Units = cylinders of 16065 * 512 = 8225280 bytes&lt;BR /&gt;&lt;BR /&gt;      Device Boot      Start         End      Blocks   Id  System&lt;BR /&gt;&lt;BR /&gt;Command (m for help): q&lt;BR /&gt;&lt;BR /&gt;[root@rac1 rules.d]#&lt;BR /&gt;&lt;BR /&gt;So therefore I should be able to just reference /dev/loop1 directly from ASM - with no need to even bother with hooking things up to "/dev/raw" so maybe I do not even need that step - then if that is the case I just need to figure out how to code step 1,&lt;BR /&gt;losetup /dev/loop1 /u01/oradata/asmdisks/asmdisk1&lt;BR /&gt;&lt;BR /&gt;into udev&lt;BR /&gt;&lt;BR /&gt;things that make you go hmmmm.....&lt;BR /&gt;</description>
      <pubDate>Sun, 14 Feb 2010 16:48:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/losetup-at-boot-using-udev/m-p/4583621#M39759</guid>
      <dc:creator>Gilbert Standen_1</dc:creator>
      <dc:date>2010-02-14T16:48:51Z</dc:date>
    </item>
  </channel>
</rss>

