Read-only file system

Discussions related to using VirtualBox on Windows hosts.
Post Reply
olymacfoogal
Posts: 3
Joined: 1. Aug 2010, 13:46
Primary OS: MS Windows Vista
VBox Version: OSE Debian
Guest OSses: Ubuntu 9.04

Read-only file system

Post by olymacfoogal »

Hi all,

I've broken my Ubuntu 9.04 virtual machine. I opened disk manager in vista (host) and right-clicked on my only drive and selected shrink volume. (I wanted to set up a dual-boot) I cancelled out of this after it had checked current disk space and opened my ubuntu virtual machine to delete some files to create space. However I could not remove anything! Even as root. I got the " cannot remove" "read-only file system" which i reckon means that vista has taken over ownership of my virtual machine hard drive.

When i boot the virtual machine now i get a root maintenance shell. I cannot remove any files. Cannot connect to network nor can I access a shared folder i created. If I cannot fix the hard-drive I would like to be able to copy some of my data either onto a shared folder in vista or on to a server.

Any ideas?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Read-only file system

Post by Sasquatch »

When you get a read-only file system, the reason is always given, like a manual fsck is needed, or the drive is set to be mounted as read-only.

If Vista broke it in any way, you are responsible for it because you cancelled a disk operation that has the risk of data corruption when cancelled. Always create backups when you are going to execute such tasks. Even if you don't, you should make regular backups anyway.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Read-only file system

Post by Perryg »

Look at the file attribute of the VMs VDI file in the Windows file manager. If it is set to read only change it. If it does not let you then open a command window (prompt) as admin and drill to the directory with the VMs VDI file and type attrib -r <files name>.
olymacfoogal
Posts: 3
Joined: 1. Aug 2010, 13:46
Primary OS: MS Windows Vista
VBox Version: OSE Debian
Guest OSses: Ubuntu 9.04

Re: Read-only file system

Post by olymacfoogal »

It is not set to read only:
Perryg wrote:Look at the file attribute of the VMs VDI file in the Windows file manager. If it is set to read only change it. If it does not let you then open a command window (prompt) as admin and drill to the directory with the VMs VDI file and type attrib -r <files name>.
There was no other reason given when I used: rm -rf <anyfile> in the VM.
Sasquatch wrote:When you get a read-only file system, the reason is always given, like a manual fsck is needed, or the drive is set to be mounted as read-only.

If Vista broke it in any way, you are responsible for it because you cancelled a disk operation that has the risk of data corruption when cancelled. Always create backups when you are going to execute such tasks. Even if you don't, you should make regular backups anyway.
Not that its relevent but I back up once a week or there abouts so I will only be losing a weeks work or so but if I can recover it that would be great. I had no idea I was cancelling a disk operation...

Another piece of info is that the vdi file used to be 89 Gigs but now it's only 11Gigs... My actual pysical hardrive has not changed in size so the data is all still there.

Thanks for the help guys.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Read-only file system

Post by Sasquatch »

If it's such a big difference, you should be lucky that the Guest OS actually wants to boot and VB doesn't give an error about wrong header or something. It sounds like the file is heavily corrupted due to the massive change in size.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
olymacfoogal
Posts: 3
Joined: 1. Aug 2010, 13:46
Primary OS: MS Windows Vista
VBox Version: OSE Debian
Guest OSses: Ubuntu 9.04

Re: Read-only file system

Post by olymacfoogal »

Indeed.

Anyone have any ideas on the following solutions:

1. How to connect this vbox machine using root to the network?

2. How to remove the 89 gigs from my windows harddrive? ( deleting the vdi file will remove only 11gigs)
gab
Posts: 1
Joined: 18. Jan 2013, 09:03

Re: Read-only file system

Post by gab »

VIRTUAL BOX USED TO BOOT EXISTING RAW LINUX PARTITION SPREAD/INSTALLED ON TWO HARDDRIVES

I have windows 7 and I have Linux (dual booting), which is installed across 2 drives across 3 partitions. AIM: I predominately use windows most of the time so I wanted to be able to boot into Linux while in windows 7

Follow the STEPS below:

STEP A) Install virtual box first ON WINDOWS

From windows command prompt do below

STEP B) C:\Program Files\Oracle\VirtualBox>VBoxManage.exe internalcommands listpartition s -rawdisk \.\PhysicalDrive0

Number Type StartCHS EndCHS Size (MiB) Start (Sect)

1 0x07 0 /32 /33 191 /89 /26 1500 2048

2 0x07 191 /89 /27 1023/254/63 123637 3074048

5 0x83 1023/254/63 1023/254/63 30468 256284672 (linux partition on 1st hardrive)

6 0x82 1023/254/63 1023/254/63 7904 318685184 (linux swap on 1st hardrive)

4 0x84 1023/254/63 1023/254/63 8192 334872576

STEP C) C:\Program Files\Oracle\VirtualBox>VBoxManage.exe internalcommands createrawvmdk -filename X:\VirtualBox\RedHat-Ent-6.vmdk -rawdisk \.\PhysicalDrive0 -partitions 5,6

STEP D) C:\Program Files\Oracle\VirtualBox>VBoxManage.exe internalcommands listpartition s -rawdisk \.\PhysicalDrive1

Number Type StartCHS EndCHS Size (MiB) Start (Sect)

1 0x07 0 /1 /1 191 /254/63 1506 63

2 0x07 192 /0 /1 1023/254/63 870404 3084480

3 0x07 1023/254/63 1023/254/63 14001 1785672945

5 0x83 1023/254/63 1023/254/63 55000 1814351872 (linux partition on 2nd hardrive)

STEP E) C:\Program Files\Oracle\VirtualBox>VBoxManage.exe internalcommands createrawvmdk -filename X:\VirtualBox\RedHat-Ent-6.vmdk -rawdisk \.\PhysicalDrive0 -partitions 5

STEP F) create sharedfolder in windows. I created a folder called named SharedFolder (dont ask me why)

STEP G) make shared folder read/write in virtualbox to enable soft symbolic links to be created

C:\Program Files\Oracle\VirtualBox> VBoxManage setextradata RedHat6 VBoxInternal2/SharedFoldersEnableSymlinksCreate/SharedFolder 1

Hope this helps someone else. Good luck
share|edit|flag
buchnick7
Posts: 1
Joined: 5. Feb 2016, 12:19

Re: Read-only file system

Post by buchnick7 »

all you need is Import Appliance (install via ovf file). this will setup all your prerequisites and give the needed permissions to your vm.
Post Reply