LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to remount partition as read only (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-remount-partition-as-read-only-4175599030/)

peter7089 02-05-2017 05:10 AM

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?

syg00 02-05-2017 05:25 AM

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.

ondoho 02-05-2017 06:11 AM

Quote:

Originally Posted by peter7089 (Post 5665388)
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)?

peter7089 02-05-2017 08:39 AM

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.

hydrurga 02-05-2017 11:34 AM

Quote:

Originally Posted by peter7089 (Post 5665455)
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.

peter7089 02-05-2017 12:27 PM

Quote:

Originally Posted by hydrurga (Post 5665509)
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.

Jjanel 02-06-2017 12:50 AM

Quote:

Originally Posted by syg00 (Post 5665394)
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


All times are GMT -5. The time now is 08:15 AM.