Here is just a few illustrations (with some text) for chapter about snapshot and snapshot-origin device mapper's targets from RedHat's Logical Volume Manager Administration Guide. Also, here i make some assumptions about how this works, which seems logical, but unproved since i don't check LVM's sources.
DISCLAIMER. English language used here only for compatibility (ASCII only), so any suggestions about my bad grammar (and not only it) will be greatly appreciated.
четверг, 4 августа 2011 г.
LVM snapshots and corresponding DM tables
понедельник, 11 июля 2011 г.
This icq..
This icq, this damned icq.. doesn't log in! As i expected, though.
воскресенье, 8 мая 2011 г.
Variable assignment in bash `eval`
Here is example of variable assignment in eval:
(
v="a\" b";
eval "r=\"$v\"";
declare -p r
)
Such assignment lead to error due to unmatched double quote. Here is corrected
version of above example
(
v="a\" b";
eval "r=\"\$v\"";
declare -p r
)
And here is example of executing arbitrary command through such incorrect eval
construction:
(
v="a\"; ls; \":";
eval "r=\"$v\"";
declare -p r
)
Note a colon (':') in 'v' value: bash does not even complain about incorrect
syntax - all is correct and all will work fine!
So, it's safe (perhaps) to use parameter expansion to form variable's name for
assign to, like
(
v="arr";
eval "${v}[1]=123";
declare -p arr;
eval "r=\${${v}[1]}";
declare -p r
)
because here bash's own constrains on characters in variable name applied, and
bash checks this. But it's _not_ safe to expand variable up to value in the
main script - do it in eval script instead.
Note, the same also applies to indirect reference: do not use it to expand up
to value in main script in eval constructions. Here is flawed example:
(
j=var;
var="a\"; ls; \":";
i=r;
eval "$i=\"${!j}\"";
declare -p r;
)
and now corrected version
(
j=var;
var="a\"; ls; \":";
i=r;
eval "$i=\"\${$j}\"";
declare -p r;
)
or with indirect reference
(
j=var;
var="a\"; ls; \":";
i=r;
eval "$i=\"\${!j}\"";
declare -p r;
)
вторник, 22 марта 2011 г.
Отчет об автопробеге "Весенний Quest" 6-8 марта 2011 года. Экипаж №47
(отформатированная версия оригинала с форума "Магистрали" )
06 марта. День первый. Москва - Поленово - Савино - Дворяниново - Тула
Стартовали в Москве не рано: чуть-чуть поспали-поели, скачали задание, поразгадывали, нашли все точки и выехали около 16 часов. Заехали в Поленово. Пожалели, что надо быстро уезжать, решили приехать как-нибудь не спеша и отправились в Савино искать музей Руднева. Уже стемнело, но в музее еще горел свет - сидел охранник - поэтому нашли быстро и поехали дальше. В Русятино оказалось на удивление много прохожих, спросили у них про усадьбу. На подъезде к Дворяниново встречные собаки бросались под колеса и лаяли. В полной темноте остановились перед шлагбаумом и потихоньку пошли с фонарем искать усадебный дом и памятник Болотову. Тихо, звезды в небе, никого... Нашли! Что ж уже поздно, в Острецово решили не ехать - поехали в Тулу.
07 марта. День второй. Тула - Новомосковск - Куликово поле - Богородицк - Дедилово - Тула
Утром в 7 часов около тульского Кремля были остановлены для проверки документов стражем ДПС, получили от него добрые напутствия и поехали собирать КП. Большинство адресов нашли еще дома. А вот памятник хвосту искали долго: проехали дважды, не ожидали, что он такой маленький. Очень симпатичный дракоша! Потом запаслись пряниками на фабрике, позавтракали и поехали на Куликово поле.
В Бородинском встретились с экипажем 10 (привет!), постояли у Кургана Бессмертия, потом - Новомосковск и Куликово поле. Здесь, конечно, трудно заблудиться - указатели кругом понаставлены. Проехали по степям, собрали все КП. Два раза Дон пересекали. Особенно понравился большой голубой фургон среди степи с надписью "Живая рыба". К сожалению, не успели заснять.
Обратно повернули в Крестах (чтобы не возвращаться той же дорогой) и по Р142 поехали в Богородицк. В поисках КП объехали в городе все парки-скверы (их оказалось три). Наконец, нашли усадьбу и памятник Болотову. Сфотографировали колокольню в лучах заходящего солнца и решили возвращаться в Тулу, поскольку поняли, что намеченный на день план мы уже не выполним и до Малоярославца, где нас ждет заказанная гостиница, уже не доедем. По пути отыскали красивую церковь (КП-59) в Дедилово. Для фото подсветили ее своими фарами, и тут включили подсветку.
08 марта. День третий. Тула - Алексин - Таруса - Кременки - Жуков - Малоярославец - Москва
Искали неправильное Богучарово, у тракториста выяснили, что до бывшей усадьбы не добраться, да и колокольни там нет. Развернулись, уехали на Алексин. В Алексине были в 9 часов. Остановились посмотреть карту, смотрим - стоим около магазина при хлебзаводе, и он работает, и в нем продают свежий хлеб! Купили. Очень вкусный был батон. Поехали искать КП. Чтобы не бегать по всему парку Жалка в поисках скульптуры, решили взять "языка": пожилой мужчина вызвался нас проводить. Двигаясь неспешным ходом, он рассказывал об истории парка, замечательных деревянных скульптурах - сказочный городок - и даже прочитал отрывки из своих стихов, за которые когда-то получил награду, а теперь с трудом вспомнил.
Дальше - Таруса. По нашему маршруту мы должны были ехать через Колосово и Вознесенье, но слегка промахнулись с нужным поворотом и поехали по кольцевой дороге через деревни (Савватеево, Жуково, Кузнецы). Сделав почетный круг по полям, местами скребя брюхом, вырулили на Колосово. Там - налево проулком в одну машину, не без труда преодолев крутой скользкий подъем за речкой и никого не встретив, добрались до Тарусы. Город понравился, давно хотели сюда попасть. Жаль, что точки нашли быстро и не пришлось поездить по городу.
Дальше - Кременки, Стрелковка, Жуков. Очень понравилась дорога вдоль Протвы. Времени оставалось немного - завтра на работу, - из оставшихся точек в районе Обнинска выбрали Малоярославец. Правда, на пересечении М3 и А101 свернули не туда - на Калугу. Зато в поселке Спас-Загорье, через который мы теперь ехали на Малоярославец, увидели красивую церковь. В Малоярославце очень понравился Черноостровсикй монастырь и памятник солдату, возлагающему венок (КП-31), в Сквере 1812 года. К сожалению не попали в Боровск, Калугу. Как-нибудь вернемся.
Заключение.
Общий пробег составил 958 км. Маршрут понравился, но было мало дней, жаль, что все не успели. Это наша вторая поездка. Первой был Новогодний quest, недавно получили дипломы по почте. Обрадовались! Спасибо организаторам! Ждем новых встреч!
А также отдельная благодарность создателям открытой и бесплатной карты OpenStreetMap и навигационной программы Navit.
вторник, 1 февраля 2011 г.
Intel AMT IDE Redirection and linux
Shortly: it works -)
Now with more details. Module 'ata_generic' (CONFIG_ATA_GENERIC) may drive
IDER controller. Though, it will not take over this device without option
'all_generic_ide=1' (perhaps, because IDER controller match with "any"
alias, but not device-specific one?):
# modinfo ata_generic
..
alias: pci:v*d*sv*sd*bc01sc01i*
..
So, we should load it like
# modprobe ata_generic all_generic_ide=1
Now we can check, that it successfully takes over IDER controller
# lspci -nn | grep IDER
00:03.2 IDE interface [0101]: Intel Corporation Mobile PM965/GM965 PT IDER Controller [8086:2a06] (rev 0c)
# ls -l /sys/bus/pci/devices/0000:00:03.2/driver
lrwxrwxrwx 1 root root 0 Jan 31 17:44 /sys/bus/pci/devices/0000:00:03.2/driver -> ../../../bus/pci/drivers/ata_generic
But in order to have kernel see scsi targets on this IDER controller, we
need to enable IDE Redirection in remote management console (you may use
Manageability Commander Tool from Intel Manageability Developer Tool Kit
for testing). There will be two scsi targets on this scsi host: floppy
(bus=0, id=0, lun=0) and cdrom (bus=0, id=1, lun=0). Floppy will be
handled by sd, and cdrom by sr_mod:
# ls -l /sys/bus/pci/devices/0000:00:03.2/host21/
total 0
drwxr-xr-x 2 root root 0 Jan 31 18:16 power
drwxr-xr-x 3 root root 0 Jan 31 18:16 scsi_host
lrwxrwxrwx 1 root root 0 Jan 31 17:44 subsystem -> ../../../../bus/scsi
drwxr-xr-x 4 root root 0 Jan 31 17:44 target21:0:0
drwxr-xr-x 4 root root 0 Jan 31 17:44 target21:0:1
-rw-r--r-- 1 root root 4096 Jan 31 17:44 uevent
# ls -l /sys/bus/pci/devices/0000:00:03.2/host21/target21:0:0/21:0:0:0/driver
lrwxrwxrwx 1 root root 0 Jan 31 17:44 /sys/bus/pci/devices/0000:00:03.2/host21/target21:0:0/21:0:0:0/driver -> ../../../../../../bus/scsi/drivers/sd
# ls -l /sys/bus/pci/devices/0000:00:03.2/host21/target21:0:1/21:0:1:0/driver
lrwxrwxrwx 1 root root 0 Jan 31 17:45 /sys/bus/pci/devices/0000:00:03.2/host21/target21:0:1/21:0:1:0/driver -> ../../../../../../bus/scsi/drivers/sr
And now the only left is to make these modules autoload during boot. Here
is one thing to note: we should load all specific ata modules (for other
hardware, if any) _before_ 'ata_generic'. Otherwise with parameter
'all_generic_ide' it'll take over all available ata controllers. Order of
ata drivers and scsi drivers (sr_mod, sd) does not matter. So, something
like this should be written in modprobe.conf:
modprobe.conf:
options ata_generic all_generic_ide=1
install ata_generic /sbin/modprobe ata_piix ; /sbin/modprobe --ignore-install ata_generic
or
modprobe.conf:
options ata_generic all_generic_ide=1
install ata_generic /sbin/modprobe ata_piix ; /sbin/modprobe --ignore-install ata_generic $CMDLINE_OPTS
though, adding $CMDLINE_OPTS (to add all options from the command line) is
useless here - 'ata_generic' has only one option.
Also there is another one module, which can drive IDER controller -
'ide_pci_generic' (CONFIG_BLK_DEV_GENERIC). Unlike 'ata_generic', which
uses libata, this module uses old ATA subsystem (CONFIG_IDE) (are terms
here used correctly?). If you use this driver, cdrom drive will no longer
be present as scsi device. Now it'll be handled by 'ide_cd' driver
(CONFIG_BLK_DEV_IDECD). 'ide_pci_generic' driver also requires option
'all_generic_ide' set in order to take over any device.
Here are some results from booting linux with different ATA drivers used
(though root partition in these tests is on the hard drive).
All three boot scenarios require SATA AHCI controller to be in
compatibility mode, otherwise ATA drivers can not work with it and kernel
can't access root partition.
1. ata_piix. Here ata_piix driver is compiled in and handles all ATA
controllers. It correctly takes over AHCI controller (in
compatiblility mode) and over PATA controller. ata_generic was loaded
as module later to handle IDER controller.
Here is some info about such system config:
# ls -l /sys/bus/pci/devices/*/driver
..
lrwxrwxrwx 1 root root 0 Feb 1 13:06 /sys/bus/pci/devices/0000:00:03.2/driver -> ../../../bus/pci/drivers/ata_generic
..
lrwxrwxrwx 1 root root 0 Feb 1 13:06 /sys/bus/pci/devices/0000:00:1f.2/driver -> ../../../bus/pci/drivers/ata_piix
..
# lspci -nn | grep IDE
00:03.2 IDE interface [0101]: Intel Corporation Mobile PM965/GM965 PT IDER Controller [8086:2a06] (rev 0c)
00:1f.2 IDE interface [0101]: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA IDE Controller [8086:2828] (rev 03)
# ls -l /sys/bus/pci/devices/0000\:00\:1f.2/
total 0
..
lrwxrwxrwx 1 root root 0 Feb 1 13:06 driver -> ../../../bus/pci/drivers/ata_piix
..
drwxr-xr-x 5 root root 0 Feb 1 2011 host0
drwxr-xr-x 5 root root 0 Feb 1 2011 host1
..
# ls -l /sys/bus/pci/devices/0000\:00\:1f.2/host0/
total 0
drwxr-xr-x 2 root root 0 Feb 1 13:13 power
drwxr-xr-x 3 root root 0 Feb 1 2011 scsi_host
lrwxrwxrwx 1 root root 0 Feb 1 2011 subsystem -> ../../../../bus/scsi
drwxr-xr-x 4 root root 0 Feb 1 2011 target0:0:0
-rw-r--r-- 1 root root 4096 Feb 1 2011 uevent
# ls -l /sys/bus/pci/devices/0000\:00\:1f.2/host0/target0\:0\:0/0\:0\:0\:0/driver
lrwxrwxrwx 1 root root 0 Feb 1 13:13 /sys/bus/pci/devices/0000:00:1f.2/host0/target0:0:0/0:0:0:0/driver -> ../../../../../../bus/scsi/drivers/sd
# ls -l /sys/bus/pci/devices/0000\:00\:1f.2/host1/
total 0
drwxr-xr-x 2 root root 0 Feb 1 13:11 power
drwxr-xr-x 3 root root 0 Feb 1 2011 scsi_host
lrwxrwxrwx 1 root root 0 Feb 1 2011 subsystem -> ../../../../bus/scsi
drwxr-xr-x 4 root root 0 Feb 1 2011 target1:0:0
-rw-r--r-- 1 root root 4096 Feb 1 2011 uevent
# ls -l /sys/bus/pci/devices/0000\:00\:1f.2/host1/target1\:0\:0/1\:0\:0\:0/driver
lrwxrwxrwx 1 root root 0 Feb 1 13:09 /sys/bus/pci/devices/0000:00:1f.2/host1/target1:0:0/1:0:0:0/driver -> ../../../../../../bus/scsi/drivers/sr
2. ata_generic. Here ata_generic driver is compiled in and handles all
ATA controllers. It successfully takes over AHCI controller (in
compatibility mode), PATA controller and IDER controller. Though, if
IDE Redirection is enabled in management console (kernel can see
devices attached to IDER controller), ATA devices may be named in not
the order you expect, so 'root=' kernel parameter should be adjust
correspondingly (or udev from initramfs should be used). To take over
any device this driver requires 'all-generic-ide' option set at kernel
command line:
ata_generic.all_generic_ide=1
or
ata-generic.all-generic-ide=1
Here is some info about such system config:
# ls -l /sys/bus/pci/devices/*/driver
..
lrwxrwxrwx 1 root root 0 Feb 1 14:20 /sys/bus/pci/devices/0000:00:03.2/driver -> ../../../bus/pci/drivers/ata_generic
..
lrwxrwxrwx 1 root root 0 Feb 1 14:20 /sys/bus/pci/devices/0000:00:1f.2/driver -> ../../../bus/pci/drivers/ata_generic
..
# lspci -nn | grep IDE
00:03.2 IDE interface [0101]: Intel Corporation Mobile PM965/GM965 PT IDER Controller [8086:2a06] (rev 0c)
00:1f.2 IDE interface [0101]: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA IDE Controller [8086:2828] (rev 03)
# ls -l /sys/bus/pci/devices/0000\:00\:03.2/
..
lrwxrwxrwx 1 root root 0 Feb 1 14:20 driver -> ../../../bus/pci/drivers/ata_generic
..
drwxr-xr-x 6 root root 0 Feb 1 2011 host0
drwxr-xr-x 4 root root 0 Feb 1 2011 host1
..
# readlink -f /sys/class/block/sda/device
/sys/devices/pci0000:00/0000:00:03.2/host0/target0:0:0/0:0:0:0
# ls -l /sys/bus/pci/devices/0000\:00\:1f.2/host2/
total 0
drwxr-xr-x 2 root root 0 Feb 1 14:23 power
drwxr-xr-x 3 root root 0 Feb 1 2011 scsi_host
lrwxrwxrwx 1 root root 0 Feb 1 2011 subsystem -> ../../../../bus/scsi
drwxr-xr-x 4 root root 0 Feb 1 2011 target2:0:0
-rw-r--r-- 1 root root 4096 Feb 1 2011 uevent
# ls -l /sys/bus/pci/devices/0000:00:1f.2/host2/target2:0:0/2:0:0:0/driver
lrwxrwxrwx 1 root root 0 Feb 1 14:23 /sys/bus/pci/devices/0000:00:1f.2/host2/target2:0:0/2:0:0:0/driver -> ../../../../../../bus/scsi/drivers/sd
# ls -l /sys/bus/pci/devices/0000:00:1f.2/host3/
total 0
drwxr-xr-x 2 root root 0 Feb 1 14:24 power
drwxr-xr-x 3 root root 0 Feb 1 2011 scsi_host
lrwxrwxrwx 1 root root 0 Feb 1 2011 subsystem -> ../../../../bus/scsi
drwxr-xr-x 4 root root 0 Feb 1 2011 target3:0:0
-rw-r--r-- 1 root root 4096 Feb 1 2011 uevent
# ls -l /sys/bus/pci/devices/0000:00:1f.2/host3/target3:0:0/3:0:0:0/driver
lrwxrwxrwx 1 root root 0 Feb 1 14:24 /sys/bus/pci/devices/0000:00:1f.2/host3/target3:0:0/3:0:0:0/driver -> ../../../../../../bus/scsi/drivers/sr
# ls -l /sys/class/block/sd*
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/sda -> ../../devices/pci0000:00/0000:00:03.2/host0/target0:0:0/0:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/sdb -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/sdb1 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb/sdb1
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/sdb2 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb/sdb2
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/sdb3 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb/sdb3
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/sdb4 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb/sdb4
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/sdb5 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb/sdb5
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/sdb6 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb/sdb6
3. ide_pci_generic. Here ide_pci_generic driver is compiled in and
handles all ATA controllers. This driver represents old IDE subsystem,
and noticeable difference from new ATA subsystem (libata) is that it
names devices as /dev/hd* instead of /dev/sd*. As well as ata_generic
it successfully takes over all AHCI, PATA and IDER controllers. Device
names here are also different from all what was before, so, 'root='
kernel parameter should be adjusted. To take over any device this
driver requires 'all-generic-ide' option set at kernel command line:
ide-pci-generic.all-generic-ide
or
ide-pci-generic.all-generic-ide
Here is some info about such system config:
# ls -l /sys/bus/pci/devices/*/driver
..
lrwxrwxrwx 1 root root 0 Feb 1 14:49 /sys/bus/pci/devices/0000:00:03.2/driver -> ../../../bus/pci/drivers/PCI_IDE
..
lrwxrwxrwx 1 root root 0 Feb 1 14:49 /sys/bus/pci/devices/0000:00:1f.2/driver -> ../../../bus/pci/drivers/PCI_IDE
..
# ls -l /sys/bus/pci/devices/0000:00:03.2/
total 0
..
lrwxrwxrwx 1 root root 0 Feb 1 14:49 driver -> ../../../bus/pci/drivers/PCI_IDE
..
drwxr-xr-x 6 root root 0 Feb 1 2011 ide0
drwxr-xr-x 4 root root 0 Feb 1 2011 ide1
..
# ls -l /sys/bus/pci/devices/0000:00:03.2/ide0/
total 0
drwxr-xr-x 3 root root 0 Feb 1 2011 0.0
drwxr-xr-x 5 root root 0 Feb 1 2011 0.1
drwxr-xr-x 3 root root 0 Feb 1 2011 ide_port
drwxr-xr-x 2 root root 0 Feb 1 14:49 power
-rw-r--r-- 1 root root 4096 Feb 1 2011 uevent
# ls -l /sys/bus/pci/devices/0000:00:03.2/ide0/0.0/
(no 'driver' symlink - module required for floppy to work was not compiled (what module is needed?))
# ls -l /sys/bus/pci/devices/0000:00:03.2/ide0/0.1/
..
lrwxrwxrwx 1 root root 0 Feb 1 14:50 driver -> ../../../../../bus/ide/drivers/ide-cdrom
..
# ls -l /sys/bus/pci/devices/0000:00:1f.2/
..
lrwxrwxrwx 1 root root 0 Feb 1 14:49 driver -> ../../../bus/pci/drivers/PCI_IDE
..
drwxr-xr-x 5 root root 0 Feb 1 2011 ide2
drwxr-xr-x 5 root root 0 Feb 1 2011 ide3
..
# ls -l /sys/bus/pci/devices/0000:00:1f.2/ide2/
total 0
drwxr-xr-x 5 root root 0 Feb 1 2011 2.0
drwxr-xr-x 3 root root 0 Feb 1 2011 ide_port
drwxr-xr-x 2 root root 0 Feb 1 14:51 power
-rw-r--r-- 1 root root 4096 Feb 1 2011 uevent
# ls -l /sys/bus/pci/devices/0000:00:1f.2/ide2/2.0/
..
lrwxrwxrwx 1 root root 0 Feb 1 14:51 driver -> ../../../../../bus/ide/drivers/ide-gd
..
# ls -l /sys/bus/pci/devices/0000:00:1f.2/ide2/2.0/block/
total 0
drwxr-xr-x 12 root root 0 Feb 1 2011 hde
# ls -l /sys/bus/pci/devices/0000:00:1f.2/ide3/
total 0
drwxr-xr-x 5 root root 0 Feb 1 2011 3.0
drwxr-xr-x 3 root root 0 Feb 1 2011 ide_port
drwxr-xr-x 2 root root 0 Feb 1 14:51 power
-rw-r--r-- 1 root root 4096 Feb 1 2011 uevent
# ls -l /sys/bus/pci/devices/0000:00:1f.2/ide3/3.0/
..
lrwxrwxrwx 1 root root 0 Feb 1 14:52 driver -> ../../../../../bus/ide/drivers/ide-cdrom
..
# ls -l /sys/bus/pci/devices/0000:00:1f.2/ide3/3.0/block/
total 0
drwxr-xr-x 6 root root 0 Feb 1 2011 hdg
# ls -l /sys/class/block/hd*
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/hdb -> ../../devices/pci0000:00/0000:00:03.2/ide0/0.1/block/hdb
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/hde -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/hde1 -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde/hde1
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/hde2 -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde/hde2
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/hde3 -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde/hde3
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/hde4 -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde/hde4
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/hde5 -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde/hde5
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/hde6 -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde/hde6
lrwxrwxrwx 1 root root 0 Feb 1 2011 /sys/class/block/hdg -> ../../devices/pci0000:00/0000:00:1f.2/ide3/3.0/block/hdg
# ls -l /sys/bus/pci/drivers/PCI_IDE/module
lrwxrwxrwx 1 root root 0 Feb 1 15:01 /sys/bus/pci/drivers/PCI_IDE/module -> ../../../../module/ide_pci_generic
Hence, to boot linux from cdrom drive on IDER controller, we just need to
have compiled into the kernel either ata_generic or ide_pci_generic
driver. I test this with gentoo livecd and SystemRescueCd. First one has
ide_pci_generic driver compiled in and should be booted like
gentoo ide-pci-generic.all-generic-ide
second one has ata_generic driver compiled and should be booted like
<..system rescue cd boot options..> ata-generic.all-generic-ide=1
PS. This was tested on motherboard with Intel PM965 chipset (Centrino
vPro) with AMT 2.6 (or 2.5?) and kernel 2.6.36.
