Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_fs_mgm_lvm [2019/01/21 10:53] – wE andonovjlinux_fs_mgm_lvm [2020/09/11 07:25] (current) andonovj
Line 1: Line 1:
-======Create a File system======+=====Overview===== 
 +File system management on Linux is pretty easy once a person has experience and knowledge of what he is doing. 
 + 
 +====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 "df" command:+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: 
 +     primary (0 primary, 0 extended, 4 free) 
 +     extended 
 +Select (default p): p 
 +Partition number (1-4, default 1): 
 +First sector (2048-20971519, default 2048): 
 +Using default value 2048 
 +Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): 
 +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 ~]#  
 +</sxh> 
 + 
 + 
 +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 "df" command:
  
 <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:
 +
 +<Code:bash|Re-scan SCSIs>
 +echo "- - -" > /sys/class/scsi_host/host0/scan
 +echo "- - -" > /sys/class/scsi_host/host1/scan
 +echo "- - -" > /sys/class/scsi_host/host2/scan
 +echo "- - -" > /sys/class/scsi_host/host3/scan
 +</Code>
 +
 +After that the disk should be available using fdisk:
 +
 +<sxh bash>
 +Disk /dev/sdp: 107.3 GB, 107374182400 bytes
 +255 heads, 63 sectors/track, 13054 cylinders
 +Units = cylinders of 16065 * 512 = 8225280 bytes
 +
 +Disk /dev/sdp doesn't contain a valid partition table
 +</sxh>
  • linux_fs_mgm_lvm.1548068001.txt.gz
  • Last modified: 2019/10/18 20:04
  • (external edit)