Mount a filesystem by UUID in Linux
Anwser:
Assumed you know the UUID of your harddisks, you want to mount it for use, try the following method:
# mount -U 9f95f559-9986-4dfc-8661-849bb54ed5a5 /mnt/data1
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Mount a filesystem by UUID in Linux
Anwser:
Assumed you know the UUID of your harddisks, you want to mount it for use, try the following method:
# mount -U 9f95f559-9986-4dfc-8661-849bb54ed5a5 /mnt/data1
How to list all the UUID of my hard disks
Answer:
To list all the UUID of my hard disks, you can use the blkid command.
# sudo blkid
/dev/sda1: UUID="9f95f559-9986-4dfc-8661-849bb54ed5a5" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="0fe4eedc-65dd-4b46-85c9-11795f2cdc57"
How to check Linux I/O scheduler
Answer:
Assume your hard drive is sda, you can check the current Linux I/O scheduler at
# cat /sys/block/sda/queue/scheduler
noop anticipatory deadline [cfq]
Above shows that you are currently using the cfq scheduler.
How to safety delete a file in Linux?
Answer:
Sometimes, you might have a very sensitive file that don't want others to recover, you might want to use the following command
shred -u password.txt
The command will overwrite the password.txt repeatedly, in order to make it harder for data recovery, and finally delete it.
How to check which directory used up most of the disk space?
Answer:
For example, assume you are at /usr/local, you want to generate a report on disk space usage on all the sub directories, you can use the following command
# du -k * | sort -n
.
.
14564 share/man/man3
14816 share/man
16624 share/perl/5.10.0
16628 share/perl
33060 share
It will give you a very clear and useful report.