LoginSignup
2
2

More than 5 years have passed since last update.

PRESEEDでbtrfsを設定する

Last updated at Posted at 2014-01-08

PRESEEDでbtrfsという構成を見かけないので実際のにubuntuにて確認。
- rootとhomeをサブボリュームで構成 ubuntu default
- 使用HDDは120GB SSD
- /bootはext4でカーネル数個分の容量を確保されればよしとする
- swapはだいたいメモリ量分を確保されればよしとする
- 残りをbtrfsへ

#======================================
# PARTMAN PARTITIONING SECTION START
#======================================
d-i partman/confirm_nooverwrite boolean true

# My Environment: ubuntu is /dev/sdd
d-i partman-auto/disk string /dev/sdd
d-i partman-auto/method string regular
d-i partman-auto/expert_recipe string           \
    boot-root ::                    \
          128 16 256 ext4               \
          $primary{ } $bootable{}       \
          method{ format } format{ }        \
          use_filesystem{ } filesystem{ ext4 }  \
          mountpoint{ /boot }           \
          .                     \
          100% 512 120% linux-swap          \
          $primary{ }               \
          method{ swap } format{ }      \
          .                     \
          65536 1024 -1 btrfs           \
          $primary{ }               \
          method{ format } format{ }        \
          use_filesystem{ } filesystem{ btrfs } \
          options/subvol{ @ }           \
          options/ssd{ ssd }            \
          mountpoint{ / }           \
          .
d-i partman-auto/choose_recipe select root
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select Finish partitioning and write changes to disk
d-i partman/confirm boolean true
#======================================
# PARTMAN PARTITIONING SECTION END
#======================================

上記構成でインストールした後、確認。結果は以下

# mount  grep sdd
/dev/sdd3 on / type btrfs (rw,ssd,subvol=@)
/dev/sdd1 on /boot type ext4 (rw)
/dev/sdd3 on /home type btrfs (rw,ssd,subvol=@home)

# fdisk /dev/sdd

Command (m for help): p

Disk /dev/sdd: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a8871

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048      249855      123904   83  Linux
/dev/sdd2          249856     8603647     4176896   82  Linux swap / Solaris
/dev/sdd3         8603648   234440703   112918528   83  Linux

Command (m for help): q

# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdd3       108G  1.1G  105G   2% /
udev            2.0G  4.0K  2.0G   1% /dev
tmpfs           787M  400K  787M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            2.0G     0  2.0G   0% /run/shm
cgroup          2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sdd1       114M   28M   80M  27% /boot
/dev/sdd3       108G  1.1G  105G   2% /home
# free
             total       used       free     shared    buffers     cached
Mem:       4029096     168080    3861016          0        728      57208
-/+ buffers/cache:     110144    3918952
Swap:      4176892          0    4176892
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2