LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Read-only file system after dd (https://www.linuxquestions.org/questions/linux-newbie-8/read-only-file-system-after-dd-520235/)

mmluv 01-17-2007 01:54 PM

Read-only file system after dd
 
Hi all-

I have a major issue. I have been using dd to duplicate server drives and have a copy on the second drive for backup. Just installed fedora 5 and CentOS 4.4 and have the following error:

After I run the following dd

"/bin/dd if=/dev/sda of=/dev/sdb bs=32768"

I get write error all over the place after a reboot. This is on my main drive /dev/sda and will work fine if the second drive /dev/sdb is disconnected.

": Read-only file system"


Any ideas?

kilgoretrout 01-17-2007 02:25 PM

Post your /etc/fstab file and the output of:

$ ls -l /mnt

with the sdb partition(s) you are having trouble with mounted.

mmluv 01-17-2007 02:46 PM

This is all before a reboot.....

[root@vsclient201 mmoghadas]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=SWAP-sda3 swap swap defaults 0 0
/dev/hdc /media/cdrom auto pamconsole,exec,noauto,managed 0 0
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0


[root@vsclient201 mmoghadas]# mount
/dev/sda2 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)


[root@vsclient201 mmoghadas]# ls -l /mnt/
total 0


Thanks for your help!

mmluv 01-17-2007 02:56 PM

Machine came up after the reboot... here's what I have...

[root@vsclient201 ~]# fdisk -l

Disk /dev/sda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 456 3558397+ 83 Linux
/dev/sda3 457 521 522112+ 82 Linux swap

Disk /dev/sdb: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 83 Linux
/dev/sdb2 14 456 3558397+ 83 Linux
/dev/sdb3 457 521 522112+ 82 Linux swap
[root@vsclient201 ~]#
[root@vsclient201 ~]#
[root@vsclient201 ~]#
[root@vsclient201 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 3.4G 901M 2.3G 28% /
[root@vsclient201 ~]#
[root@vsclient201 ~]# mount
/dev/sda2 on / type ext3 (rw)
none on /proc type proc (rw)
[root@vsclient201 ~]#
[root@vsclient201 ~]#
[root@vsclient201 ~]# touch xxx
touch: cannot touch `xxx': Read-only file system

kilgoretrout 01-17-2007 07:31 PM

Get the permissions on / with:

$ ls -l /

and post the output here. By way of example, here's mine:

Code:

$ ls -l /
total 100812
drwxr-xr-x    2 root root      2560 Jul 16  2006 bin/
drwxr-xr-x    3 root root      904 Jan 15 21:22 boot/
drwxr-xr-x  26 root root    15020 Jan 16 14:25 dev/
drwxr-xr-x  89 root root      7024 Jan 17 15:34 etc/
drwxr-xr-x    3 root root        72 May  5  2005 home/
drwxr-xr-x    2 root root        80 May  5  2005 initrd/
drwxr-xr-x  11 root root      3984 Jan 15 21:21 lib/
drwxr-xr-x  29 root root      696 Jan  6 12:59 mnt/
-rw-------    1 root root      110 May  6  2005 nohup.out
dr-xr-xr-x    9 root bin        256 Jan 16 03:50 opt/
-rw-r--r--    1 root root 103104512 Oct  9 02:29 p
dr-xr-xr-x  127 root root        0 Jan 15 15:20 proc/
drwx------  32 root root      1824 Jan 16 20:54 root/
drwxr-xr-x    2 root root      6224 Jan  7 00:09 sbin/
drwxr-xr-x  10 root root        0 Jan 15 15:20 sys/
drwxrwxrwt  16 root root      624 Jan 17 13:35 tmp/
dr-xr-xr-x  14 root root      384 Dec 29 02:36 usr/
drwxr-xr-x  21 root root      528 Jan 16 03:53 var/
-rw-r--r--    1 root root        0 May  5  2005 xorg.conf

Do you have any security daemon or service running capable of changing permissions on /? Also, if I understand correctly, the permission problem goes away if you take sdb out, right? That is very weird.
I'm wondering about your boot order in your bios. sda and sdb are exact clones of each other. I'm wondering if you may be booting off your sdb drive instead of your sda drive and not know it. This might happen if your bios is set to boot off of the drive recognized as "sdb" in linux first and then "sda" second. I think that may be what is going on. Check your bios setup for the boot order.

mmluv 01-17-2007 11:51 PM

I'm actually emulating the problem with a fresh install of CentOS on a vm session. Same problem when drives are duplicated vi dd.

Boot order is correct!



Here's the output for ls -l /

[root@localhost ~]# ls -l /
total 160
drwxr-xr-x 2 root root 4096 Jan 17 10:33 bin
drwxr-xr-x 2 root root 4096 Jan 10 05:32 boot
drwxr-xr-x 10 root root 5500 Jan 17 20:40 dev
drwxr-xr-x 61 root root 4096 Jan 17 11:45 etc
-rw-r--r-- 1 root root 0 Jan 17 11:45 halt
drwxr-xr-x 3 root root 4096 Jan 17 09:10 home
drwxr-xr-x 2 root root 4096 Feb 21 2005 initrd
drwxr-xr-x 11 root root 4096 Jan 17 10:33 lib
drwx------ 2 root root 16384 Jan 10 05:32 lost+found
drwxr-xr-x 4 root root 4096 Jan 17 11:22 media
drwxr-xr-x 2 root root 4096 Aug 13 03:46 misc
drwxr-xr-x 2 root root 4096 Feb 21 2005 mnt
drwxr-xr-x 2 root root 4096 Feb 21 2005 opt
dr-xr-xr-x 52 root root 0 Jan 17 12:33 proc
drwxr-x--- 3 root root 4096 Jan 10 13:42 root
drwxr-xr-x 2 root root 12288 Jan 17 10:33 sbin
drwxr-xr-x 2 root root 4096 Jan 10 13:32 selinux
drwxr-xr-x 2 root root 4096 Feb 21 2005 srv
drwxr-xr-x 9 root root 0 Jan 17 12:33 sys
drwxrwxrwt 3 root root 4096 Jan 17 11:22 tmp
drwxr-xr-x 14 root root 4096 Jan 10 13:34 usr
drwxr-xr-x 18 root root 4096 Jan 10 13:36 var

mmluv 01-18-2007 06:30 PM

I figured out the problem myself. All I had to do was to change the /etc/fstab to used the device instead of the label.


OLD Setup
============
LABEL=/1 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2



Net Setup
============
/dev/sda2 / ext3 defaults 1 1
/dev/sda1 /boot ext3 defaults 1 2


All is good now. Thanks for your help.


All times are GMT -5. The time now is 07:54 AM.