LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 04:10 AM   #1
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 254

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, 04:25 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,253

Rep: Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160
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, 05:11 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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, 07:39 AM   #4
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 254

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, 10:34 AM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
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, 11:27 AM   #6
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 254

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-05-2017, 11:50 PM   #7
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 364Reputation: 364Reputation: 364Reputation: 364
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 05:21 AM
remount read only filesystems 7hewh0re Linux - Newbie 1 01-24-2014 05:29 AM
remount read write alaios Linux - General 3 05-18-2011 04:34 AM
Unable to read windows partition in Slack bongski55 Slackware 3 06-15-2003 05:59 AM
Unable To Re-Read The Partition Table? EMF9 Linux - General 13 12-08-2002 06:47 AM

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

All times are GMT -5. The time now is 10:49 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