Does mounting external media read only make ejecting the media unnessesary? If so, how to mount all external media read only?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I am building hardware solutions for video debriefing purposes, where users will connect and remove cameras and/or SD cards to computers all the time.
I am working with Raspberry pi's (Raspbian) for media playback.
A fast media server for video related calculations and media conversion (Ubuntu) and a fast NAS for storage.
I like to overcome the need for the user to ejecting media before removing the hardware, because I know from experience nobody will take the effort anyway. I have no need for my system to write data onto the users devices. So I was wondering if there is a way to mount all external devices always read-only in order to prevent any data corruption on unsafe removal.



I am fairly new to Linux and programming. The software I am writing is mainly Python, but I am looking for a more system wide approach for this problem so the user will not experience any







share|improve this question




















  • I know what ‘video debriefing’ means wink
    – user2497
    Feb 17 at 21:29














up vote
1
down vote

favorite












I am building hardware solutions for video debriefing purposes, where users will connect and remove cameras and/or SD cards to computers all the time.
I am working with Raspberry pi's (Raspbian) for media playback.
A fast media server for video related calculations and media conversion (Ubuntu) and a fast NAS for storage.
I like to overcome the need for the user to ejecting media before removing the hardware, because I know from experience nobody will take the effort anyway. I have no need for my system to write data onto the users devices. So I was wondering if there is a way to mount all external devices always read-only in order to prevent any data corruption on unsafe removal.



I am fairly new to Linux and programming. The software I am writing is mainly Python, but I am looking for a more system wide approach for this problem so the user will not experience any







share|improve this question




















  • I know what ‘video debriefing’ means wink
    – user2497
    Feb 17 at 21:29












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am building hardware solutions for video debriefing purposes, where users will connect and remove cameras and/or SD cards to computers all the time.
I am working with Raspberry pi's (Raspbian) for media playback.
A fast media server for video related calculations and media conversion (Ubuntu) and a fast NAS for storage.
I like to overcome the need for the user to ejecting media before removing the hardware, because I know from experience nobody will take the effort anyway. I have no need for my system to write data onto the users devices. So I was wondering if there is a way to mount all external devices always read-only in order to prevent any data corruption on unsafe removal.



I am fairly new to Linux and programming. The software I am writing is mainly Python, but I am looking for a more system wide approach for this problem so the user will not experience any







share|improve this question












I am building hardware solutions for video debriefing purposes, where users will connect and remove cameras and/or SD cards to computers all the time.
I am working with Raspberry pi's (Raspbian) for media playback.
A fast media server for video related calculations and media conversion (Ubuntu) and a fast NAS for storage.
I like to overcome the need for the user to ejecting media before removing the hardware, because I know from experience nobody will take the effort anyway. I have no need for my system to write data onto the users devices. So I was wondering if there is a way to mount all external devices always read-only in order to prevent any data corruption on unsafe removal.



I am fairly new to Linux and programming. The software I am writing is mainly Python, but I am looking for a more system wide approach for this problem so the user will not experience any









share|improve this question











share|improve this question




share|improve this question










asked Feb 17 at 13:52









Willem de Groot

61




61











  • I know what ‘video debriefing’ means wink
    – user2497
    Feb 17 at 21:29
















  • I know what ‘video debriefing’ means wink
    – user2497
    Feb 17 at 21:29















I know what ‘video debriefing’ means wink
– user2497
Feb 17 at 21:29




I know what ‘video debriefing’ means wink
– user2497
Feb 17 at 21:29










1 Answer
1






active

oldest

votes

















up vote
1
down vote













It's always recommended to umount properly any media , a file can still be opened for example



You can force media to mount read only with mount command options dedicated to options



mount -o ro /dev/media /example/path


you can use udev rules to force this option to any external media ... see this post to know how to How can I create a udev rule to mount a USB drive read only?






share|improve this answer




















  • Thanks for your quick response! Do you know if mounting read only really means the data on the mounted drive is not touched in any way? or can a file still become corrupt if its opened while a the drive is removed?
    – Willem de Groot
    Feb 17 at 14:50










  • risk is nearly zero ...
    – francois P
    Feb 17 at 14:57






  • 1




    Data on the external media should stay untouched. But the running system can become unstable after that, especially if you're disconnecting a (spinning) disk.
    – Satō Katsura
    Feb 17 at 15:01











  • @SatōKatsura No it can’t. Never happens. And besides rpi up to revision 2 can’t source enough current to drive a magnetic disk. GNU/Linux is famous for ignoring conditions that would make a sane operating system panic (...and so is Linus Torvalds, but that’s off-topic)
    – user2497
    Feb 17 at 21:27











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424800%2fdoes-mounting-external-media-read-only-make-ejecting-the-media-unnessesary-if-s%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













It's always recommended to umount properly any media , a file can still be opened for example



You can force media to mount read only with mount command options dedicated to options



mount -o ro /dev/media /example/path


you can use udev rules to force this option to any external media ... see this post to know how to How can I create a udev rule to mount a USB drive read only?






