While working on installing fedora to a diskless system using iscsi root and boot, my system would not boot. I needed a way to access the system in chroot so I could reinstall grub with the proper iscsi boot config. Everything discussed here is Fedora 16 64bit. I am using an EMC VNXe 3100 SAN. For this demonstration, I do not have chap enabled so it is not discussed here.
Boot the Fedora 16 Live CD USB
- Boot Fedora 16 Live USB. I had some problems getting mine to boot so see blog entry http://ispman.blogspot.com/2012/02/boot-fedora-16-64-bit-live-boot-from.html
- Open a terminal window and su
- Edit /etc/iscsi/initiatorname.iscsi and put in the iqn your machine is going to initiate iscsi as. In my case: InitiatorName=iqn.1986-03.com.ibm:06LEJE8.linux Note: The initiator name also needs programmed in your SAN to allow connections from the IQN.
- Reload iscsi:
- Setup your ethernet card to have an IP on the SAN network:
- Add the network card you are going to use for iscsi to the iscsi database:
New interface eth0 added
- Add the iscsi target to your isci database using iscsiadm: iscsiadm -m node -T
-p -o new
Starting iscsid:
New iSCSI node [tcp:[hw=,ip=,net_if=,iscsi_if=default] 172.16.10.18,3260,-1 iqn.1992-05.com.emc:ap001140005820000-10-vnxe] added
- Now log into the iscsi target: iscsiadm -m node -T
-p -l
# iscsiadm -m node -T iqn.1992-05.com.emc:ap001140005820000-10-vnxe -p 172.16.10.18 -l
Logging in to [iface: default, target: iqn.1992-05.com.emc:apm00114005820000-10-vnxe, portal: {172.16.10.18,3260]
Login to [iface: default, target: iqn.1992-05.com.emc:apm00114005820000-10-vnxe, portal: {172.16.10.18,3260] successful
- Ensure the session is up and running
# iscsiadm -m session -P 3
- Using dmesg, find what device your iscsi drive was attached to. In my case it was sdb
- I used LVM when I installed to the iscsi target before so I have to bring up the lv's
#fdisk -l /dev/sdb
- Use lvs to find the VG name
#lvs
- Make the lv active
#vgchange -a y VolGroup
- Make your temporary mountpoint
#mkdir /mnt/sysimage
- Mount the root partition to sysimage. For me, lvs told me the name was lv_root, then mount the rest
#mount /dev/VolGroup/lv_root /mnt/sysimage
#mount -t tmpfs none /mnt/sysimage/tmp
#mount -t tmpfs none /mnt/sysimage/var/lock
#mount -t tmpfs none /mnt/sysimage/var/lib/iscsi
#mount --bind /dev /mnt/sysimage/dev
#mount -t proc none /mnt/sysimage/proc
- Mount the boot partition of the drive which for me was sdb2
#mount /dev/sdb2 /mnt/sysimage/boot
- Begin the chroot
#chroot /mnt/sysimage
#source /etc/profile
No comments:
Post a Comment