Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_fs_mgm_lvm [2019/01/21 10:53] – wE andonovj | linux_fs_mgm_lvm [2020/09/11 07:25] (current) – andonovj | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======Create a File system====== | + | =====Overview===== |
+ | File system | ||
+ | |||
+ | ====File system Management==== | ||
+ | File systems can be two kinds: | ||
+ | |||
+ | * Non-Journal File systems: ext2. | ||
+ | These file systems do not keep logs and can have corrupted data if there has been a power outage. The pluses of these file systems is their fast read/write speed. | ||
+ | * Journal File systems: ext3,ext4. | ||
+ | |||
+ | These file systems keep a log (journal) which slows them down, however it is up to the System Admin to decide if he/she is willing to sacrifice speed for consistency. | ||
Line 345: | Line 355: | ||
=====Add the disk to a volume group===== | =====Add the disk to a volume group===== | ||
- | Firstly, we have to check, which is the volume group which we want to extend> Please BE SURE, you know the volume group of the logical volume on which your File system is mounted and which you wish to extend. This can be seen from the " | + | Firstly, we have to partition the new bare metal :) |
+ | |||
+ | <sxh bash> | ||
+ | [root@matar ~]# fdisk /dev/sde | ||
+ | Welcome to fdisk (util-linux 2.23.2). | ||
+ | |||
+ | Changes will remain in memory only, until you decide to write them. | ||
+ | Be careful before using the write command. | ||
+ | |||
+ | Device does not contain a recognized partition table | ||
+ | Building a new DOS disklabel with disk identifier 0xdabe3889. | ||
+ | |||
+ | Command (m for help): n | ||
+ | Partition type: | ||
+ | | ||
+ | | ||
+ | Select (default p): p | ||
+ | Partition number (1-4, default 1): | ||
+ | First sector (2048-20971519, | ||
+ | Using default value 2048 | ||
+ | Last sector, +sectors or +size{K, | ||
+ | Using default value 20971519 | ||
+ | Partition 1 of type Linux and of size 10 GiB is set | ||
+ | |||
+ | Command (m for help): w | ||
+ | The partition table has been altered! | ||
+ | |||
+ | Calling ioctl() to re-read partition table. | ||
+ | Syncing disks. | ||
+ | [root@matar ~]# | ||
+ | </ | ||
+ | |||
+ | |||
+ | Then, we have to check, which is the volume group which we want to extend> Please BE SURE, you know the volume group of the logical volume on which your File system is mounted and which you wish to extend. This can be seen from the " | ||
<sxh bash> | <sxh bash> | ||
Line 436: | Line 479: | ||
Phew! That was something :) This is how you extend filesystem in Linux, to have more space for useless data :) Cheers :) | Phew! That was something :) This is how you extend filesystem in Linux, to have more space for useless data :) Cheers :) | ||
+ | |||
+ | |||
+ | ======Refresh the SCSI-Disk information====== | ||
+ | If you add a disk on VM, it MIGHT not be there IMMEDIATELY so you have two options: | ||
+ | |||
+ | * Restart the server | ||
+ | * Rescan the disks | ||
+ | |||
+ | So since restarting of the server isn't always possible to restart the server. Luckly we have a command for that: | ||
+ | |||
+ | < | ||
+ | echo "- - -" > / | ||
+ | echo "- - -" > / | ||
+ | echo "- - -" > / | ||
+ | echo "- - -" > / | ||
+ | </ | ||
+ | |||
+ | After that the disk should be available using fdisk: | ||
+ | |||
+ | <sxh bash> | ||
+ | Disk /dev/sdp: 107.3 GB, 107374182400 bytes | ||
+ | 255 heads, 63 sectors/ | ||
+ | Units = cylinders of 16065 * 512 = 8225280 bytes | ||
+ | |||
+ | Disk /dev/sdp doesn' | ||
+ | </ |