The number of cylinders for this disk is set to 4654.
There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): d Selected partition 1
Command (m for help): p
Disk /dev/sda: 4003 MB, 4003463168 bytes 84 heads, 20 sectors/track, 4654 cylinders Units = cylinders of 1680 * 512 = 860160 bytes
Device Boot Start End Blocks Id System
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-4654, default 1): Using default value 1 Last cylind[[email protected] pg]# mount -t ext3 /dev/sda1 /neter or size or sizeM or sizeK (1-4654, default 4654): Using default value 4654
Command (m for help): w The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: 設備或資源忙. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. [[email protected] pg]# partprobe /dev/sda [[email protected] pg]# ls /dev/sda1 /dev/sda1 -------------- [[email protected] pg]# mkfs.ext3 /dev/sda1
2、
掛載U盤,並把相關文件拷到U盤中 [[email protected] pg]# mount -t ext3 /dev/sda1 /net
d. ]# cat /net/boot/grub/grub.conf default=0 timeout=5 title RHEL5U5 usb linux for pg root (hd0,0) kernel /boot/vmlinuz-2.6.18-194.el5 ro root=/dev/sda1 initrd /boot/initrd-usb-2.6.18-194.img
e. 為了生成以下這些常用的命令,裝包 bash ls cp mv mount ifconfig fdisk mkfs.ext3
yum bash ls cp mv mount ifconfig fdisk mkfs.ext3 yum --installroot=/net -y install coreutils setup grubvim-enhanced vim-common gpm perl iptables openssh openssh-clients module-init-tools iputils grep awk sed procps tar bash gcc make rp-pppoe passwd libuser e2fsprogs util-linuxnet-tools SysVinit kernel pam
開始安裝GRUB程序 ]# chroot /net/ bash-3.2# ]# chroot /net/ bash-3.2# grub-install /dev/sda Probing devices to guess BIOS drives. This may take a long time. No suitable drive was found in the generated device map. 這個錯誤意味著需要去寫
bash-3.2# grub-install /dev/sda Could not find device for /dev/mapper/* Could not find device for /dev/mapper/* Could not find device for /dev/mapper/* Installation finished. No error reported. This is the contents of the device map /boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'.
(fd0) /dev/fd0 (hd0) /dev/sda
]# chroot /net/ bash-3.2# passwd root 修改密碼不成功,將導致 u盤系統啟動后,用root登錄不成功. Changing password for user root. passwd: Authentication token manipulation error 解決方法: vim /net/etc/passwd root:*:0:0:root:/root:/bin/bash root:x:0:0:root:/root:/bin/bash 這樣再把root密碼設置為你想要的!