Difference between revisions of "Mount and fsck"

From Biowikifarm Metawiki
Jump to: navigation, search
(Created page with "Some commands useful for mounting (mount), unmounting (umount) and file checking (fsck). 1. Permanent mounts in sudo nano /etc/fstab #after editing check with (else reboot...")
 
 
(3 intermediate revisions by the same user not shown)
Line 10: Line 10:
  
 
3. for other partitions use
 
3. for other partitions use
  sudo fuser -km /mnt/storage; sudo umount mnt/storage; sudo fsck /dev/xvdb1
+
  sudo service mysql stop; sudo service nginx stop; sudo service apache2 stop;
  sudo fuser -km /mnt/dump; sudo umount mnt/dump; sudo fsck /dev/xvdc1
+
sudo service 4store stop; sudo service php5-fpm stop; sudo service fedora stop;
 +
  sudo fuser -km /mnt/storage; sudo umount /mnt/storage; sudo fsck /dev/xvdb1
 +
  sudo fuser -km /mnt/dump; sudo umount /mnt/dump; sudo fsck /dev/xvdc1
 +
 
 +
4. Content of fstab as of 27.05.14
 +
<small>
 +
# /etc/fstab: static file system information.
 +
# Use 'blkid' to print the universally unique identifier for a
 +
# device; this may be used with UUID= as a more robust way to name devices
 +
# that works even if disks are added and removed. See fstab(5).
 +
#
 +
# added gh, 2014-05-25: OUTPUT OF: sudo ls -l /dev/disk/by-uuid
 +
# 3682291c-fcd1-46e5-aed8-3aa7c62be2fb -> ../../xvda1
 +
# 34b772ab-0277-49a3-bc56-9eae597ea0ec -> ../../xvdb1
 +
# 2ef1acf0-a437-4f83-bf75-ac8477a1df63 -> ../../xvdc1
 +
#
 +
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
 +
proc            /proc          proc    defaults        0      0
 +
# / was on /dev/xvda1 during installation
 +
UUID=3682291c-fcd1-46e5-aed8-3aa7c62be2fb /              ext3    barrier=0,errors=remount-ro 0      1
 +
## swap was on /dev/xvda5 during installation
 +
## UUID=e582e254-d32e-4ced-9d39-df5e5224b71c none swap sw  0 0
 +
/dev/xvdd      /media/cdrom0  udf,iso9660 user,noauto  0  0
 +
# OLD NON-UUID version:
 +
# /dev/xvdb1                              /mnt/storage ext4 barrier=0,rw,noatime,errors=remount-ro 0 0
 +
UUID=34b772ab-0277-49a3-bc56-9eae597ea0ec /mnt/storage ext4 barrier=0,rw,noatime,errors=remount-ro 0 0
 +
# OLD NON-UUID version:
 +
# /dev/xvdc1                              /mnt/dump ext4  barrier=0,rw,noatime,errors=remount-ro  0 0
 +
UUID=2ef1acf0-a437-4f83-bf75-ac8477a1df63 /mnt/dump ext4  barrier=0,rw,noatime,errors=remount-ro  0 0
 +
#
 +
##only for migration purposes
 +
##/dev/xvde1  /mnt/storage2  ext4 barrier=0,rw,noatime,errors=remount-ro 0 0
 +
##/dev/xvdf1  /mnt/dump2    ext3 barrier=0,rw,noatime,errors=remount-ro 0 0
 +
</small>

Latest revision as of 17:28, 28 May 2014

Some commands useful for mounting (mount), unmounting (umount) and file checking (fsck).

1. Permanent mounts in

sudo nano /etc/fstab
#after editing check with (else reboot may fail):
mount -fav # = fake/all in fstab/verbose

2. if root partition is corrupt, use:

shutdown -rF now

3. for other partitions use

sudo service mysql stop; sudo service nginx stop; sudo service apache2 stop;
sudo service 4store stop; sudo service php5-fpm stop; sudo service fedora stop;
 sudo fuser -km /mnt/storage; sudo umount /mnt/storage; sudo fsck /dev/xvdb1
sudo fuser -km /mnt/dump; sudo umount /mnt/dump; sudo fsck /dev/xvdc1

4. Content of fstab as of 27.05.14

# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# added gh, 2014-05-25: OUTPUT OF: sudo ls -l /dev/disk/by-uuid
# 3682291c-fcd1-46e5-aed8-3aa7c62be2fb -> ../../xvda1
# 34b772ab-0277-49a3-bc56-9eae597ea0ec -> ../../xvdb1
# 2ef1acf0-a437-4f83-bf75-ac8477a1df63 -> ../../xvdc1 
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# / was on /dev/xvda1 during installation
UUID=3682291c-fcd1-46e5-aed8-3aa7c62be2fb /               ext3    barrier=0,errors=remount-ro 0       1
## swap was on /dev/xvda5 during installation
## UUID=e582e254-d32e-4ced-9d39-df5e5224b71c none swap sw  0 0
/dev/xvdd       /media/cdrom0   udf,iso9660 user,noauto  0  0
# OLD NON-UUID version:
# /dev/xvdb1                              /mnt/storage ext4 barrier=0,rw,noatime,errors=remount-ro 0 0
UUID=34b772ab-0277-49a3-bc56-9eae597ea0ec /mnt/storage ext4 barrier=0,rw,noatime,errors=remount-ro 0 0
# OLD NON-UUID version:
# /dev/xvdc1                              /mnt/dump ext4  barrier=0,rw,noatime,errors=remount-ro  0 0
UUID=2ef1acf0-a437-4f83-bf75-ac8477a1df63 /mnt/dump ext4  barrier=0,rw,noatime,errors=remount-ro  0 0
#
##only for migration purposes
##/dev/xvde1  /mnt/storage2  ext4 barrier=0,rw,noatime,errors=remount-ro 0 0
##/dev/xvdf1  /mnt/dump2     ext3 barrier=0,rw,noatime,errors=remount-ro 0 0