share|improve this answer




















  • Thanks for your quick response! Do you know if mounting read only really means the data on the mounted drive is not touched in any way? or can a file still become corrupt if its opened while a the drive is removed?
    – Willem de Groot
    Feb 17 at 14:50










  • risk is nearly zero ...
    – francois P
    Feb 17 at 14:57






  • 1




    Data on the external media should stay untouched. But the running system can become unstable after that, especially if you're disconnecting a (spinning) disk.
    – Satō Katsura
    Feb 17 at 15:01











  • @SatōKatsura No it can’t. Never happens. And besides rpi up to revision 2 can’t source enough current to drive a magnetic disk. GNU/Linux is famous for ignoring conditions that would make a sane operating system panic (...and so is Linus Torvalds, but that’s off-topic)
    – user2497
    Feb 17 at 21:27















up vote
1
down vote













It's always recommended to umount properly any media , a file can still be opened for example



You can force media to mount read only with mount command options dedicated to options



mount -o ro /dev/media /example/path


you can use udev rules to force this option to any external media ... see this post to know how to How can I create a udev rule to mount a USB drive read only?






share|improve this answer




















  • Thanks for your quick response! Do you know if mounting read only really means the data on the mounted drive is not touched in any way? or can a file still become corrupt if its opened while a the drive is removed?
    – Willem de Groot
    Feb 17 at 14:50










  • risk is nearly zero ...
    – francois P
    Feb 17 at 14:57






  • 1




    Data on the external media should stay untouched. But the running system can become unstable after that, especially if you're disconnecting a (spinning) disk.
    – Satō Katsura
    Feb 17 at 15:01











  • @SatōKatsura No it can’t. Never happens. And besides rpi up to revision 2 can’t source enough current to drive a magnetic disk. GNU/Linux is famous for ignoring conditions that would make a sane operating system panic (...and so is Linus Torvalds, but that’s off-topic)
    – user2497
    Feb 17 at 21:27













up vote
1
down vote










up vote
1
down vote









It's always recommended to umount properly any media , a file can still be opened for example



You can force media to mount read only with mount command options dedicated to options



mount -o ro /dev/media /example/path


you can use udev rules to force this option to any external media ... see this post to know how to How can I create a udev rule to mount a USB drive read only?






share|improve this answer












It's always recommended to umount properly any media , a file can still be opened for example



You can force media to mount read only with mount command options dedicated to options



mount -o ro /dev/media /example/path


you can use udev rules to force this option to any external media ... see this post to know how to How can I create a udev rule to mount a USB drive read only?







share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 17 at 13:59









francois P

914114




914114











  • Thanks for your quick response! Do you know if mounting read only really means the data on the mounted drive is not touched in any way? or can a file still become corrupt if its opened while a the drive is removed?
    – Willem de Groot
    Feb 17 at 14:50










  • risk is nearly zero ...
    – francois P
    Feb 17 at 14:57






  • 1




    Data on the external media should stay untouched. But the running system can become unstable after that, especially if you're disconnecting a (spinning) disk.
    – Satō Katsura
    Feb 17 at 15:01











  • @SatōKatsura No it can’t. Never happens. And besides rpi up to revision 2 can’t source enough current to drive a magnetic disk. GNU/Linux is famous for ignoring conditions that would make a sane operating system panic (...and so is Linus Torvalds, but that’s off-topic)
    – user2497
    Feb 17 at 21:27

















  • Thanks for your quick response! Do you know if mounting read only really means the data on the mounted drive is not touched in any way? or can a file still become corrupt if its opened while a the drive is removed?
    – Willem de Groot
    Feb 17 at 14:50










  • risk is nearly zero ...
    – francois P
    Feb 17 at 14:57






  • 1




    Data on the external media should stay untouched. But the running system can become unstable after that, especially if you're disconnecting a (spinning) disk.
    – Satō Katsura
    Feb 17 at 15:01











  • @SatōKatsura No it can’t. Never happens. And besides rpi up to revision 2 can’t source enough current to drive a magnetic disk. GNU/Linux is famous for ignoring conditions that would make a sane operating system panic (...and so is Linus Torvalds, but that’s off-topic)
    – user2497
    Feb 17 at 21:27
















Thanks for your quick response! Do you know if mounting read only really means the data on the mounted drive is not touched in any way? or can a file still become corrupt if its opened while a the drive is removed?
– Willem de Groot
Feb 17 at 14:50




Thanks for your quick response! Do you know if mounting read only really means the data on the mounted drive is not touched in any way? or can a file still become corrupt if its opened while a the drive is removed?
– Willem de Groot
Feb 17 at 14:50












risk is nearly zero ...
– francois P
Feb 17 at 14:57




risk is nearly zero ...
– francois P
Feb 17 at 14:57




1




1




Data on the external media should stay untouched. But the running system can become unstable after that, especially if you're disconnecting a (spinning) disk.
– Satō Katsura
Feb 17 at 15:01





Data on the external media should stay untouched. But the running system can become unstable after that, especially if you're disconnecting a (spinning) disk.
– Satō Katsura
Feb 17 at 15:01













@SatōKatsura No it can’t. Never happens. And besides rpi up to revision 2 can’t source enough current to drive a magnetic disk. GNU/Linux is famous for ignoring conditions that would make a sane operating system panic (...and so is Linus Torvalds, but that’s off-topic)
– user2497
Feb 17 at 21:27





@SatōKatsura No it can’t. Never happens. And besides rpi up to revision 2 can’t source enough current to drive a magnetic disk. GNU/Linux is famous for ignoring conditions that would make a sane operating system panic (...and so is Linus Torvalds, but that’s off-topic)
– user2497
Feb 17 at 21:27













 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424800%2fdoes-mounting-external-media-read-only-make-ejecting-the-media-unnessesary-if-s%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?