# Mounting hard disk as RW from Live CD



## dojit (Dec 6, 2014)

Hi everyone,

Our FreeBSD Citrix Netscaler VM running under Hyper-V is failing to boot, it returns 
	
	



```
ACPI autoload failed - no such file or directory
```
 and restarts itself continually in a loop.

Correct me if I'm wrong here, but for this error, I need to edit device.hints in /boot and add 
	
	



```
hint.acpi.0.disabled=1 # disable ACPI (i386 only)
```

I've downloaded FreeBSD-9.3-RELEASE-amd64-disc1.iso.  Booted into single user mode to the # prompt.

I perform a 
	
	



```
mount /mnt /dev/ada0s1
cd mnt
ls
```
 I can see the hard drive file system.

But when I try and do a `ed` or `vi device.hints`, the system returns 
	
	



```
read only file system
```

How can I mount the offline hard disk as RW to edit device.hints?

Or is there another way to resolve this issue?

Thank you


----------



## wblock@ (Dec 6, 2014)

Booted from an install disk and the hard disk is still read-only?  That happens when it is marked dirty.  Make a full backup.  Or two.  Then, if fsck(8) can repair the filesystem, it can be mounted read/write.

There is still the question of what caused the problem, possibly a failing drive.  And a lot of things depend on ACPI, so disabling it is probably not a cure.


----------



## dojit (Dec 6, 2014)

wblock@ said:


> Booted from an install disk and the hard disk is still read-only?  That happens when it is marked dirty.  Make a full backup.  Or two.  Then, if fsck(8) can repair the filesystem, it can be mounted read/write.
> 
> There is still the question of what caused the problem, possibly a failing drive.  And a lot of things depend on ACPI, so disabling it is probably not a cure.



Thank you for the reply - I've checked the Logical Drive array where the virtual disk is located and there are no errors. I'll try fsck and see if it produces any issues.


----------



## AntumDeluge (Dec 22, 2014)

I'm sorry if I'm hijacking a thread, but I'm having a similar problem. I can't seem to mount a partition at all from the live media. It says that the filesystem is dirty. But, then again I don't remember if I tried to mount it read-only. I'll have to try that later. Is there any way to run fsck on an unmounted filesystem?

*--- Edit ---*

Okay, I am able to mount it read-only, but I cannot use fsck on it. Is that because I am using boot-only media (FreeBSD-10.1-RELEASE-amd64-mini-memstick.img)?

```
# mount -o ro /dev/ada0p2 /mnt
WARNING: /mnt was not properly dismounted
# fsck /mnt
fsck: Could not determine filesystem type
# fsck -t ufs2 /mnt
fsck: exec fsck_ufs2 for /dev/ada0p2 in /sbin:/usr/sbin: No suck file or directory
```
*--- Edit ---*

Oh, I'm sorry. I was using the wrong filesystem type. It should have been `fsck -t ufs`.

My problem is solved, thank you:

```
# mount -o ro /dev/ada0p2 /mnt
# fsck -t ufs /mnt
# umount /mnt
# mount /dev/ada0p2 /mnt
```


----------



## SirDice (Dec 22, 2014)

You don't need to mount the filesystem to be able to fsck(8) it. You can do it directly on the disk/partition: `fsck /dev/ada0p2`.


----------



## dojit (Dec 22, 2014)

AntumDeluge said:


> I'm sorry if I'm hijacking a thread, but I'm having a similar problem. I can't seem to mount a partition at all from the live media. It says that the filesystem is dirty. But, then again I don't remember if I tried to mount it read-only. I'll have to try that later. Is there any way to run fsck on an unmounted filesystem?
> 
> To mount the filesystem I had to use an earlier version of FreeBSD (8.1) and choose the 'fix it' option as per:
> http://www.isysop.com/using-fixit-and-chroot-to-repair-a-non-booting-system/
> ...


----------

