Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[solved] How to generate file list of specific hard drive.

Featured Replies

Greetings all. I was wondering if there's a command that will generate a file list for a specific drive that I can save to a txt file. I have unfortunately suffered a parity drive failure, which in of itself wouldn't be too much of an issue as I had a warm spare ready to go. However, it appears that I have another hard drive that is throwing up massive errors and the parity rebuild averages at less that 1GB/Sec. As that would take about 3 weeks to rebuild it, as well as various freezups and other issues while it's running it's not feasible. So, it's mostly media stuff that I can redownload if that drive fails it's just a matter of a lot of work/time to replace not irreplacable stuff. I have a new drive being shipped to me, so I'm hoping my dying drive will last until it's installed and precleared. Then I can copy it's contents, swap it for the good drive and rebuild the parity drive properly.

 

Having said that, if it doesn't last and dies before then I was hoping to generate a list of what I'm going to lose before it happens if possible. Anyone know a command line that will take care of that? Cheers,

hlid.

"ls -R /mnt/disk1 > /mnt/user/share/list.txt"

 

Change the disk number and destination path as needed.

  • Author

Thank you kindly!

 

Edit: Worked perfectly, thanks again.

Here are some find commands, suitable for running in a cron table.

It creates cr\lf delimited files so you can load them in notepad.

 

after creating them you can move them to your flash for save keeping off the ramdrive or store them on the cache drive.

i.e. mv /var/log/filelist.disk3.txt /boot/log

 

This version uses the full path in the output.

root@unRAID: find /mnt/disk3 -type f -fprintf /var/log/filelist.disk3.txt "%h/%f\r\n"

 

Example:

root@unRAID: # head /var/log/filelist.disk3.txt

/mnt/disk3/disk3.gdbmsums

/mnt/disk3/Music/bin/check_scan.sh

/mnt/disk3/Music/bin/mkdirs.sh

/mnt/disk3/Music/bin/rsync.sh

/mnt/disk3/Music/bin/rsync_stereo.sh

/mnt/disk3/Music/bin/rsync_media.sh

/mnt/disk3/Music/bin/20_rsync_stereo_media

/mnt/disk3/Music/bin/mkbig_dirs.sh

 

This version deletes the source argument (/mnt/disk3) from the output and writes it as a dos.txt file.

 

Example:

root@unRAID: # find /mnt/disk3 -type f -fprintf /var/log/filelist.disk3.txt "%P\r\n"   

 

root@unRAID: # head /var/log/filelist.disk3.txt

disk3.gdbmsums

Music/bin/check_scan.sh

Music/bin/mkdirs.sh

Music/bin/rsync.sh

Music/bin/rsync_stereo.sh

Music/bin/rsync_media.sh

Music/bin/20_rsync_stereo_media

Music/bin/mkbig_dirs.sh

Music/bin/mk1000.sh

Music/tmp/MommasLittleHelper.mpg

 

To make it a unix delimited file take out the \r.

To make it suitable for piping into xargs change the \r\n to \0

 

These filelists are usefile for greping if they are all stored in a globable location

ie.

 

grep fileIWanToFind /var/log/filelist.disk*.txt

 

If you need the full ls output you can change it to

find /mnt/disk3 -type f -ls > /var/log/filelist.disk3.txt

 

Which is similar to ls -lR

Here are some find commands, suitable for running in a cron table.

It creates cr\lf delimited files so you can load them in notepad.

 

after creating them you can move them to your flash for save keeping off the ramdrive or store them on the cache drive.

i.e. mv /var/log/filelist.disk3.txt /boot/log

 

This version uses the full path in the output.

root@unRAID: find /mnt/disk3 -type f -fprintf /var/log/filelist.disk3.txt "%h/%f\r\n"

 

Example:

root@unRAID: # head /var/log/filelist.disk3.txt

/mnt/disk3/disk3.gdbmsums

/mnt/disk3/Music/bin/check_scan.sh

/mnt/disk3/Music/bin/mkdirs.sh

/mnt/disk3/Music/bin/rsync.sh

/mnt/disk3/Music/bin/rsync_stereo.sh

/mnt/disk3/Music/bin/rsync_media.sh

/mnt/disk3/Music/bin/20_rsync_stereo_media

/mnt/disk3/Music/bin/mkbig_dirs.sh

 

This version deletes the source argument (/mnt/disk3) from the output and writes it as a dos.txt file.

 

Example:

root@unRAID: # find /mnt/disk3 -type f -fprintf /var/log/filelist.disk3.txt "%P\r\n"   

 

root@unRAID: # head /var/log/filelist.disk3.txt

disk3.gdbmsums

Music/bin/check_scan.sh

Music/bin/mkdirs.sh

Music/bin/rsync.sh

Music/bin/rsync_stereo.sh

Music/bin/rsync_media.sh

Music/bin/20_rsync_stereo_media

Music/bin/mkbig_dirs.sh

Music/bin/mk1000.sh

Music/tmp/MommasLittleHelper.mpg

 

To make it a unix delimited file take out the \r.

To make it suitable for piping into xargs change the \r\n to \0

 

These filelists are usefile for greping if they are all stored in a globable location

ie.

 

grep fileIWanToFind /var/log/filelist.disk*.txt

 

If you need the full ls output you can change it to

find /mnt/disk3 -type f -ls > /var/log/filelist.disk3.txt

 

Which is similar to ls -lR

 

Wow, nice info Weebo, thanks! Saved for future reference 8)

 

I should add that I 'usually' create a filelist.txt file of very disk every night and put it in a filedb directory on each disk.

 

[ -d /mnt/disk3/filedb ] && mkdir -p /mnt/disk3/filedb

find /mnt/disk3 -type f -fprintf /mnt/disk3/filedb/disk3.filelist.txt "%h/%f\r\n"

 

this lets me do a quick grep across the whole array with

 

grep fileiwantofind /mnt/disk*/filedb/disk*.filelist.txt

 

or utilize the user share with

 

grep fileiwanttofind /mnt/user/filedb/disk*.filelist.txt

 

My preference has always been to have a filelist.txt in the root of each directory so I could do it simpler

 

grep fileiwantofind /mnt/disk*/filelist.txt

 

However that makes it harder to see all of the filelists in one user share, or archive offline.

I may set it up for symlinks in the future.

 

Point of having the filedb usershare is for other types of files such as md5sums  and gdbm files I use for rapid indexing.

  • Author

That's a wealth of info, thanks for that. *snipped and saved*

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.