Play around with Linux partitions

Last time I split the partition, so this time I will use the split partition!

Setting items ① Mount (2) Capacity limit for each user ③ Authority setting ④ Symbolic link setting at mount point

① Mount

Mount / dev / sda5 of the extended area that was divided last time in the following order.

  1. Edit / etc / fstab 2, Execute mount command on / dev / sda5
[root@localhost ~]# fdisk -l
 ・ ・ ・
 ・ ・ ・ Abbreviation
 ・ ・ ・
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     2099199     1048576   83  Linux
/dev/sda2         2099200     8390655     3145728    5  Extended
 / dev / sda5 2101248 4198399 1048576 83 Linux ← This

Check the current mount status. Execute the mount command as it is.

[root@localhost ~]# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
 ・ ・ ・
 ・ ・ ・ Abbreviation
 ・ ・ ・
 # / Dev / sda5 is missing
/dev/sda1 on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota)

1. Edit / etc / fstab

Make a backup first.

[root@localhost ~]# cp -p /etc/fstab /etc/fstab.bak
[root@localhost ~]# vi /etc/fstab

Added / dev / sda5 / home2 ext4 defaults 1 2 to the end of the line.

** Meaning of each item ** / dev / sda5 ・ ・ ・ Device file name to mount / home2 ・ ・ ・ Directory to connect with / dev / sda5 (absolute path) ext4 ・ ・ ・ File system type (reiserfs, xfs, etc.) defaults ・ ・ ・ Mount options are default 1 ... Whether backup is required (1: required, 2: unnecessary) 2 ... Order when checking with the fsck command



 /etc/fstab
 Created by anaconda on Sat Jun  1 17:13:31 2019

 Accessible filesystems, by reference, are maintained under '/dev/disk'
 See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

UUID=8ac075e3-1124-4bb6-bef7-a6811bf8b870 /                       xfs     defaults        0 0
/swapfile none swap defaults 0 0
 / dev / sda5 / home2 ext4 defaults 1 2 ← Add here

Since the mount destination directory / home2 was not created, create it and execute the mount command.

[root@localhost ~]# mkdir /home2
[root@localhost ~]# mount -a
mount: special device /dev/sda5 does not exist

that? It is said that there is no such thing. But it comes out with fdisk -l, so check the device file.

[root@localhost ~]# ls /dev/sda*
/dev/sda  /dev/sda1

There is no device file. After restarting, I thought that the device file would not be created and restarted.

[root@localhost ~]# systemctl reboot
grub rescue>
 e!

The OS has stopped booting ... When I tried to start the PC, I got impatient with "unknown file system" Not fixed. Upon further investigation, I found an article in the same situation as myself. Apparently, boot the OS via USB or DVD and reinstall the OS. I'm using a virtual machine this time, so I decided to vagrant up again.

$ vagrant status
Current machine states:
 Erase this
default                   poweroff (virtualbox)

The VM is powered off. To restart the VM, simply run `vagrant up`
 $ vagrant destroy ← Delete
    default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Destroying VM and associated drives...
7$ vagrant status
Current machine states:
 Deleted
default                   not created (virtualbox)
 $ vagrant up ← up again

I went back to the beginning ... Next time I want to complete ① to ④! !!

Recommended Posts

Play around with Linux partitions
Play around with Linux partitions ~ Continued ~
Play with Prophet
Play around with the pythonista3 ui module
Play with PyTorch
Play with 2016-Python
Play with CentOS 8
Play with Pyramid
Play with Fathom
Linux (Lubuntu) with OneMix3S
Play with Othello (Reversi)
linux with termux app
Linux --Look around copy_mm ()
Let's play with 4D 4th
Let's play with Amedas data-Part 1
Play with reinforcement learning with MuZero
Play with push notifications with imap4lib
Self-build linux kernel with clang
Let's play with Amedas data-Part 4
Play with Jupyter Notebook (IPython Notebook)
[Python] Play with Discord's Webhook.
Linux fastest learning with AWS
Play RocketChat with API / Python
Use WDC-433SU2M2 with Manjaro Linux
Let's play with Amedas data-Part 3
Let's play with Amedas data-Part 2
Play with ASE MD module
Play with A3RT (Text Suggest)
Prepare pipenv environment with amazon Linux 2
Play with numerical calculation of magnetohydrodynamics
[Linux] OS recovery with restore command
Play with Poincare series and SymPy
Let's play with Excel with Python [Beginner]
Play with Pythonista UI implementation [Action implementation]
Play with PIR sensor module [DSUN-PIR]
Spark play with WSL anaconda jupyter (2)
Play with Turtle on Google Colab
Play with demons because it's setsubun
Draw with PyOpenGL. Confusion around VBO
Using Kali Linux Gui with WSL2
Operate Linux Network Namespace with Go