smartos教程四:安装SmartOS

前言

Smartos是一个开源的Unix系列操作系统,从Solaris10分支出来,由Joyent公司开发。Smartos拥有非常强大而简便的虚拟化功能,非常适合用来做云计算。这篇文章我们就介绍一下怎么安装SmartOS。

制作启动盘

因为SmartsOS启动的时候会将整个操作系统读取到内存,启动完毕后不在从启动盘读取文件,因此我们可以使用U盘、SD卡等移动存储设备制作启动盘。

现在我以Linux下将SmartOS安装到U盘为例进行讲解,其他操作系统可以参考官方文档:https://wiki.smartos.org/display/DOC/Creating+a+SmartOS+Bootable+USB+Key

首先去官网下载想要安装的版本。

下载地址:https://wiki.smartos.org/display/DOC/Download+SmartOS

下载完毕后解压

cd /tmp
wget https://us-east.manta.joyent.com/Joyent_Dev/public/SmartOS/smartos-latest-USB.img.bz2
tar xvjpf smartos-latest-USB.img.bz2

将U盘插入,查找U盘的设备路径,我的U盘路径为/dev/sdb

$ sudo fdisk -l
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: 0x7ecb51e2

Device Boot Start End Blocks Id System
/dev/sda1 * 1 52 409600 27 Unknown
Partition 1 does not end on cylinder boundary.
/dev/sda2 52 18959 151870464 7 HPFS/NTFS
/dev/sda3 18959 30432 92158977 f W95 Ext'd (LBA)
/dev/sda4 30432 60802 243944472 7 HPFS/NTFS
/dev/sda5 18959 30432 92158976 83 Linux

Disk /dev/sdb: 7958 MB, 7958691840 bytes
255 heads, 63 sectors/track, 967 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

Device Boot Start End Blocks Id System
/dev/sdb1 1 243 1951866 c W95 FAT32 (LBA)

将镜像刷到U盘中

cd /tmp
sudo dd if=smartos-latest-USB.img of=/dev/sdb bs=1024

设置分区激活状态

$ sudo fdisk /dev/sdb

Command (m for help): p

255 heads, 63 sectors/track, 967 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

Device Boot Start End Blocks Id System
/dev/sdb1 1 243 1951866 c W95 FAT32 (LBA)

Command (m for help): a
Partition number (1-4): 1

Command (m for help): p

255 heads, 63 sectors/track, 967 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

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 243 1951866 c W95 FAT32 (LBA)

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: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

安装与启动系统

将制作好的U盘插入物理机,并且让物理机通过U盘启动,从默认的GRUB选项就能进入安装界面了。

安装界面是命令行交互的界面,根据提示依次配置好主网卡、IP、网关、磁盘冗余级别、时间服务器、密码即可,没有什么复杂的配置。

配置完后需要重新启动,现在只能通过U盘来启动,依然从默认的GRUB选项进入,这时候操作系统会去检查写入磁盘的文件,发现已经安装了系统,就不会再次安装了,而是读取文件进行配置,然后进入系统。

回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据