記事

アンマウントできないシステムパーティションの容量を拡張する

Ubuntuで最初は8GBで切ったけどそのあとパーテーション拡張したい場合

root@ubuntu:/home/thr3a# parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resize                                                           
resize      resizepart  
(parted) resize
resize      resizepart  
(parted) p
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 19.3GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  15.0GB  15.0GB  primary  ext4         boot

(parted) resizepart 1
Warning: Partition /dev/sda1 is being used. Are you sure you want to continue?
Yes/No? Yes                                                               
End?  [15.0GB]? 17GB                                                      
(parted) q                                                                
Information: You may need to update /etc/fstab.                           

root@ubuntu:/home/thr3a# resize2fs /dev/sda1
resize2fs 1.42.9 (4-Feb-2014)
Filesystem at /dev/sda1 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/sda1 is now 4150134 blocks long.