[go: up one dir, main page]

0% found this document useful (0 votes)
21 views2 pages

02 Creating File Systems

This document discusses how to format, mount, and unmount Linux filesystems like ext4 and xfs. It covers using commands like mkfs, mount, tune2fs, and blkid. It also discusses configuring persistent mounts using UUIDs in /etc/fstab and customizing mount options.

Uploaded by

hiruzen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

02 Creating File Systems

This document discusses how to format, mount, and unmount Linux filesystems like ext4 and xfs. It covers using commands like mkfs, mount, tune2fs, and blkid. It also discusses configuring persistent mounts using UUIDs in /etc/fstab and customizing mount options.

Uploaded by

hiruzen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

####################################

Create, mount and unmount standard


Linux Filesystem
####################################

Formating ext4 filesystem


-------------------------

# mkfs.ext4 -L DATA /dev/sdb6


# tune2fs -L MYDATA -c 0 -i 0 /dev/sdb6
# dumpe2fs /dev/sdb6 | less

Formating xfs filesystem


------------------------
# mkfs.xfs -b size=1k -l size=10m /dev/sdb7 -f
# xfs_db -x /dev/sdb7
xfs_db> label DATA2
writing all SBs
new label = "DATA2"
xfs_db> label
label = "DATA2"
xfs_db> quit

Mount filesystem
-----------------

# mkdir -p /data/{mydata,data2}

# mount /dev/sdb6 /data/mydata/


# mount | grep mydata
/dev/sdb6 on /data/mydata type ext4 (rw,relatime,seclabel,data=ordered)

Remount with options


# mount -o remount,noexec /dev/sdb6 /data/mydata/
# mount | grep mydata
/dev/sdb6 on /data/mydata type ext4 (rw,noexec,relatime,seclabel,data=ordered)

Presistance Mount using UUID


----------------------------
Find the UUID
# blkid /dev/sdb6
/dev/sdb6: LABEL="MYDATA" UUID="af520c04-0b28-4b67-ac7a-cf986221a336" TYPE="ext4"

Edit /etc/fstab
UUID="af520c04-0b28-4b67-ac7a-cf986221a336" /data/mydata ext4 noexec 0 2

To verify everything is working


# mount -a

Mount Options
-------------
man page are very useful

Modify fstab file


UUID="af520c04-0b28-4b67-ac7a-cf986221a336" /data/mydata ext4 noatime,noexec
0 2
UUID="a7f0f069-1600-4437-ae75-75bb846f012d" /data/data2 xfs
noexec,noatime,uquota,gquota,gqnoenforce 0 0
Apply
# umount /data/data2/
# umount /data/mydata/
# mount -a
# mount | grep data
/dev/sdb6 on /data/mydata type ext4 (rw,noexec,noatime,seclabel,data=ordered)
/dev/sdb7 on /data/data2 type xfs
(rw,noexec,noatime,seclabel,attr2,inode64,usrquota,gqnoenforce)

You might also like