Search Results

Search found 1729 results on 70 pages for 'identifier'.

Page 14/70 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • lvm disappeared after disc replacement on raid10

    - by user142295
    here my problem: I am running ubuntu 12.04 on a raid10 (4 disks), on top of which I installed an lvm with two volume groups (one for /, one for /home). The layout of the disks are as follows: Disk /dev/sda: 1500.3 GB, 1500301910016 bytes 255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 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: 0x0003f3b6 Device Boot Start End Blocks Id System /dev/sda1 * 63 481949 240943+ 83 Linux /dev/sda2 481950 2910640634 1455079342+ fd Linux raid autodetect /dev/sda3 2910640635 2930272064 9815715 82 Linux swap / Solaris Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes 255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 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: 0x00069785 Device Boot Start End Blocks Id System /dev/sdb1 63 2910158684 1455079311 fd Linux raid autodetect /dev/sdb2 2910158685 2930272064 10056690 82 Linux swap / Solaris Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes 255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 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: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 63 2910158684 1455079311 fd Linux raid autodetect /dev/sdc2 2910158685 2930272064 10056690 82 Linux swap / Solaris Disk /dev/sdd: 1500.3 GB, 1500301910016 bytes 255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 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: 0x000f14de Device Boot Start End Blocks Id System /dev/sdd1 63 2910158684 1455079311 fd Linux raid autodetect /dev/sdd2 2910158685 2930272064 10056690 82 Linux swap / Solaris The first disk (/dev/sda) contains the /boot partition on /dev/sda1. I use grub2 to boot the system off this partition. On top of this raid10 I installed two volume groups, one for /, one for /home. This system worked well, I even exchanged two disks during the last two years. It always worked. But not this time. For the first time, /dev/sda broke. I do not know if this is an issue – I know I would have struggled anyways to overcome the problem with /boot installed on that disk and grub2 installed on the mbr of /dev/sda. Anyways, I did what I always did: start knoppix fire up the raid sudo mdadm --examine -scan which returns ARRAY /dev/md127 UUID=0dbf4558:1a943464:132783e8:19cdff95 start it up sudo mdadm --assemble /dev/md127 fail the failing disk (smart event) sudo mdadm /dev/md127 --fail /dev/sda2 remove the failing disk sudo mdadm /dev/md127 --remove /dev/sda2 stop the raid sudo mdadm -S /dev/md127 take out the disk replace it with a new one create the same partitions as on the failling one add it to the raid sudo mdadm --assemble /dev/md127 sudo mdadm /dev/md127 --add /dev/sda2 wait 4 hours All looks fine: cat /proc/mdstat returns: Personalities : [raid10] md127 : active raid10 sda2[0] sdd1[3] sdc1[2] sdb1[1] 2910158464 blocks 64K chunks 2 near-copies [4/4] [UUUU] unused devices: <none> and sudo mdadm --detail /dev/md127 returns /dev/md127: Version : 0.90 Creation Time : Wed Jun 10 13:08:46 2009 Raid Level : raid10 Array Size : 2910158464 (2775.34 GiB 2980.00 GB) Used Dev Size : 1455079232 (1387.67 GiB 1490.00 GB) Raid Devices : 4 Total Devices : 4 Preferred Minor : 127 Persistence : Superblock is persistent Update Time : Thu Mar 21 16:27:40 2013 State : clean Active Devices : 4 Working Devices : 4 Failed Devices : 0 Spare Devices : 0 Layout : near=2 Chunk Size : 64K UUID : 0dbf4558:1a943464:132783e8:19cdff95 (local to host Microknoppix) Events : 0.4824680 Number Major Minor RaidDevice State 0 8 2 0 active sync /dev/sda2 1 8 17 1 active sync /dev/sdb1 2 8 33 2 active sync /dev/sdc1 3 8 49 3 active sync /dev/sdd1 However, there is no trace of the volume groups. Rebooting into knoppix does not help Restarting the old system (I actually replugged and re-added the failing disk for that – the system begins to start, but then fails to see the / partition – no wonder if the volume group is gone) does not help. sudo vgscan, sudo vgdisplay, sudo lvs, sudo lvdisplay, sudo vgscan –mknodes all returned No volume groups found. I am completely at a loss. Can anyone tell me if and how I can recover my data? Thanks in advance!

    Read the article

  • Failed to unmount partitions

    - by msknapp
    I'm trying to install ubuntu from a pen drive. I have windows 7 installed already and want to keep that installation. I have a 3TB drive that has one 2TB partition on it, so the last 1TB is completely unused, which is where I want to install ubuntu. I started ubuntu in "try ubuntu" mode and then opened gparted, and then deleted the unused partition for the last third of my drive, then tried to install ubuntu. During the install, it asked me if I wanted to unmount the drives I already have The installer has detected that the following disks have mounted partitions: /dev/sda, /dev/sdb Do you want the installer to try to unmount the partitions on these disks before continuing? If you leave them mounted, you will not be able to create, delete, or resize partitions on these disks, but you may be able to install to existing partitions there. No, Yes I said no because I don't want to lose my windows 7 installation, nor any of that data. I wonder, if I had said yes above, would I have lost all the data on those drives? Anyways, I hit no and continued. I chose to install ubuntu alongside windows 7, and hit continue. A few minutes passed when this popup appeared: Failed to unmount partitions The installer needs to commit changes to partition tables, but cannot do so because the partitions on the following mount points could not be unmounted: /media/ubuntu/Three\ Terabyte Drive Terabyte\ DriveDrive Please close any applications using these mount points. Would you like the installer to try to unmount these partitions again? Go Back, Continue Why is this not working? What am I supposed to do? ========== Update: I went ahead and said yes, it can unmount those partitions. It finished installing Ubuntu, but now when i start my machine it just takes me to the grub rescue prompt. Seems like it broke something. What can I do now? =============== Results of fdisk -l: 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: 0x00027e14 Device Boot Start End Blocks Id System /dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT /dev/sda2 206848 976771071 488282112 7 HPFS/NTFS/exFAT WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted. Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes 255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdb1 1 4294967295 2147483647+ ee GPT Partition 1 does not start on physical sector boundary. Disk /dev/sdc: 16.0 GB, 16008609792 bytes 255 heads, 63 sectors/track, 1946 cylinders, total 31266816 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: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 * 32 31266815 15633392 c W95 FAT32 (LBA) Disk /dev/sdd: 999.5 GB, 999501594624 bytes 255 heads, 63 sectors/track, 121515 cylinders, total 1952151552 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: 0x0002ae3f Device Boot Start End Blocks Id System /dev/sdd1 2048 1952151551 976074752 7 HPFS/NTFS/exFAT

    Read the article

  • How to use more than 3 virtual disks in Linux using CentOS and XenServer

    - by 010110110101
    I've attached 5 virtual disks to a Virtual Machine in Citrix XenServer. The VM has the xs-tools installed. Initially it said that it couldn't add so many disks. After I installed the xs-tools, it let me add all the disks. But /dev doesn't show all the disks. It shows these: /dev/xvda /dev/xvdb /dev/xvdc /dev/cdrom Perhaps it is bound by the limits of an IDE bus? (3 disks + CD-ROM) If so, how does one change the VM to use SCSI? Edit: According to the documentation: 2.6.3. VM Block Devices In the PV Linux case, block devices are passed through as PV devices. XenServer does not attempt to emulate SCSI or IDE, but instead provides a more suitable interface in the virtual environment in the form of xvd* devices. It is also possible to get an sd* device using the same mechanism, where the PV driver inside the VM takes over the SCSI device namespace. This is not desirable so it is best to use xvd* where possible for PV guests (this is the default for Debian and RHEL). For Windows or other fully virtualized guests, XenServer emulates an IDE bus in the form of an hd* device. When using Windows, installing the Citrix Tools for Virtual Machines installs a special PV driver that works in a similar way to Linux, except in the fully virtualized environment. Still, with 5 virtual disks attached, I don't see the other xvd devices. Edit #2: (attached requested info) Host Machine: XenServer 6.1 Linux version 2.6.32.43-0.4.1.xs1.6.10.777.170770xen (geeko@buildhost) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)) #1 SMP Wed Apr 17 05:52:03 EDT 2013 Guest Machine: CentOS release 6.4 (Final) Linux version 2.6.32-358.6.2.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Thu May 16 20:59:36 UTC 2013 Output of 'fdisk -l' on Guest Machine: Note, the disk beyond the first 3 attached are not displaying -- there should be 4 100GB disks. (There are a total of 5 disks displayed in XenCenter -- 16GB, 100GB, 100GB, 100GB, 100GB) Disk /dev/xvdb: 107.4 GB, 107374182400 bytes 255 heads, 63 sectors/track, 13054 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xfb6c95b9 Device Boot Start End Blocks Id System /dev/xvdb1 1 13054 104856223+ 83 Linux Disk /dev/xvda: 17.2 GB, 17179869184 bytes 255 heads, 63 sectors/track, 2088 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000e5f41 Device Boot Start End Blocks Id System /dev/xvda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/xvda2 64 2089 16264192 8e Linux LVM Disk /dev/xvdc: 107.4 GB, 107374182400 bytes 255 heads, 63 sectors/track, 13054 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xed249ced Device Boot Start End Blocks Id System /dev/xvdc1 1 13054 104856223+ 83 Linux Disk /dev/mapper/vg_blue-lv_root: 14.6 GB, 14571012096 bytes 255 heads, 63 sectors/track, 1771 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/vg_blue-lv_swap: 2080 MB, 2080374784 bytes 255 heads, 63 sectors/track, 252 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 I see that the Linux versions say SMP. The Guest VM doesn't say "xen" in the name. However, I have already run yum install kernel-xen. Could be a clue?

    Read the article

  • How to use function to connect to database and how to work with queries?

    - by Abhilash Shukla
    I am using functions to work with database.. Now the way i have defined the functions are as follows:- /** * Database definations */ define ('db_type', 'MYSQL'); define ('db_host', 'localhost'); define ('db_port', '3306'); define ('db_name', 'database'); define ('db_user', 'root'); define ('db_pass', 'password'); define ('db_table_prefix', ''); /** * Database Connect */ function db_connect($host = db_host, $port = db_port, $username = db_user, $password = db_pass, $database = db_name) { if(!$db = @mysql_connect($host.':'.$port, $username, $password)) { return FALSE; } if((strlen($database) > 0) AND (!@mysql_select_db($database, $db))) { return FALSE; } // set the correct charset encoding mysql_query('SET NAMES \'utf8\''); mysql_query('SET CHARACTER_SET \'utf8\''); return $db; } /** * Database Close */ function db_close($identifier) { return mysql_close($identifier); } /** * Database Query */ function db_query($query, $identifier) { return mysql_query($query, $identifier); } Now i want to know whether it is a good way to do this or not..... Also, while database connect i am using $host = db_host Is it ok? Secondly how i can use these functions, these all code is in my FUNCTIONS.php The Database Definitions and also the Database Connect... will it do the needful for me... Using these functions how will i be able to connect to database and using the query function... how will i able to execute a query? VERY IMPORTANT: How can i make mysql to mysqli, is it can be done by just adding an 'i' to mysql....Like:- @mysql_connect @mysqli_connect

    Read the article

  • How to parse text as JavaScript?

    - by Danjah
    This question of mine (currently unanswered), drove me toward finding a better solution to what I'm attempting. My requirements: chunks of code which can be arbitrarily added into a document, without an identifier: [div class="thing"] [elements... /] [/div] the objects are scanned for and found by an external script: var things = yd.getElementsBy(function(el){ return yd.hasClass('thing'); },null,document ); the objects must be individually configurable, what I have currently is identifier-based: [div class="thing" id="thing0"] [elements... /] [script type="text/javascript"] new Thing().init({ id:'thing0'; }); [/script] [/div] So I need to ditch the identifier (id="thing0") so there are no duplicates when more than one chunk of the same code is added to a page I still need to be able to config these objects individually, without an identifier SO! All of that said, I wondered about creating a dynamic global variable within the script block of each added chunk of code, within its script tag. As each 'thing' is found, I figure it would be legit to grab the innerHTML of the script tag and somehow convert that text into a useable JS object. Discuss. Ok, don't discuss if you like, but if you get the drift then feel free to correct my wayward thinking or provide a better solution - please! d

    Read the article

  • table design for storing large number of rows

    - by hyperboreean
    I am trying to store in a postgresql database some unique identifiers along with the site they have been seen on. I can't really decide which of the following 3 option to choose in order to be faster and easy maintainable. The table would have to provide the following information: the unique identifier which unfortunately it's text the sites on which that unique identifier has been seen The amount of data that would have to hold is rather large: there are around 22 millions unique identifiers that I know of. So I thought about the following designs of the table: id - integer identifier - text seen_on_site - an integer, foreign key to a sites table This approach would require around 22 mil multiplied by the number of sites. id - integer identifier - text seen_on_site_1 - boolean seen_on_site_2 - boolean ............ seen_on_site_n - boolean Hopefully the number of sites won't go past 10. This would require only the number of unique identifiers that I know of, that is around 20 millions, but it would make it hard to work with it from an ORM perspective. one table that would store only unique identifiers, like in: id - integer unique_identifier - text, one table that would store only sites, like in: id - integer site - text and one many to many relation, like: id - integer, unique_id - integer (fk to the table storing identifiers) site_id - integer (fk to sites table) another approach would be to have a table that stores unique identifiers for each site So, which one seems like a better approach to take on the long run?

    Read the article

  • A better solution than element.Elements("Whatever").First()?

    - by codeka
    I have an XML file like this: <SiteConfig> <Sites> <Site Identifier="a" /> <Site Identifier="b" /> <Site Identifier="c" /> </Sites> </SiteConfig> The file is user-editable, so I want to provide reasonable error message in case I can't properly parse it. I could probably write a .xsd for it, but that seems kind of overkill for a simple file. So anyway, when querying for the list of <Site> nodes, there's a couple of ways I could do it: var doc = XDocument.Load(...); var siteNodes = from siteNode in doc.Element("SiteConfig").Element("SiteUrls").Elements("Sites") select siteNode; But the problem with this is that if the user has not included the <SiteUrls> node (say) it'll just throw a NullReferenceException which doesn't really say much to the user about what actually went wrong. Another possibility is just to use Elements() everywhere instead of Element(), but that doesn't always work out when coupled with calls to Attribute(), for example, in the following situation: var siteNodes = from siteNode in doc.Elements("SiteConfig") .Elements("SiteUrls") .Elements("Sites") where siteNode.Attribute("Identifier").Value == "a" select siteNode; (That is, there's no equivalent to Attributes("xxx").Value) Is there something built-in to the framework to handle this situation a little better? What I would prefer is a version of Element() (and of Attribute() while we're at it) that throws a descriptive exception (e.g. "Looking for element <xyz> under <abc> but no such element was found") instead of returning null. I could write my own version of Element() and Attribute() but it just seems to me like this is such a common scenario that I must be missing something...

    Read the article

  • Mongodb, linq driver. How to construct Contains with variable or statements

    - by Syska
    I'm using the LINQ Driver for C#, works great. Sorting a lot of properties but heres a problem I can't solve, its probebly simple. var identifierList = new []{"10", "20", "30"}; var newList = list.Where(x => identifierList.Contains(x.Identifier)); This is NOT supported ... So I could do something like: var newList = list.Where(x => x.Identifier == "10" || x.Identifier == "20" || x.Identifier == "30"); But since the list is variable ... how do I construct the above? Or are there even better alternatives? The list is of type IQueryable<MyCustomClass> For information ... this is used as a filter of alot of properties. In SQL I could have a parent - child relationship. But as I can't as the parent for the main ID I need to take all the ID's out and then construct it like this. Hopes this makes sense. If needed I will explain more.

    Read the article

  • my multi boot can't boot to XP 'resumeobject' is missing

    - by GwenKillerby
    In my multi boot set up, booting to vista and 7 goes fine, but when I try to boot to XP, i get an error Windows failed to start. A recent hardware or software change might be the cause. To fix the problem: 1. Insert your Windows installation disc and restart your computer. 2. Choose your language settings, and then click "Next." 3. Click "Repair your computer." If you do not have this disc, contact your system administrator or computer manufacturer for assistance. File: \NTLDR Status: 0xc000000e Info: The selected entry could not be loaded because the application is missing or corrupt. See below. Clearly the resumeobject seems to be missing in the XP entry ("Real Mode Boot sector"), only I don't know how to restore it. Vista is on **C:**, Win7 is on **F:** (as is the bootmgr ??? ) and WinXP is on **E:** What I've tried: [1] I've used about 5 windows discs, that is the Recovery Consoles from real XP install CD's and 3 virtual Recovery Consoles. All failed. The real CD's work ONE time, but won't let me finish, I only got as far as [b]fixboot E:[/b] Then they shut the laptop down, I kid you not. On a next startup, all 5 CD's ask me for some Admin password that I've never added! [2] I have VisualBCD and EasyBCD, but the most obvious things I tried there didn't solve the problem. So know I don't exactly know what to do with them. [3] I CAN boot into XP with the FIX NTLDR workaround of http://milescomer.com/tinyempire.com/notes/ntldrismissing.htm, but it doesn't fix it permanently QUESTION: How do I fix it permanently? bcdedit /enum output: Windows Boot Manager -------------------- identifier {bootmgr} device partition=F: path \bootmgr description Windows Boot Manager locale en-US default {current} displayorder {current} {812e27a9-27b7-11e4-8fb4-dfa8174ae8dc} {812e27ac-27b7-11e4-8fb4-dfa8174ae8dc} timeout 30 resume No Windows Boot Loader ------------------- identifier {current} device partition=C: path \Windows\system32\winload.exe description Vista locale nl-NL osdevice partition=C: systemroot \Windows resumeobject {73d8b5bc-2764-11e4-b181-806e6f6e6963} Windows Boot Loader ------------------- identifier {812e27a9-27b7-11e4-8fb4-dfa8174ae8dc} device partition=F: path \Windows\system32\winload.exe description Daisy Etta locale en-US osdevice partition=F: systemroot \Windows resumeobject {b8c234a4-27b0-11e4-b8b3-806e6f6e6963} Real-mode Boot Sector --------------------- identifier {812e27ac-27b7-11e4-8fb4-dfa8174ae8dc} device partition=E: path \NTLDR description XP Thank you.

    Read the article

  • A feed scanner that reads data

    - by kylex
    I don't know if this is the right place to ask this question, but... I need a scanner (paper feed scanner) where depending on either a barcode, or number, or some identifier on the paper being scanned, creates a PDF file with a name based on that identifier. For example: If I scanned a page with the number 12345 on the top-left of the page, a PDF file named 12345.pdf would be created. Any suggestions at all would be greatly appreciated!

    Read the article

  • Nvidia Drivers on Debian / Lenny (Stable) -> Installation successful -> Monitors gets black

    - by David
    I have successfully installed the proprietary drivers for my nvidia (geforce 7300 gt) graphics card on debian/lenny. I know its not the best way to chose for driver installation ( see this link: http://wiki.debian.org/NvidiaGraphicsDrivers#non-freedrivers ). but the two ways seem to be possible for me (nvidia-kernel module compilation). Now the problem is that the monitors gets black, the power light starts blinking after i launch the x-server. Have a short look a the logs (output truncated from /var/log/Xorg.0.log): (II) Setting vga for screen 0. (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32 (==) NVIDIA(0): RGB weight 888 (==) NVIDIA(0): Default visual is TrueColor (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0) (**) Jul 28 17:10:11 NVIDIA(0): Enabling RENDER acceleration (II) Jul 28 17:10:11 NVIDIA(0): Support for GLX with the Damage and Composite X extensions is (II) Jul 28 17:10:11 NVIDIA(0): enabled. (II) Jul 28 17:10:11 NVIDIA(0): NVIDIA GPU GeForce 7300 GT (G73) at PCI:1:0:0 (GPU-0) (--) Jul 28 17:10:11 NVIDIA(0): Memory: 262144 kBytes (--) Jul 28 17:10:11 NVIDIA(0): VideoBIOS: 05.73.22.25.00 (II) Jul 28 17:10:11 NVIDIA(0): Detected PCI Express Link width: 16X (--) Jul 28 17:10:11 NVIDIA(0): Interlaced video modes are supported on this GPU (--) Jul 28 17:10:11 NVIDIA(0): Connected display device(s) on GeForce 7300 GT at PCI:1:0:0: (--) Jul 28 17:10:11 NVIDIA(0): Samsung SyncMaster (CRT-0) (--) Jul 28 17:10:11 NVIDIA(0): Samsung SyncMaster (DFP-0) (--) Jul 28 17:10:11 NVIDIA(0): Samsung SyncMaster (CRT-0): 400.0 MHz maximum pixel clock (--) Jul 28 17:10:11 NVIDIA(0): Samsung SyncMaster (DFP-0): 165.0 MHz maximum pixel clock (--) Jul 28 17:10:11 NVIDIA(0): Samsung SyncMaster (DFP-0): Internal Single Link TMDS (II) Jul 28 17:10:11 NVIDIA(0): Assigned Display Device: CRT-0 (==) Jul 28 17:10:11 NVIDIA(0): (==) Jul 28 17:10:11 NVIDIA(0): No modes were requested; the default mode "nvidia-auto-select" (==) Jul 28 17:10:11 NVIDIA(0): will be used as the requested mode. (==) Jul 28 17:10:11 NVIDIA(0): (II) Jul 28 17:10:11 NVIDIA(0): Validated modes: (II) Jul 28 17:10:11 NVIDIA(0): "nvidia-auto-select" (II) Jul 28 17:10:11 NVIDIA(0): Virtual screen size determined to be 1280 x 1024 (--) Jul 28 17:10:11 NVIDIA(0): DPI set to (85, 86); computed from "UseEdidDpi" X config (--) Jul 28 17:10:11 NVIDIA(0): option (==) Jul 28 17:10:11 NVIDIA(0): Enabling 32-bit ARGB GLX visuals. (--) Depth 24 pixmap format is 32 bpp Here is the complete /etc/X11/xorg.conf file as generated by nvidia-xconfig: # nvidia-xconfig: X configuration file generated by nvidia-xconfig # nvidia-xconfig: version 256.35 (buildmeister@builder101) Wed Jun 16 19:25:59 PDT 2010 Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" EndSection Section "Files" EndSection Section "Module" Load "dbe" Load "extmod" Load "type1" Load "freetype" Load "glx" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection Section "Monitor" Identifier "Monitor0" VendorName "Unknown" ModelName "Unknown" Hor

    Read the article

  • Error 5 partition table invalid or corrupt

    - by Clodoaldo
    I'm trying to add a second SSD to a Centos 6 system. But I get the Error 5 partition table invalid or corrupt at boot. The system already has a single SSD (sdb) and a pair of HDDs (sd{a,c}) in a RAID 1 array from where it boots. It is as if the new SSD assumes one of the devices of the RAID array. Is it? How to avoid that or rearrange the setup? # cat fstab UUID=967b4035-782d-4c66-b22f-50244fe970ca / ext4 defaults 1 1 UUID=86fd06e9-cdc9-4166-ba9f-c237cfc43e02 /boot ext4 defaults 1 2 UUID=72552a7a-d8ae-4f0a-8917-b75a6239ce9f /ssd ext4 discard,relatime 1 2 UUID=8000e5e6-caa2-4765-94f8-9caeb2bda26e swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 # ll /dev/disk/by-id/ total 0 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 ata-OCZ-VERTEX3_OCZ-43DSRFTNCLE9ZJXX -> ../../sdb lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-OCZ-VERTEX3_OCZ-43DSRFTNCLE9ZJXX-part1 -> ../../sdb1 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 ata-ST3500413AS_5VMT49E3 -> ../../sdc lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMT49E3-part1 -> ../../sdc1 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMT49E3-part2 -> ../../sdc2 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMT49E3-part3 -> ../../sdc3 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 ata-ST3500413AS_5VMTJNAJ -> ../../sda lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMTJNAJ-part1 -> ../../sda1 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMTJNAJ-part2 -> ../../sda2 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMTJNAJ-part3 -> ../../sda3 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-name-localhost.localdomain:0 -> ../../md0 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-name-localhost.localdomain:1 -> ../../md1 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-name-localhost.localdomain:2 -> ../../md2 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-uuid-a04d7241:8da6023e:f9004352:107a923a -> ../../md1 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-uuid-a22c43b9:f1954990:d3ddda5e:f9aff3c9 -> ../../md0 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-uuid-f403a2d0:447803b5:66edba73:569f8305 -> ../../md2 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 scsi-SATA_OCZ-VERTEX3_OCZ-43DSRFTNCLE9ZJXX -> ../../sdb lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_OCZ-VERTEX3_OCZ-43DSRFTNCLE9ZJXX-part1 -> ../../sdb1 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMT49E3 -> ../../sdc lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMT49E3-part1 -> ../../sdc1 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMT49E3-part2 -> ../../sdc2 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMT49E3-part3 -> ../../sdc3 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMTJNAJ -> ../../sda lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMTJNAJ-part1 -> ../../sda1 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMTJNAJ-part2 -> ../../sda2 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMTJNAJ-part3 -> ../../sda3 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 wwn-0x5000c500383621ff -> ../../sdc lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c500383621ff-part1 -> ../../sdc1 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c500383621ff-part2 -> ../../sdc2 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c500383621ff-part3 -> ../../sdc3 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 wwn-0x5000c5003838b2e7 -> ../../sda lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c5003838b2e7-part1 -> ../../sda1 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c5003838b2e7-part2 -> ../../sda2 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c5003838b2e7-part3 -> ../../sda3 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 wwn-0x5e83a97f592139d6 -> ../../sdb lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5e83a97f592139d6-part1 -> ../../sdb1 # fdisk -l Disk /dev/sdb: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x79298ec9 Device Boot Start End Blocks Id System /dev/sdb1 1 14594 117219328 83 Linux Disk /dev/sdc: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000d99de Device Boot Start End Blocks Id System /dev/sdc1 1 1275 10240000 fd Linux raid autodetect /dev/sdc2 * 1275 1339 512000 fd Linux raid autodetect /dev/sdc3 1339 60802 477633536 fd Linux raid autodetect Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000b3327 Device Boot Start End Blocks Id System /dev/sda1 1 1275 10240000 fd Linux raid autodetect /dev/sda2 * 1275 1339 512000 fd Linux raid autodetect /dev/sda3 1339 60802 477633536 fd Linux raid autodetect Disk /dev/md0: 10.5 GB, 10484641792 bytes 2 heads, 4 sectors/track, 2559727 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/md0 doesn't contain a valid partition table Disk /dev/md2: 489.1 GB, 489095557120 bytes 2 heads, 4 sectors/track, 119408095 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/md2 doesn't contain a valid partition table Disk /dev/md1: 524 MB, 524275712 bytes 2 heads, 4 sectors/track, 127997 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/md1 doesn't contain a valid partition table # cat /etc/grub.conf default=0 timeout=5 splashimage=(hd2,1)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.32-220.17.1.el6.x86_64) root (hd2,1) kernel /vmlinuz-2.6.32-220.17.1.el6.x86_64 ro root=UUID=967b4035-782d-4c66-b22f-50244fe970ca rd_MD_UUID=f403a2d0:447803b5:66edba73:569f8305 rd_MD_UUID=a22c43b9:f1954990:d3ddda5e:f9aff3c9 rd_NO_LUKS rd_NO_LVM rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=br-abnt2 crashkernel=auto rhgb quiet initrd /initramfs-2.6.32-220.17.1.el6.x86_64.img

    Read the article

  • Fix single entry from mbr

    - by Sander
    I use EasyBCD to manage my tripleboot of (1) Windows Server 2008 R2, (2) Windows 7 Professional and (3) Ubuntu Linux. While trying to change the order of my boot menu I ended up losing the Windows Server entry. Luckily I had a boot menu backup (.bcd file) that allowed me to restore my boot menu using EasyBCD. However, when I now select the Windows Server option in my boot menu the Windows Server Recovery Environment starts up. So I have to select language/keyboard layout/etc. and then I have 3 options as shown in the image below. . My goal is to fix the one corrupted Windows Server entry from my boot menu without messing up or losing the two other ones. I'm guessing the Recovery Console (Command Prompt) is the next step and that I will be needing bootrec.exe. But when consulting this page: Use the Bootrec.exe tool in the Windows Recovery Environment to troubleshoot and repair startup issues in Windows (about half way down there's a link that shows the bootrec.exe options) I'm getting uncertain. The page lists 4 options for bootrec.exe : /FixMbr /FixBoot /ScanOs /RebuildBcd What option do I need to fix just the server entry of my boot menu? Thanks in advance, Sander P.S. All three OS's are on the same physical disk (3 different partitions). Disk layout: System reserved (primary partition, 100 MB) Windows 7 (primary parition, 150 GB) Windows Server 2008 (primary partition, 150 GB) Extended partition (linux partitions (/,/swap,/home), 150GB + data partition, 150 GB) P.P.S. This is what my boot menu looks like using EasyBCD (Detailed/Debug mode) on my Windows 7 installation. Windows Boot Manager -------------------- identifier {9dea862c-5cdd-4e70-acc1-f32b344d4795} device partition=\Device\HarddiskVolume1 description Windows Boot Manager locale en-US inherit {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e} default {93f90e43-cae8-11df-b05a-c9177e705936} resumeobject {93f90e3e-cae8-11df-b05a-c9177e705936} displayorder {93f90e43-cae8-11df-b05a-c9177e705936} {93f90e3f-cae8-11df-b05a-c9177e705936} {93f90e46-cae8-11df-b05a-c9177e705936} toolsdisplayorder {b2721d73-1db4-4c62-bf78-c548a880142d} timeout 10 displaybootmenu Yes Windows Boot Loader ------------------- identifier {93f90e43-cae8-11df-b05a-c9177e705936} device partition=\Device\HarddiskVolume3 path \Windows\system32\winload.exe description Windows Server 2008 R2 - Standard locale en-US inherit {6efb52bf-1766-41db-a6b3-0ee5eff72bd7} recoverysequence {93f90e44-cae8-11df-b05a-c9177e705936} recoveryenabled Yes osdevice partition=\Device\HarddiskVolume3 systemroot \Windows resumeobject {93f90e42-cae8-11df-b05a-c9177e705936} nx OptOut Windows Boot Loader ------------------- identifier {93f90e3f-cae8-11df-b05a-c9177e705936} device partition=C: path \Windows\system32\winload.exe description Windows 7 - Professional locale nl-NL inherit {6efb52bf-1766-41db-a6b3-0ee5eff72bd7} recoverysequence {93f90e40-cae8-11df-b05a-c9177e705936} recoveryenabled Yes osdevice partition=C: systemroot \Windows resumeobject {93f90e3e-cae8-11df-b05a-c9177e705936} nx OptIn Real-mode Boot Sector --------------------- identifier {93f90e46-cae8-11df-b05a-c9177e705936} device partition=C: path \NST\AutoNeoGrub0.mbr description Ubuntu 10.04 - Lucid Lynx

    Read the article

  • Error 22 no such partition on adding a SSD

    - by Clodoaldo
    I'm trying to add a second SSD to a Centos 6 system. But I get the error 22 no such partition at boot. The system already has a single SSD (sdb) and a pair of HDDs (sd{a,c}) in a RAID 1 array from where it boots. It is as if the new SSD assumes one of the devices of the RAID array. Is it? How to avoid that or rearrange the setup? # cat fstab UUID=967b4035-782d-4c66-b22f-50244fe970ca / ext4 defaults 1 1 UUID=86fd06e9-cdc9-4166-ba9f-c237cfc43e02 /boot ext4 defaults 1 2 UUID=72552a7a-d8ae-4f0a-8917-b75a6239ce9f /ssd ext4 discard,relatime 1 2 UUID=8000e5e6-caa2-4765-94f8-9caeb2bda26e swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 # ll /dev/disk/by-id/ total 0 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 ata-OCZ-VERTEX3_OCZ-43DSRFTNCLE9ZJXX -> ../../sdb lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-OCZ-VERTEX3_OCZ-43DSRFTNCLE9ZJXX-part1 -> ../../sdb1 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 ata-ST3500413AS_5VMT49E3 -> ../../sdc lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMT49E3-part1 -> ../../sdc1 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMT49E3-part2 -> ../../sdc2 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMT49E3-part3 -> ../../sdc3 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 ata-ST3500413AS_5VMTJNAJ -> ../../sda lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMTJNAJ-part1 -> ../../sda1 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMTJNAJ-part2 -> ../../sda2 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMTJNAJ-part3 -> ../../sda3 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-name-localhost.localdomain:0 -> ../../md0 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-name-localhost.localdomain:1 -> ../../md1 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-name-localhost.localdomain:2 -> ../../md2 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-uuid-a04d7241:8da6023e:f9004352:107a923a -> ../../md1 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-uuid-a22c43b9:f1954990:d3ddda5e:f9aff3c9 -> ../../md0 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-uuid-f403a2d0:447803b5:66edba73:569f8305 -> ../../md2 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 scsi-SATA_OCZ-VERTEX3_OCZ-43DSRFTNCLE9ZJXX -> ../../sdb lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_OCZ-VERTEX3_OCZ-43DSRFTNCLE9ZJXX-part1 -> ../../sdb1 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMT49E3 -> ../../sdc lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMT49E3-part1 -> ../../sdc1 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMT49E3-part2 -> ../../sdc2 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMT49E3-part3 -> ../../sdc3 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMTJNAJ -> ../../sda lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMTJNAJ-part1 -> ../../sda1 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMTJNAJ-part2 -> ../../sda2 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMTJNAJ-part3 -> ../../sda3 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 wwn-0x5000c500383621ff -> ../../sdc lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c500383621ff-part1 -> ../../sdc1 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c500383621ff-part2 -> ../../sdc2 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c500383621ff-part3 -> ../../sdc3 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 wwn-0x5000c5003838b2e7 -> ../../sda lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c5003838b2e7-part1 -> ../../sda1 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c5003838b2e7-part2 -> ../../sda2 lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c5003838b2e7-part3 -> ../../sda3 lrwxrwxrwx. 1 root root 9 Jun 15 23:50 wwn-0x5e83a97f592139d6 -> ../../sdb lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5e83a97f592139d6-part1 -> ../../sdb1 # fdisk -l Disk /dev/sdb: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x79298ec9 Device Boot Start End Blocks Id System /dev/sdb1 1 14594 117219328 83 Linux Disk /dev/sdc: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000d99de Device Boot Start End Blocks Id System /dev/sdc1 1 1275 10240000 fd Linux raid autodetect /dev/sdc2 * 1275 1339 512000 fd Linux raid autodetect /dev/sdc3 1339 60802 477633536 fd Linux raid autodetect Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000b3327 Device Boot Start End Blocks Id System /dev/sda1 1 1275 10240000 fd Linux raid autodetect /dev/sda2 * 1275 1339 512000 fd Linux raid autodetect /dev/sda3 1339 60802 477633536 fd Linux raid autodetect Disk /dev/md0: 10.5 GB, 10484641792 bytes 2 heads, 4 sectors/track, 2559727 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/md0 doesn't contain a valid partition table Disk /dev/md2: 489.1 GB, 489095557120 bytes 2 heads, 4 sectors/track, 119408095 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/md2 doesn't contain a valid partition table Disk /dev/md1: 524 MB, 524275712 bytes 2 heads, 4 sectors/track, 127997 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/md1 doesn't contain a valid partition table # cat /etc/grub.conf default=0 timeout=5 splashimage=(hd2,1)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.32-220.17.1.el6.x86_64) root (hd2,1) kernel /vmlinuz-2.6.32-220.17.1.el6.x86_64 ro root=UUID=967b4035-782d-4c66-b22f-50244fe970ca rd_MD_UUID=f403a2d0:447803b5:66edba73:569f8305 rd_MD_UUID=a22c43b9:f1954990:d3ddda5e:f9aff3c9 rd_NO_LUKS rd_NO_LVM rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=br-abnt2 crashkernel=auto rhgb quiet initrd /initramfs-2.6.32-220.17.1.el6.x86_64.img

    Read the article

  • What is the correct way to distinguish services to which RADIUS request belongs?

    - by John
    If I have 1 generic RADIUS server and a number of clients (VoIP server, VPN server, WIFI access point) how to distinguish senders (NAS) of access and accounting requests? I didn't found anything helpful by reading all related RFCs, there just NAS-IP-Addess or NAS-Identifier is required, but this attributes usually represents IP address of the NAS and this address can not be used as a robust identifier, because it's often possible to fall into the case when 2 different NASes are running on the same server and this attributes can not be customized. Any ideas?

    Read the article

  • dequeueReusableCell:withIdentifier: returns a cell even if it is not there?

    - by lostInTransit
    Hi I am using SDK 3.2 to create an iPad application. In my table I have 2 kinds of rows, one with a custom accessory view and another without any. I use two different cell identifiers for creating these. The first cell is created properly (dequeueReusable... returns a nil and the cell is initialized). But when a call is made to dequeueReusable.. with the other cell identifier, the cell is not nil (it should be because this is the first time the identifier is being used) An even stranger part is that when I use this cell to set the textLabel's text, it returns an EXC_BAD_ACCESS. So 2 questions Why is dequeueReusable... returning a cell when there is no cell created using the said identifier Even if it does return a cell, why is access to textLabel causing a crash? Thanks.

    Read the article

  • How to access members of an rdf list with rdflib (or plain sparql)

    - by tjb
    What is the best way to access the members of an rdf list? I'm using rdflib (python) but an answer given in plain SPARQL is also ok (this type of answer can be used through rdfextras, a rdflib helper library). I'm trying to access the authors of a particular journal article in rdf produced by Zotero (some fields have been removed for brevity): <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:z="http://www.zotero.org/namespaces/export#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:bib="http://purl.org/net/biblio#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:prism="http://prismstandard.org/namespaces/1.2/basic/" xmlns:link="http://purl.org/rss/1.0/modules/link/"> <bib:Article rdf:about="http://www.ncbi.nlm.nih.gov/pubmed/18273724"> <z:itemType>journalArticle</z:itemType> <dcterms:isPartOf rdf:resource="urn:issn:0954-6634"/> <bib:authors> <rdf:Seq> <rdf:li> <foaf:Person> <foaf:surname>Lee</foaf:surname> <foaf:givenname>Hyoun Seung</foaf:givenname> </foaf:Person> </rdf:li> <rdf:li> <foaf:Person> <foaf:surname>Lee</foaf:surname> <foaf:givenname>Jong Hee</foaf:givenname> </foaf:Person> </rdf:li> <rdf:li> <foaf:Person> <foaf:surname>Ahn</foaf:surname> <foaf:givenname>Gun Young</foaf:givenname> </foaf:Person> </rdf:li> <rdf:li> <foaf:Person> <foaf:surname>Lee</foaf:surname> <foaf:givenname>Dong Hun</foaf:givenname> </foaf:Person> </rdf:li> <rdf:li> <foaf:Person> <foaf:surname>Shin</foaf:surname> <foaf:givenname>Jung Won</foaf:givenname> </foaf:Person> </rdf:li> <rdf:li> <foaf:Person> <foaf:surname>Kim</foaf:surname> <foaf:givenname>Dong Hyun</foaf:givenname> </foaf:Person> </rdf:li> <rdf:li> <foaf:Person> <foaf:surname>Chung</foaf:surname> <foaf:givenname>Jin Ho</foaf:givenname> </foaf:Person> </rdf:li> </rdf:Seq> </bib:authors> <dc:title>Fractional photothermolysis for the treatment of acne scars: a report of 27 Korean patients</dc:title> <dcterms:abstract>OBJECTIVES: Atrophic post-acne scarring remains a therapeutically challe *CUT*, erythema and edema. CONCLUSIONS: The 1550-nm erbium-doped FP is associated with significant patient-reported improvement in the appearance of acne scars, with minimal downtime.</dcterms:abstract> <bib:pages>45-49</bib:pages> <dc:date>2008</dc:date> <z:shortTitle>Fractional photothermolysis for the treatment of acne scars</z:shortTitle> <dc:identifier> <dcterms:URI> <rdf:value>http://www.ncbi.nlm.nih.gov/pubmed/18273724</rdf:value> </dcterms:URI> </dc:identifier> <dcterms:dateSubmitted>2010-12-06 11:36:52</dcterms:dateSubmitted> <z:libraryCatalog>NCBI PubMed</z:libraryCatalog> <dc:description>PMID: 18273724</dc:description> </bib:Article> <bib:Journal rdf:about="urn:issn:0954-6634"> <dc:title>The Journal of Dermatological Treatment</dc:title> <prism:volume>19</prism:volume> <prism:number>1</prism:number> <dcterms:alternative>J Dermatolog Treat</dcterms:alternative> <dc:identifier>DOI 10.1080/09546630701691244</dc:identifier> <dc:identifier>ISSN 0954-6634</dc:identifier> </bib:Journal>

    Read the article

  • How to parse org.w3c.dom.Element RPX XML response

    - by Kenshin
    I am using rpxnow in Java, how do I use org.w3c.dom API to get the field identifier in this XML reponse for example? <?xml version='1.0' encoding='UTF-8'?> <rsp stat='ok'> <profile> <displayName> brian </displayName> <identifier> http://brian.myopenid.com/ </identifier> <preferredUsername> brian </preferredUsername> <providerName> Other </providerName> <url> http://brian.myopenid.com/ </url> </profile> </rsp>

    Read the article

  • Hashes vs Numeric id's

    - by Karan Bhangui
    When creating a web application that some how displays the display of a unique identifier for a recurring entity (videos on YouTube, or book section on a site like mine), would it be better to use a uniform length identifier like a hash or the unique key of the item in the database (1, 2, 3, etc). Besides revealing a little, what I think is immaterial, information about the internals of your app, why would using a hash be better than just using the unique id? In short: Which is better to use as a publicly displayed unique identifier - a hash value, or a unique key from the database? Edit: I'm opening up this question again because Dmitriy brought up the good point of not tying down the naming to db specific property. Will this sort of tie down prevent me from optimizing/normalizing the database in the future? The platform uses php/python with ISAM /w MySQL.

    Read the article

  • getting parameters from friendly url portlets jsr 286

    - by user265950
    link texthi, I am using ibm portal server. there is a link which is coming from external link. the url that is coming is as below http://localhost.us.deloitte.com:10040/wps/myportal/home/gm_assignee_label/gm_eoa_page?invoker=esb?agsnid=32984?asgnmtid=50085 home,gm_assignee_label,gm_eoa_page are friendly urls given to 3 different pages. things after the ? are the key value parameters. i want to retrieve these paramters when i click on the link above and my page gets loaded. i tried the below link as given by ibm. but it didnt help me my portlet.xml code is as below <?xml version="1.0" encoding="UTF-8"?> <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" id="com.ibm.faces.portlet.FacesPortlet.8b353a4492"> <portlet> <portlet-name>EndOfAssignmentPortlet</portlet-name> <display-name xml:lang="en">EndOfAssignmentPortlet</display-name> <display-name>EndOfAssignmentPortlet</display-name> <portlet-class>com.ibm.endofassignmentportlet.EndOfAssignmentPortlet</portlet-class> <init-param> <name>com.ibm.faces.portlet.page.view</name> <value>/view/endofassignment/EOASearchAssignment.jsp</value> </init-param> <init-param> <name>wps.markup</name> <value>html</value> </init-param> <init-param> <name>com.sun.faces.portlet.SAVE_REQUEST_SCOPE</name> <value>true</value> </init-param> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> <portlet-mode>view</portlet-mode> <portlet-mode>EDIT</portlet-mode> <portlet-mode>HELP</portlet-mode> </supports> <supported-locale>en</supported-locale> <resource-bundle> com.ibm.endofassignmentportlet.nl.EndOfAssignmentPortletResource</resource-bundle> <portlet-info> <title>EndOfAssignmentPortlet</title> <short-title>EndOfAssignmentPortlet</short-title> <keywords>EndOfAssignmentPortlet</keywords> </portlet-info> <supported-public-render-parameter>AssigneeID</supported-public-render-parameter> <supported-public-render-parameter>AssignmentID</supported-public-render-parameter> <supported-public-render-parameter>InvokerID</supported-public-render-parameter> </portlet> <default-namespace>http://EndOfAssignmentPortlet/</default-namespace> <public-render-parameter> <identifier>AssigneeID</identifier> <qname xmlns:x="http://localhost.us.deloitte.com:10040/wps/myportal">x:agsnid</qname> </public-render-parameter> <public-render-parameter> <identifier>AssignmentID</identifier> <qname xmlns:x="http://localhost.us.deloitte.com:10040/wps/myportal">x:asgnmtid</qname> </public-render-parameter> <public-render-parameter> <identifier>InvokerID</identifier> <qname xmlns:x="http://localhost.us.deloitte.com:10040/wps/myportal">x:invoker</qname> </public-render-parameter> </portlet-app> i am trying to get the values in my doView method of portlet as below String esbAssigneeID = request.getParameter("agsnid"); But i always get null. please help. TIA, Tejas

    Read the article

  • Jquery submit form error

    - by Gandalf StormCrow
    I have a form which I want to submit upon button click which is outside the form, here is my HTML : <form id="checkin" name="checkin" id="checkin" action#" method="post"> <input type="text" tabindex="100" class="identifier" name="identifier" id="identifier"> <input type="submit" tabindex="101" value="Submito" class="elsubmito" name="submit"> </form> Here is my jQuery : $("button").live('click', function(){ $("#checkin").submit(); }); $("#checkin").live('submit', function(){ }); When I click submit button inside the form its submitting ok, but its not submitting when I click on the button which is outside the form tags, why? how can I fix this ?

    Read the article

  • Flex/bison, error: undeclared

    - by Imran
    hallo, i have a problem, the followed program gives back an error, error:: Undeclared(first use in function), why this error appears all tokens are declared, but this error comes, can anyone help me, here are the lex and yac files.thanks lex: %{ int yylinenu= 1; int yycolno= 1; %} %x STR DIGIT [0-9] ALPHA [a-zA-Z] ID {ALPHA}(_?({ALPHA}|{DIGIT}))*_? GROUPED_NUMBER ({DIGIT}{1,3})(\.{DIGIT}{3})* SIMPLE_NUMBER {DIGIT}+ NUMMER {GROUPED_NUMBER}|{SIMPLE_NUMBER} %% <INITIAL>{ [\n] {++yylinenu ; yycolno=1;} [ ]+ {yycolno=yycolno+yyleng;} [\t]+ {yycolno=yycolno+(yyleng*8);} "*" {return MAL;} "+" {return PLUS;} "-" {return MINUS;} "/" {return SLASH;} "(" {return LINKEKLAMMER;} ")" {return RECHTEKLAMMER;} "{" {return LINKEGESCHWEIFTEKLAMMER;} "}" {return RECHTEGESCHEIFTEKLAMMER;} "=" {return GLEICH;} "==" {return GLEICHVERGLEICH;} "!=" {return UNGLEICH;} "<" {return KLEINER;} ">" {return GROSSER;} "<=" {return KLEINERGLEICH;} ">=" {return GROSSERGLEICH;} "while" {return WHILE;} "if" {return IF;} "else" {return ELSE;} "printf" {return PRINTF;} ";" {return SEMIKOLON;} \/\/[^\n]* { ;} {NUMMER} {return NUMBER;} {ID} {return IDENTIFIER;} \" {BEGIN(STR);} . {;} } <STR>{ \n {++yylinenu ;yycolno=1;} ([^\"\\]|"\\t"|"\\n"|"\\r"|"\\b"|"\\\"")+ {return STRING;} \" {BEGIN(INITIAL);} } %% yywrap() { } YACC: %{ #include stdio.h> #include string.h> #include "lex.yy.c" void yyerror(char *err); int error=0,linecnt=1; %} %token IDENTIFIER NUMBER STRING COMMENT PLUS MINUS MAL SLASH LINKEKLAMMER RECHTEKLAMMER LINKEGESCHWEIFTEKLAMMER RECHTEGESCHEIFTEKLAMMER GLEICH GLEICHVERGLEICH UNGLEICH GROSSER KLEINER GROSSERGLEICH KLEINERGLEICH IF ELSE WHILE PRINTF SEMIKOLON %start Stmts %% Stmts : Stmt {puts("\t\tStmts : Stmt");} |Stmt Stmts {puts("\t\tStmts : Stmt Stmts");} ; //NEUE REGEL---------------------------------------------- Stmt : LINKEGESCHWEIFTEKLAMMER Stmts RECHTEGESCHEIFTEKLAMMER {puts("\t\tStmt : '{' Stmts '}'");} |IF LINKEKLAMMER Cond RECHTEKLAMMER Stmt {puts("\t\tStmt : '(' Cond ')' Stmt");} |IF LINKEKLAMMER Cond RECHTEKLAMMER Stmt ELSE Stmt {puts("\t\tStmt : '(' Cond ')' Stmt 'ELSE' Stmt");} |WHILE LINKEKLAMMER Cond RECHTEKLAMMER Stmt {puts("\t\tStmt : 'PRINTF' Expr ';'");} |PRINTF Expr SEMIKOLON {puts("\t\tStmt : 'PRINTF' Expr ';'");} |IDENTIFIER GLEICH Expr SEMIKOLON {puts("\t\tStmt : 'IDENTIFIER' '=' Expr ';'");} |SEMIKOLON {puts("\t\tStmt : ';'");} ;//NEUE REGEL --------------------------------------------- Cond: Expr GLEICHVERGLEICH Expr {puts("\t\tCond : '==' Expr");} |Expr UNGLEICH Expr {puts("\t\tCond : '!=' Expr");} |Expr KLEINER Expr {puts("\t\tCond : '<' Expr");} |Expr KLEINERGLEICH Expr {puts("\t\tCond : '<=' Expr");} |Expr GROSSER Expr {puts("\t\tCond : '>' Expr");} |Expr GROSSERGLEICH Expr {puts("\t\tCond : '>=' Expr");} ;//NEUE REGEL -------------------------------------------- Expr:Term {puts("\t\tExpr : Term");} |Term PLUS Expr {puts("\t\tExpr : Term '+' Expr");} |Term MINUS Expr {puts("\t\tExpr : Term '-' Expr");} ;//NEUE REGEL -------------------------------------------- Term:Factor {puts("\t\tTerm : Factor");} |Factor MAL Term {puts("\t\tTerm : Factor '*' Term");} |Factor SLASH Term {puts("\t\tTerm : Factor '/' Term");} ;//NEUE REGEL -------------------------------------------- Factor:SimpleExpr {puts("\t\tFactor : SimpleExpr");} |MINUS SimpleExpr {puts("\t\tFactor : '-' SimpleExpr");} ;//NEUE REGEL -------------------------------------------- SimpleExpr:LINKEKLAMMER Expr RECHTEKLAMMER {puts("\t\tSimpleExpr : '(' Expr ')'");} |IDENTIFIER {puts("\t\tSimpleExpr : 'IDENTIFIER'");} |NUMBER {puts("\t\tSimpleExpr : 'NUMBER'");} |STRING {puts("\t\tSimpleExpr : 'String'");} ;//ENDE ------------------------------------------------- %% void yyerror(char *msg) { error=1; printf("Line: %d , Column: %d : %s \n", yylinenu, yycolno,yytext, msg); } int main(int argc, char *argv[]) { int val; while(yylex()) { printf("\n",yytext); } return yyparse(); }

    Read the article

  • iPhone Map: Identifying Users Location

    - by senfo
    I have a number of annotations on my map, in addition to the users current location. This works fine, except the default color for the users current location is the same as all of the other annotations. I'd like to make the pin green for the users current location so that it's uniquely identifiable from the other pins. How do I do this? Bellow is the method I've been using (I can't find a way to determine which annotation is the users current location): - (MKAnnotationView *)mapView:(MKMapView *)mapViewLocal viewForAnnotation:(id <MKAnnotation>)annotation { static NSString *identifier = @"Pin"; MKPinAnnotationView *pinView = (MKPinAnnotationView*)[mapView dequeueReusableAnnotationViewWithIdentifier:identifier]; if (pinView == nil) { pinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier] autorelease]; pinView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; pinView.animatesDrop = YES; pinView.canShowCallout = YES; } else { pinView.annotation = annotation; } return pinView; }

    Read the article

  • Visual C++ 2008 doesn't recognize Windows declared types

    - by David Thornley
    I have a program that doesn't seem to recognize declared types in the latest U3D software. There's a line typedef BOOL (WINAPI* GMI)(HMON, LPMONITORINFOEX); which gets the error: Error 1 error C2061: syntax error : identifier 'LPMONITORINFOEX' c:\Projects\U3D\Source\RTL\Platform\Common\Win32\IFXOSRender.cpp 28 and a line MONITORINFOEX miMon; which gets Error 5 error C2065: 'miMon' : undeclared identifier c:\Projects\U3D\Source\RTL\Platform\Common\Win32\IFXOSRender.cpp 49 Error 3 error C2065: 'MONITORINFOEX' : undeclared identifier c:\Projects\U3D\Source\RTL\Platform\Common\Win32\IFXOSRender.cpp 49 The program's first non-comment statement is #include <windows.h>, which includes winuser.h, which defines these identifiers. In Visual Studio, I can right-click on them and go to the definition (a typedef) and from the typedef to the struct. WINAPI is defined in WinDef.h, so that seems to be working. There are no redefinitions of LPMONITORINFOEX or MONITORINFOEX in any other file. So, how can this be happening, and what can I do about it?

    Read the article

  • Rendering ASP.NET Script References into the Html Header

    - by Rick Strahl
    One thing that I’ve come to appreciate in control development in ASP.NET that use JavaScript is the ability to have more control over script and script include placement than ASP.NET provides natively. Specifically in ASP.NET you can use either the ClientScriptManager or ScriptManager to embed scripts and script references into pages via code. This works reasonably well, but the script references that get generated are generated into the HTML body and there’s very little operational control for placement of scripts. If you have multiple controls or several of the same control that need to place the same scripts onto the page it’s not difficult to end up with scripts that render in the wrong order and stop working correctly. This is especially critical if you load script libraries with dependencies either via resources or even if you are rendering referenced to CDN resources. Natively ASP.NET provides a host of methods that help embedding scripts into the page via either Page.ClientScript or the ASP.NET ScriptManager control (both with slightly different syntax): RegisterClientScriptBlock Renders a script block at the top of the HTML body and should be used for embedding callable functions/classes. RegisterStartupScript Renders a script block just prior to the </form> tag and should be used to for embedding code that should execute when the page is first loaded. Not recommended – use jQuery.ready() or equivalent load time routines. RegisterClientScriptInclude Embeds a reference to a script from a url into the page. RegisterClientScriptResource Embeds a reference to a Script from a resource file generating a long resource file string All 4 of these methods render their <script> tags into the HTML body. The script blocks give you a little bit of control by having a ‘top’ and ‘bottom’ of the document location which gives you some flexibility over script placement and precedence. Script includes and resource url unfortunately do not even get that much control – references are simply rendered into the page in the order of declaration. The ASP.NET ScriptManager control facilitates this task a little bit with the abililty to specify scripts in code and the ability to programmatically check what scripts have already been registered, but it doesn’t provide any more control over the script rendering process itself. Further the ScriptManager is a bear to deal with generically because generic code has to always check and see if it is actually present. Some time ago I posted a ClientScriptProxy class that helps with managing the latter process of sending script references either to ClientScript or ScriptManager if it’s available. Since I last posted about this there have been a number of improvements in this API, one of which is the ability to control placement of scripts and script includes in the page which I think is rather important and a missing feature in the ASP.NET native functionality. Handling ScriptRenderModes One of the big enhancements that I’ve come to rely on is the ability of the various script rendering functions described above to support rendering in multiple locations: /// <summary> /// Determines how scripts are included into the page /// </summary> public enum ScriptRenderModes { /// <summary> /// Inherits the setting from the control or from the ClientScript.DefaultScriptRenderMode /// </summary> Inherit, /// Renders the script include at the location of the control /// </summary> Inline, /// <summary> /// Renders the script include into the bottom of the header of the page /// </summary> Header, /// <summary> /// Renders the script include into the top of the header of the page /// </summary> HeaderTop, /// <summary> /// Uses ClientScript or ScriptManager to embed the script include to /// provide standard ASP.NET style rendering in the HTML body. /// </summary> Script, /// <summary> /// Renders script at the bottom of the page before the last Page.Controls /// literal control. Note this may result in unexpected behavior /// if /body and /html are not the last thing in the markup page. /// </summary> BottomOfPage } This enum is then applied to the various Register functions to allow more control over where scripts actually show up. Why is this useful? For me I often render scripts out of control resources and these scripts often include things like a JavaScript Library (jquery) and a few plug-ins. The order in which these can be loaded is critical so that jQuery.js always loads before any plug-in for example. Typically I end up with a general script layout like this: Core Libraries- HeaderTop Plug-ins: Header ScriptBlocks: Header or Script depending on other dependencies There’s also an option to render scripts and CSS at the very bottom of the page before the last Page control on the page which can be useful for speeding up page load when lots of scripts are loaded. The API syntax of the ClientScriptProxy methods is closely compatible with ScriptManager’s using static methods and control references to gain access to the page and embedding scripts. For example, to render some script into the current page in the header: // Create script block in header ClientScriptProxy.Current.RegisterClientScriptBlock(this, typeof(ControlResources), "hello_function", "function helloWorld() { alert('hello'); }", true, ScriptRenderModes.Header); // Same again - shouldn't be rendered because it's the same id ClientScriptProxy.Current.RegisterClientScriptBlock(this, typeof(ControlResources), "hello_function", "function helloWorld() { alert('hello'); }", true, ScriptRenderModes.Header); // Create a second script block in header ClientScriptProxy.Current.RegisterClientScriptBlock(this, typeof(ControlResources), "hello_function2", "function helloWorld2() { alert('hello2'); }", true, ScriptRenderModes.Header); // This just calls ClientScript and renders into bottom of document ClientScriptProxy.Current.RegisterStartupScript(this,typeof(ControlResources), "call_hello", "helloWorld();helloWorld2();", true); which generates: <html xmlns="http://www.w3.org/1999/xhtml" > <head><title> </title> <script type="text/javascript"> function helloWorld() { alert('hello'); } </script> <script type="text/javascript"> function helloWorld2() { alert('hello2'); } </script> </head> <body> … <script type="text/javascript"> //<![CDATA[ helloWorld();helloWorld2();//]]> </script> </form> </body> </html> Note that the scripts are generated into the header rather than the body except for the last script block which is the call to RegisterStartupScript. In general I wouldn’t recommend using RegisterStartupScript – ever. It’s a much better practice to use a script base load event to handle ‘startup’ code that should fire when the page first loads. So instead of the code above I’d actually recommend doing: ClientScriptProxy.Current.RegisterClientScriptBlock(this, typeof(ControlResources), "call_hello", "$().ready( function() { alert('hello2'); });", true, ScriptRenderModes.Header); assuming you’re using jQuery on the page. For script includes from a Url the following demonstrates how to embed scripts into the header. This example injects a jQuery and jQuery.UI script reference from the Google CDN then checks each with a script block to ensure that it has loaded and if not loads it from a server local location: // load jquery from CDN ClientScriptProxy.Current.RegisterClientScriptInclude(this, typeof(ControlResources), "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js", ScriptRenderModes.HeaderTop); // check if jquery loaded - if it didn't we're not online string scriptCheck = @"if (typeof jQuery != 'object') document.write(unescape(""%3Cscript src='{0}' type='text/javascript'%3E%3C/script%3E""));"; string jQueryUrl = ClientScriptProxy.Current.GetWebResourceUrl(this, typeof(ControlResources), ControlResources.JQUERY_SCRIPT_RESOURCE); ClientScriptProxy.Current.RegisterClientScriptBlock(this, typeof(ControlResources), "jquery_register", string.Format(scriptCheck,jQueryUrl),true, ScriptRenderModes.HeaderTop); // Load jquery-ui from cdn ClientScriptProxy.Current.RegisterClientScriptInclude(this, typeof(ControlResources), "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js", ScriptRenderModes.Header); // check if we need to load from local string jQueryUiUrl = ResolveUrl("~/scripts/jquery-ui-custom.min.js"); ClientScriptProxy.Current.RegisterClientScriptBlock(this, typeof(ControlResources), "jqueryui_register", string.Format(scriptCheck, jQueryUiUrl), true, ScriptRenderModes.Header); // Create script block in header ClientScriptProxy.Current.RegisterClientScriptBlock(this, typeof(ControlResources), "hello_function", "$().ready( function() { alert('hello'); });", true, ScriptRenderModes.Header); which in turn generates this HTML: <html xmlns="http://www.w3.org/1999/xhtml" > <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> if (typeof jQuery != 'object') document.write(unescape("%3Cscript src='/WestWindWebToolkitWeb/WebResource.axd?d=DIykvYhJ_oXCr-TA_dr35i4AayJoV1mgnQAQGPaZsoPM2LCdvoD3cIsRRitHKlKJfV5K_jQvylK7tsqO3lQIFw2&t=633979863959332352' type='text/javascript'%3E%3C/script%3E")); </script> <title> </title> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" type="text/javascript"></script> <script type="text/javascript"> if (typeof jQuery != 'object') document.write(unescape("%3Cscript src='/WestWindWebToolkitWeb/scripts/jquery-ui-custom.min.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> $().ready(function() { alert('hello'); }); </script> </head> <body> …</body> </html> As you can see there’s a bit more control in this process as you can inject both script includes and script blocks into the document at the top or bottom of the header, plus if necessary at the usual body locations. This is quite useful especially if you create custom server controls that interoperate with script and have certain dependencies. The above is a good example of a useful switchable routine where you can switch where scripts load from by default – the above pulls from Google CDN but a configuration switch may automatically switch to pull from the local development copies if your doing development for example. How does it work? As mentioned the ClientScriptProxy object mimicks many of the ScriptManager script related methods and so provides close API compatibility with it although it contains many additional overloads that enhance functionality. It does however work against ScriptManager if it’s available on the page, or Page.ClientScript if it’s not so it provides a single unified frontend to script access. There are however many overloads of the original SM methods like the above to provide additional functionality. The implementation of script header rendering is pretty straight forward – as long as a server header (ie. it has to have runat=”server” set) is available. Otherwise these routines fall back to using the default document level insertions of ScriptManager/ClientScript. Given that there is a server header it’s relatively easy to generate the script tags and code and append them to the header either at the top or bottom. I suspect Microsoft didn’t provide header rendering functionality precisely because a runat=”server” header is not required by ASP.NET so behavior would be slightly unpredictable. That’s not really a problem for a custom implementation however. Here’s the RegisterClientScriptBlock implementation that takes a ScriptRenderModes parameter to allow header rendering: /// <summary> /// Renders client script block with the option of rendering the script block in /// the Html header /// /// For this to work Header must be defined as runat="server" /// </summary> /// <param name="control">any control that instance typically page</param> /// <param name="type">Type that identifies this rendering</param> /// <param name="key">unique script block id</param> /// <param name="script">The script code to render</param> /// <param name="addScriptTags">Ignored for header rendering used for all other insertions</param> /// <param name="renderMode">Where the block is rendered</param> public void RegisterClientScriptBlock(Control control, Type type, string key, string script, bool addScriptTags, ScriptRenderModes renderMode) { if (renderMode == ScriptRenderModes.Inherit) renderMode = DefaultScriptRenderMode; if (control.Page.Header == null || renderMode != ScriptRenderModes.HeaderTop && renderMode != ScriptRenderModes.Header && renderMode != ScriptRenderModes.BottomOfPage) { RegisterClientScriptBlock(control, type, key, script, addScriptTags); return; } // No dupes - ref script include only once const string identifier = "scriptblock_"; if (HttpContext.Current.Items.Contains(identifier + key)) return; HttpContext.Current.Items.Add(identifier + key, string.Empty); StringBuilder sb = new StringBuilder(); // Embed in header sb.AppendLine("\r\n<script type=\"text/javascript\">"); sb.AppendLine(script); sb.AppendLine("</script>"); int? index = HttpContext.Current.Items["__ScriptResourceIndex"] as int?; if (index == null) index = 0; if (renderMode == ScriptRenderModes.HeaderTop) { control.Page.Header.Controls.AddAt(index.Value, new LiteralControl(sb.ToString())); index++; } else if(renderMode == ScriptRenderModes.Header) control.Page.Header.Controls.Add(new LiteralControl(sb.ToString())); else if (renderMode == ScriptRenderModes.BottomOfPage) control.Page.Controls.AddAt(control.Page.Controls.Count-1,new LiteralControl(sb.ToString())); HttpContext.Current.Items["__ScriptResourceIndex"] = index; } Note that the routine has to keep track of items inserted by id so that if the same item is added again with the same key it won’t generate two script entries. Additionally the code has to keep track of how many insertions have been made at the top of the document so that entries are added in the proper order. The RegisterScriptInclude method is similar but there’s some additional logic in here to deal with script file references and ClientScriptProxy’s (optional) custom resource handler that provides script compression /// <summary> /// Registers a client script reference into the page with the option to specify /// the script location in the page /// </summary> /// <param name="control">Any control instance - typically page</param> /// <param name="type">Type that acts as qualifier (uniqueness)</param> /// <param name="url">the Url to the script resource</param> /// <param name="ScriptRenderModes">Determines where the script is rendered</param> public void RegisterClientScriptInclude(Control control, Type type, string url, ScriptRenderModes renderMode) { const string STR_ScriptResourceIndex = "__ScriptResourceIndex"; if (string.IsNullOrEmpty(url)) return; if (renderMode == ScriptRenderModes.Inherit) renderMode = DefaultScriptRenderMode; // Extract just the script filename string fileId = null; // Check resource IDs and try to match to mapped file resources // Used to allow scripts not to be loaded more than once whether // embedded manually (script tag) or via resources with ClientScriptProxy if (url.Contains(".axd?r=")) { string res = HttpUtility.UrlDecode( StringUtils.ExtractString(url, "?r=", "&", false, true) ); foreach (ScriptResourceAlias item in ScriptResourceAliases) { if (item.Resource == res) { fileId = item.Alias + ".js"; break; } } if (fileId == null) fileId = url.ToLower(); } else fileId = Path.GetFileName(url).ToLower(); // No dupes - ref script include only once const string identifier = "script_"; if (HttpContext.Current.Items.Contains( identifier + fileId ) ) return; HttpContext.Current.Items.Add(identifier + fileId, string.Empty); // just use script manager or ClientScriptManager if (control.Page.Header == null || renderMode == ScriptRenderModes.Script || renderMode == ScriptRenderModes.Inline) { RegisterClientScriptInclude(control, type,url, url); return; } // Retrieve script index in header int? index = HttpContext.Current.Items[STR_ScriptResourceIndex] as int?; if (index == null) index = 0; StringBuilder sb = new StringBuilder(256); url = WebUtils.ResolveUrl(url); // Embed in header sb.AppendLine("\r\n<script src=\"" + url + "\" type=\"text/javascript\"></script>"); if (renderMode == ScriptRenderModes.HeaderTop) { control.Page.Header.Controls.AddAt(index.Value, new LiteralControl(sb.ToString())); index++; } else if (renderMode == ScriptRenderModes.Header) control.Page.Header.Controls.Add(new LiteralControl(sb.ToString())); else if (renderMode == ScriptRenderModes.BottomOfPage) control.Page.Controls.AddAt(control.Page.Controls.Count-1, new LiteralControl(sb.ToString())); HttpContext.Current.Items[STR_ScriptResourceIndex] = index; } There’s a little more code here that deals with cleaning up the passed in Url and also some custom handling of script resources that run through the ScriptCompressionModule – any script resources loaded in this fashion are automatically cached based on the resource id. Raw urls extract just the filename from the URL and cache based on that. All of this to avoid doubling up of scripts if called multiple times by multiple instances of the same control for example or several controls that all load the same resources/includes. Finally RegisterClientScriptResource utilizes the previous method to wrap the WebResourceUrl as well as some custom functionality for the resource compression module: /// <summary> /// Returns a WebResource or ScriptResource URL for script resources that are to be /// embedded as script includes. /// </summary> /// <param name="control">Any control</param> /// <param name="type">A type in assembly where resources are located</param> /// <param name="resourceName">Name of the resource to load</param> /// <param name="renderMode">Determines where in the document the link is rendered</param> public void RegisterClientScriptResource(Control control, Type type, string resourceName, ScriptRenderModes renderMode) { string resourceUrl = GetClientScriptResourceUrl(control, type, resourceName); RegisterClientScriptInclude(control, type, resourceUrl, renderMode); } /// <summary> /// Works like GetWebResourceUrl but can be used with javascript resources /// to allow using of resource compression (if the module is loaded). /// </summary> /// <param name="control"></param> /// <param name="type"></param> /// <param name="resourceName"></param> /// <returns></returns> public string GetClientScriptResourceUrl(Control control, Type type, string resourceName) { #if IncludeScriptCompressionModuleSupport // If wwScriptCompression Module through Web.config is loaded use it to compress // script resources by using wcSC.axd Url the module intercepts if (ScriptCompressionModule.ScriptCompressionModuleActive) { string url = "~/wwSC.axd?r=" + HttpUtility.UrlEncode(resourceName); if (type.Assembly != GetType().Assembly) url += "&t=" + HttpUtility.UrlEncode(type.FullName); return WebUtils.ResolveUrl(url); } #endif return control.Page.ClientScript.GetWebResourceUrl(type, resourceName); } This code merely retrieves the resource URL and then simply calls back to RegisterClientScriptInclude with the URL to be embedded which means there’s nothing specific to deal with other than the custom compression module logic which is nice and easy. What else is there in ClientScriptProxy? ClientscriptProxy also provides a few other useful services beyond what I’ve already covered here: Transparent ScriptManager and ClientScript calls ClientScriptProxy includes a host of routines that help figure out whether a script manager is available or not and all functions in this class call the appropriate object – ScriptManager or ClientScript – that is available in the current page to ensure that scripts get embedded into pages properly. This is especially useful for control development where controls have no control over the scripting environment in place on the page. RegisterCssLink and RegisterCssResource Much like the script embedding functions these two methods allow embedding of CSS links. CSS links are appended to the header or to a form declared with runat=”server”. LoadControlScript Is a high level resource loading routine that can be used to easily switch between different script linking modes. It supports loading from a WebResource, a url or not loading anything at all. This is very useful if you build controls that deal with specification of resource urls/ids in a standard way. Check out the full Code You can check out the full code to the ClientScriptProxyClass here: ClientScriptProxy.cs ClientScriptProxy Documentation (class reference) Note that the ClientScriptProxy has a few dependencies in the West Wind Web Toolkit of which it is part of. ControlResources holds a few standard constants and script resource links and the ScriptCompressionModule which is referenced in a few of the script inclusion methods. There’s also another useful ScriptContainer companion control  to the ClientScriptProxy that allows scripts to be placed onto the page’s markup including the ability to specify the script location and script minification options. You can find all the dependencies in the West Wind Web Toolkit repository: West Wind Web Toolkit Repository West Wind Web Toolkit Home Page© Rick Strahl, West Wind Technologies, 2005-2010Posted in ASP.NET  JavaScript  

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >