LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-06-2015, 05:13 AM   #1
BeniBela2
Member
 
Registered: Dec 2012
Posts: 52

Rep: Reputation: Disabled
Force read-only remount of /


I want to force a read-only remount of /, so I can make a full hard disk backup while continue working.

There is the command
Code:
mount -o ro,remount /
but it refuses to work because it is busy.

If I use
Code:
fuser -v -m /
to find and kill all processes using /, it does work. But it also kills the X server, and then I cannot browse the Internet anymore, which is even worse than a live CD.

So how can you remount / without killing anything?

It must be possible, because recently I had some hard drive corruption, and whenever it noticed them, it just remounted / as read-only as I want it to. Except that happened completely randomly
 
Old 06-06-2015, 05:44 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,474

Rep: Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453
You can't. Or more correctly you really don't want to do this.

What's more important - compromising your backup, or that browsing.
Do it from a liveCD.
 
Old 06-06-2015, 08:49 AM   #3
BeniBela2
Member
 
Registered: Dec 2012
Posts: 52

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
You can't. Or more correctly you really don't want to do this.
No, I think I want to do this.


Quote:
What's more important - compromising your backup, or that browsing.
Do it from a liveCD.
The internet. Always the internet

Usually I end up making no backup at all because it is such a hassle with the live cd
 
Old 06-06-2015, 09:16 AM   #4
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You can do backup using single user mode.

Do you want to backup the OS data or private files or the whole?
 
Old 06-06-2015, 09:44 AM   #5
BeniBela2
Member
 
Registered: Dec 2012
Posts: 52

Original Poster
Rep: Reputation: Disabled
I want a full backup of everything

Code:
 dd if=/dev/sda1 of=/dev/sdb2 bs=4096 conv=notrunc,noerror,sync
 
Old 06-06-2015, 04:12 PM   #6
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,823

Rep: Reputation: 429Reputation: 429Reputation: 429Reputation: 429Reputation: 429
Boot from a Live DVD.

A full backup will be much quicker if you use rsync.
This will avoid copying bits of empty disk or files which haven't changed since the last backup.
 
Old 06-06-2015, 04:45 PM   #7
BeniBela2
Member
 
Registered: Dec 2012
Posts: 52

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by JeremyBoden View Post
A full backup will be much quicker if you use rsync.
This will avoid copying bits of empty disk or files which haven't changed since the last backup.


But I want to be sure that every thing is there and exactly the same. Links, extended file attributes...

Also, I have set the append-only flag on most of my important files, and now I do not think rsync can modify them in the backup.
 
Old 06-06-2015, 07:40 PM   #8
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
"I can make a full hard disk backup while continue working"

From all the things you are describing, I am starting to wonder if not a simple mirrored raid 1 is more what you are asking about?
 
Old 06-07-2015, 01:21 AM   #9
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
If you want to use 'dd' the way you said then LiveCD is the one. You can use systemRescuecd or make you own one for your setup.
 
Old 06-08-2015, 07:59 AM   #10
BeniBela2
Member
 
Registered: Dec 2012
Posts: 52

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by joec@home View Post
From all the things you are describing, I am starting to wonder if not a simple mirrored raid 1 is more what you are asking about?
Perhaps

But it is a laptop, I do not think you can have a raid there

Quote:
Originally Posted by veerain View Post
If you want to use 'dd' the way you said then LiveCD is the one. You can use systemRescuecd or make you own one for your setup.
I am doing it with a live CD (backtrack)

But rebooting is very annoying. I do not want to do that anymore

Especially since I have needed the backup anyways so far.
 
Old 06-08-2015, 08:57 AM   #11
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Unless you have a read-only mounted filesystem your partition would be in flux of data change. So if you run ''dd' then the image may be in corrupted state. You can use LVM device snapshot to do the same without rebooting if you setup LVM. Also btrfs has snapshot features. And ZFS too has it.
 
Old 06-08-2015, 09:46 AM   #12
BeniBela2
Member
 
Registered: Dec 2012
Posts: 52

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by veerain View Post
Unless you have a read-only mounted filesystem your partition would be in flux of data change.

That is why I asked on how to remount it read only...

Quote:
Originally Posted by veerain View Post
So if you run ''dd' then the image may be in corrupted state. You can use LVM device snapshot to do the same without rebooting if you setup LVM.
Can I setup an LVM on the existing partition without deleting the files there?


Quote:
Originally Posted by veerain View Post
Also btrfs has snapshot features. And ZFS too has it.

I use ext3
 
Old 06-08-2015, 12:48 PM   #13
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Can I setup an LVM on the existing partition without deleting the files there?
No can't setup LVM on partition with data. Read the LVM HOWTO for more info(Web Search).
 
Old 06-08-2015, 01:34 PM   #14
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,823

Rep: Reputation: 429Reputation: 429Reputation: 429Reputation: 429Reputation: 429
If you change all partitions to read only, you won't be able to run anything.
You will also need to terminate anything that writes to a log file.

LVM is really of use for multiple disks shared by multiple users.
 
Old 07-24-2016, 08:25 AM   #15
BeniBela2
Member
 
Registered: Dec 2012
Posts: 52

Original Poster
Rep: Reputation: Disabled
Time to revisit this

Anyone has found a solution to do this, remounting without doing a reboot to a liveCD?

Because I accidentally spilled a water over my laptop. Now the keyboard is stuck. Which means I cannot reboot anymore. GRUB's timeout stops, because some key is stuck, and neither Enter nor Ctrl+X nor F10 work. Especially I cannot start from a LiveCD, because I had to press F12 to choose the device and that key is also broken.

I also have no recent backup, because the rebooting was already too annoying.

So now the only option is to remount it from during normal use.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Raspberry Pi remount rootfs read-only kzo81 Linux - Embedded & Single-board computer 2 09-05-2014 01:37 PM
remount read only filesystems 7hewh0re Linux - Newbie 1 01-24-2014 06:29 AM
remount read write alaios Linux - General 3 05-18-2011 05:34 AM
Remount root filesystem read-only zsolt_tuser Linux - General 11 04-27-2011 05:01 PM
Getting thrown into read-only mode - not able to remount dleangen Linux - General 19 06-07-2007 08:45 PM

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

All times are GMT -5. The time now is 07:44 AM.

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