btrfsへのインストール時にサブボリュームにインストールするように
This commit is contained in:
parent
172018bf2a
commit
873a8614ad
1 changed files with 20 additions and 9 deletions
|
@ -1,23 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
loadkeys jp106
|
loadkeys jp106
|
||||||
#キーボードを日本語配列へ変更
|
#キーボードを日本語配列へ変更
|
||||||
printf "Please enter your username\n\n"
|
printf "\nPlease enter your username\n"
|
||||||
read -r home_username
|
read -r home_username
|
||||||
printf "Please enter your password\n\n"
|
printf "Please enter your password\n"
|
||||||
read -sr home_password
|
read -sr home_password
|
||||||
printf "Please enter Hostname\n\n"
|
printf "Please enter Hostname\n"
|
||||||
read -r hostname1
|
read -r hostname1
|
||||||
|
|
||||||
fdisk -l
|
fdisk -l
|
||||||
#ディスク一覧表示
|
#ディスク一覧表示
|
||||||
printf "\nWhat disk do you want to install to? example:/dev/sda \n\n"
|
printf "\nWhat disk do you want to install to? example:/dev/sda \n"
|
||||||
read -r installdisk
|
read -r installdisk
|
||||||
printf "\nChoose the file system to use for your root partition. (ext4, btrfs)\n\n"
|
printf "Choose the file system to use for your root partition. (ext4, btrfs)\n"
|
||||||
read -r filesystem
|
read -r filesystem
|
||||||
printf "\nChoose the kernel you want to use. (linux, zen, lts)\n\n"
|
printf "Choose the kernel you want to use. (linux, zen, lts)\n"
|
||||||
read -r kernel
|
read -r kernel
|
||||||
#インストールするディスクを入力
|
#インストールするディスクを入力
|
||||||
printf "%s (%s) is selected as the disk to install. Are you sure you want to perform the partition operation? (yes or no) \n\n" "$installdisk" "$filesystem"
|
printf "%s (%s) is selected as the disk to install. Are you sure you want to perform the partition operation? (yes or no) \n" "$installdisk" "$filesystem"
|
||||||
read -r check1
|
read -r check1
|
||||||
#インストールするディスクを確認
|
#インストールするディスクを確認
|
||||||
if [ "$check1" == "yes" ]; then
|
if [ "$check1" == "yes" ]; then
|
||||||
|
@ -40,13 +40,24 @@ if [ "$check1" == "yes" ]; then
|
||||||
mkfs.vfat -F32 "$d1"
|
mkfs.vfat -F32 "$d1"
|
||||||
if [ "$filesystem" == "ext4" ]; then
|
if [ "$filesystem" == "ext4" ]; then
|
||||||
mkfs.ext4 "$d2"
|
mkfs.ext4 "$d2"
|
||||||
|
mount "$d2" /mnt
|
||||||
elif [ "$filesystem" == "btrfs" ]; then
|
elif [ "$filesystem" == "btrfs" ]; then
|
||||||
mkfs.btrfs -f "$d2"
|
mkfs.btrfs -f "$d2"
|
||||||
|
mount "$d2" /mnt
|
||||||
|
btrfs subvolume create /mnt/@
|
||||||
|
btrfs subvolume create /mnt/@home
|
||||||
|
btrfs subvolume create /mnt/@swap
|
||||||
|
umount "$d2"
|
||||||
|
mount "$d2" /mnt -o subvol=@
|
||||||
|
mkdir /mnt/home
|
||||||
|
mkdir /mnt/swap
|
||||||
|
mount "$d2" /mnt/home -o subvol=@home
|
||||||
|
mount "$d2" /mnt/swap -o subvol=@swap
|
||||||
else
|
else
|
||||||
mkfs.ext4 "$d2"
|
mkfs.ext4 "$d2"
|
||||||
|
mount "$d2" /mnt
|
||||||
fi
|
fi
|
||||||
#フォーマット
|
#フォーマット
|
||||||
mount "$d2" /mnt
|
|
||||||
mkdir /mnt/boot
|
mkdir /mnt/boot
|
||||||
mount "$d1" /mnt/boot
|
mount "$d1" /mnt/boot
|
||||||
#マウント
|
#マウント
|
||||||
|
|
Loading…
Reference in a new issue