1 | # /etc/init.d/iscsitarget stop |
1 2 3 | # tgtadm --lld iscsi --op delete --mode logicalunit --tid 1 --lun 1 # tgtadm --lld iscsi --op delete --mode target --tid=1 # service tgtd stop |
1 | # partprobe |
1 2 3 4 5 6 7 8 9 | # fdisk -l /dev/sda Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00018613 Device Boot Start End Blocks Id System /dev/sda1 1 13 104391 83 Linux /dev/sda2 14 3661 29302560 83 Linux |
1 2 3 4 5 6 7 8 9 10 11 | # grub grub> find /boot/grub/stage1 (or find /grub/stage1 if you get Error 15: File not found) (hd0,0) #Grub is already installed on the first partition of first disk grub> root (hd0,0) #Tell grub where / (root partition) can be found grub> setup (hd0) #Tell grub where to install the bootload (will overwrite the MBR) grub> quit |
1 2 3 4 5 | # mount /dev/sda1 /boot # cd /boot # grub grub> find /grub/stage1 (hd0, 0) #grub is already installed on the first partition of the disk |
1 | # mount /dev/sda1 /mnt |
1 2 3 4 | root (hd0,0) kernel /boot/vmlinuz-2.6.16.60-0.42.5-default root=/dev/sda2 vga=0x314 load_ramdisk=1 init=linuxrc resume=/dev/sda2 splash=silent showopts initrd /boot/initrd-2.6.16.60-0.42.5-default |
1 | # umount /mnt |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | # fdisk /dev/sda Command (m for help): n #Tell fdisk to create a new partition Command action l logical (5 or over) p primary partition (1-4) p Partition Number (1-4): 3 First cylinder (3662-3916, default 3662): Enter Using default value 3662 Last cylinder, +cylinders or +size{K,M,G} (3662-3916, default 3916): +2048M Command (m for help): t # change partition type Partition number (1-6): 3 # select partition we want to change Hex code (type L to list codes): 82 # 82 stand for swap Changed system type of partition 2 to 82 (Linux swap / Solaris) Command (m for help): p # print partition table […] Device Start End Blocks Id System /dev/sda1 1 13 104391 83 Linux /dev/sda2 14 3661 29302560 83 Linux /dev/sda3 3662 3916 2048287+ 82 Linux swap / Solaris Partition table entries are not in disk order Command (m for help): w # save the changes The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. |
1 | # mkswap /dev/sda3 |
1 2 3 | # mount /dev/sda2 /mnt # vi /mnt/etc/fstab /dev/sda3 none swap sw 0 0 |
1 | # reboot |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |