LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-16-2014, 07:34 PM   #1
pople
LQ Newbie
 
Registered: Nov 2013
Distribution: Gentoo
Posts: 26

Rep: Reputation: Disabled
faster way to recursively change ownership of large filesystem


Looking around I have not seen this addressed for large file systems. I have a 1Tb drive that I mount using the following script:

Code:
#!/bin/bash

md1=$(blkid -U d81fc8e7-7081-4872-9667-8fd5da730df2)

cryptsetup luksOpen $md1 d1 && echo "d1 Unlocked"

mount /dev/mapper/d1 /home/bob/d1/

chown bob:bob /home/bob/d1/ -R && echo "Done Mounting d1"
My question is can the process be sped up by using a command other than chown to recursively change ownership of the mount point? I don't think I can make an addition to my fstab because the /dev/sd* varies between boots. Hence the blkid command. Anyone have any thoughts on this? I have skimmed through the mount man pages but have not found anything that works yet. I have also tried the uid option.
 
Old 09-16-2014, 07:48 PM   #2
pople
LQ Newbie
 
Registered: Nov 2013
Distribution: Gentoo
Posts: 26

Original Poster
Rep: Reputation: Disabled
Well I had a face palm moment when I realized that /dev/mapper/d1 was what I was actually mounting. I have amendend the script and made a corresponding fstab entry.

Code:
#!/bin/bash

md1=$(blkid -U d81fc8e7-7081-4872-9667-8fd5da730df2)

cryptsetup luksOpen $md1 d1 && echo "d1 Unlocked"

su bob -c "mount /dev/mapper/d1"
/etc/fstab looks like:

Code:
/dev/mapper/d1         /home/bob/d1 auto                user            0 0
now it is FAST!!!!
 
Old 09-21-2014, 09:26 AM   #3
Kirsty_GueF
LQ Newbie
 
Registered: Sep 2014
Location: Cannon Ball
Distribution: Kirsty_GueF
Posts: 1

Rep: Reputation: Disabled
Где учиться дист

Куда поступить на заочное отделение?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Which method is faster for erasing large drives Dave_P Linux - General 5 09-30-2011 03:19 PM
Faster rsync -aH for large directories? pilotmm Linux - Software 15 07-04-2011 07:43 PM
Recursively fixing FTP ownership on a Plesk managed web server bahbahthelamb Linux - Server 0 03-15-2010 10:47 PM
NFS filesystem ownership inheritance. Gangrif Linux - Security 1 07-28-2009 03:15 PM
Changing ownership of mounted filesystem jhansman Red Hat 4 09-11-2003 12:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration