Defragmenting a file system
You can either defragment a file system now or you can schedule a defragment job for a file system.
To defragment a file system
- To defragment a file system, enter the following:
Storage> fs defrag now fs_name time [defrag_level]
fs_name
Specifies the name of the file system that you want to defragment.
Note:
The specified file system must be online before attempting to defragment the file system.
time
Specifies the maximum time to run. The defragmentation options are processed until defragmentation is complete, or until the time limit expires. The time value should be larger than one minute.
Potential time value output and what the values mean:
10M - indicates 10 minutes
1H20M - indicates 1 hour and 20 minutes
Infinite - indicates the defragmentation process continues to run until the defragmentation process is done completely.
There is no limit time.
defrag_level
Specifies the defragmentation level such as
dir,extent, orall.
To schedule a defragment job for a file system.
- Create a defrag schedule job for a file system that reoccurs once a week:
Storage> fs defrag schedule create sched_name sched_duration \ minute [hour] [day_of_the_month] \ [month] [day_of_the_week]
sched_name
Specifies the the name of the schedule.
sched_duration
Specifies the duration of the defragmenatation job.
minute
Specifies the minute (0-59).
hour
Specifies the hour (0-23).
day_of_the_month
Specifies the day of the month (1-31).
month
Specifies the month of the year (1-12).
day_of_the_week
Specifies the day of the week (0-6 with 0=Sunday).
For example:
Create a defrag schedule called
schedule1that runs at 11:00 pm every Saturday for a duration of 2 hours.Storage> fs defrag schedule create schedule1 2 0 23 * * 6
The number 2 after schedule1 is the duration of how long the defrag schedule will run. 0 indicates minutes and 23 is the hour for which the defrag schedule will run.
- Show the defrag schedule details:
Storage> fs defrag schedule show sched_name
For example:
- Start the defrag schedule job for a file system:
Storage> fs defrag schedule start fs_name sched_name
- List the scheduled defrag job status for a file system:
Storage> fs defrag schedule list fs_name