LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-05-2017, 05:10 AM   #1
peter7089
Member
 
Registered: May 2016
Posts: 72

Rep: Reputation: Disabled
Unable to remount partition as read only


I am trying to remount partition as read only on Xubuntu from grub recovery console. The partition is mounted like this:
Code:
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
I am using this command to remount it as read only:
Code:
mount -o remount,ro /dev/sda1
But when i check the mount points it still shows that the partition is still mounted as rw (read,write).

Why it doesn't want to remount it as read only?
 
Old 02-05-2017, 05:25 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,399

Rep: Reputation: 3048Reputation: 3048Reputation: 3048Reputation: 3048Reputation: 3048Reputation: 3048Reputation: 3048Reputation: 3048Reputation: 3048Reputation: 3048Reputation: 3048
You (as a user) can't remount the root as ro. Simple as that. Lots of reasons, but /var/logs is one that most can implicitly understand.
 
Old 02-05-2017, 06:11 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,223
Blog Entries: 9

Rep: Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617
Quote:
Originally Posted by peter7089 View Post
I am trying to remount partition as read only on Xubuntu from grub recovery console.
where exactly are you when you try that?
i don't think it's the grub console.
have you booted into recovery mode (text only, root prompt)?
 
Old 02-05-2017, 08:39 AM   #4
peter7089
Member
 
Registered: May 2016
Posts: 72

Original Poster
Rep: Reputation: Disabled
I should have said that i am trying this on Xubuntu virtual machine. I am trying to compact the .vdi disk but first i have to remount sda1 as read only and then run zerofree.
 
Old 02-05-2017, 11:34 AM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,018
Blog Entries: 5

Rep: Reputation: 2870Reputation: 2870Reputation: 2870Reputation: 2870Reputation: 2870Reputation: 2870Reputation: 2870Reputation: 2870Reputation: 2870Reputation: 2870Reputation: 2870
Quote:
Originally Posted by peter7089 View Post
I should have said that i am trying this on Xubuntu virtual machine. I am trying to compact the .vdi disk but first i have to remount sda1 as read only and then run zerofree.
As an alternative, boot the VM from a SystemRescueCD ISO and run zerofree from that.

See here: https://snippets.khromov.se/shrinkin...with-zerofree/

The link also uses an alternative runlevel 1 method which may prove useful if you don't want to boot from a separate ISO.
 
Old 02-05-2017, 12:27 PM   #6
peter7089
Member
 
Registered: May 2016
Posts: 72

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
As an alternative, boot the VM from a SystemRescueCD ISO and run zerofree from that.

See here: https://snippets.khromov.se/shrinkin...with-zerofree/

The link also uses an alternative runlevel 1 method which may prove useful if you don't want to boot from a separate ISO.
Thanks, i used SystemRescueCD.
 
1 members found this post helpful.
Old 02-06-2017, 12:50 AM   #7
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Quote:
Originally Posted by syg00 View Post
You (as a user) can't remount the root as ro. Simple as that. Lots of reasons, but /var/logs is one that most can implicitly understand.
>"You (as a user)..." [booted 'single', via grub menu choice of "recovery console"]
freaked me out momentarily, thinking 'user' meant NON-root, but it meant 'person vs boot_code'
>"/var/logs is [reason]" means: files in /var/log are 'open': try/see: fuser /

>OP: "...compact the .vdi [via] zerofree" Oh! COOL! I've wondered HowTo do this! web-search-words:
HOWTO: shrink|"Reduce the size of" a dynamic VDI file in VirtualBox
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Force read-only remount of / BeniBela2 Linux - General 22 07-31-2016 06:21 AM
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
Unable to read windows partition in Slack bongski55 Slackware 3 06-15-2003 06:59 AM
Unable To Re-Read The Partition Table? EMF9 Linux - General 13 12-08-2002 07:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:00 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration