LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 06-03-2014, 07:00 PM   #1
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 332

Rep: Reputation: 3
Recovering from possibly corrupted (by pvcreate) boot partition


I had a dual boot system where I partitioned the HD: ~30 GB for Ubuntu 11.4 and ~47 GB for CentOS 6.5. I wanted to make a separate logical partition for /tmp and /home on the CentOS side. However, when I entered

Code:
sudo vgs
I got

Code:
No volume groups found
When I entered

Code:
sudo fdisk -l
I got

Code:
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8b8e8b8e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2            5953        9730    30336001    5  Extended
/dev/sda3              64        5953    47300608   83  Linux
/dev/sda5            5953        9600    29296640   83  Linux
/dev/sda6            9601        9730     1038336   82  Linux swap / Solaris

Partition table entries are not in disk order
I entered

Code:
$ sudo pvcreate /dev/sda1
  Physical volume "/dev/sda1" successfully created
Now, after doing further reading, it appears that this has likely corrupted the boot partition. The computer still appears to be working fine but I am worried it will not boot up if I have to reboot it. I did see instructions here about repairing a corrupted boot partition here. Is that what I need to do or could I just copy files from the installation DVD to /boot? I was able to explore the /boot directory using places:Computer.

Many thanks in advance,
OH
 
Old 06-03-2014, 08:03 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Well, that depends:
- what do you see when you browse /boot ?.

Let's see the output from these (some will need root/sudo on Centos)
Code:
df -hT
ls -l /boot
file -s /dev/sda1
blkid
 
1 members found this post helpful.
Old 06-03-2014, 08:34 PM   #3
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 332

Original Poster
Rep: Reputation: 3
Thank you very much for your reply.

Quote:
Originally Posted by syg00 View Post
Well, that depends:
- what do you see when you browse /boot ?.
Code:
$ ls -R /boot
/boot:
config-2.6.32-431.11.2.el6.i686         initramfs-2.6.32-431.17.1.el6.i686.img  System.map-2.6.32-431.17.1.el6.i686
config-2.6.32-431.17.1.el6.i686         initramfs-2.6.32-431.el6.i686.img       System.map-2.6.32-431.el6.i686
config-2.6.32-431.el6.i686              symvers-2.6.32-431.11.2.el6.i686.gz     vmlinuz-2.6.32-431.11.2.el6.i686
efi                                     symvers-2.6.32-431.17.1.el6.i686.gz     vmlinuz-2.6.32-431.17.1.el6.i686
grub                                    symvers-2.6.32-431.el6.i686.gz          vmlinuz-2.6.32-431.el6.i686
initramfs-2.6.32-431.11.2.el6.i686.img  System.map-2.6.32-431.11.2.el6.i686

/boot/efi:
EFI

/boot/efi/EFI:
redhat

/boot/efi/EFI/redhat:
grub.efi

/boot/grub:
device.map     ffs_stage1_5      jfs_stage1_5    reiserfs_stage1_5  stage2           xfs_stage1_5
e2fs_stage1_5  grub.conf         menu.lst        splash.xpm.gz      ufs2_stage1_5
fat_stage1_5   iso9660_stage1_5  minix_stage1_5  stage1             vstafs_stage1_5
Quote:
Originally Posted by syg00 View Post
Let's see the output from these (some will need root/sudo on Centos)
Code:
df -hT
ls -l /boot
file -s /dev/sda1
blkid
Code:
$ sudo df -hT
Filesystem     Type   Size  Used Avail Use% Mounted on
/dev/sda3      ext4    45G  4.6G   38G  11% /
tmpfs          tmpfs  500M  324K  499M   1% /dev/shm
$ sudo ls -l /boot
total 66052
-rw-r--r--. 1 root root   109958 Mar 25 13:41 config-2.6.32-431.11.2.el6.i686
-rw-r--r--. 1 root root   109958 May  7 17:15 config-2.6.32-431.17.1.el6.i686
-rw-r--r--. 1 root root   109953 Nov 21  2013 config-2.6.32-431.el6.i686
drwxr-xr-x. 3 root root     4096 Mar 25 19:19 efi
drwxr-xr-x. 2 root root     4096 Jun  1 15:21 grub
-rw-------. 1 root root 16253348 Apr 27 23:00 initramfs-2.6.32-431.11.2.el6.i686.img
-rw-------. 1 root root 16272539 Jun  1 15:21 initramfs-2.6.32-431.17.1.el6.i686.img
-rw-------. 1 root root 16209999 Mar 25 19:29 initramfs-2.6.32-431.el6.i686.img
-rw-r--r--. 1 root root   190151 Mar 25 13:42 symvers-2.6.32-431.11.2.el6.i686.gz
-rw-r--r--. 1 root root   190219 May  7 17:16 symvers-2.6.32-431.17.1.el6.i686.gz
-rw-r--r--. 1 root root   190104 Nov 21  2013 symvers-2.6.32-431.el6.i686.gz
-rw-r--r--. 1 root root  1983422 Mar 25 13:41 System.map-2.6.32-431.11.2.el6.i686
-rw-r--r--. 1 root root  1983426 May  7 17:15 System.map-2.6.32-431.17.1.el6.i686
-rw-r--r--. 1 root root  1982877 Nov 21  2013 System.map-2.6.32-431.el6.i686
-rwxr-xr-x. 1 root root  4004544 Mar 25 13:41 vmlinuz-2.6.32-431.11.2.el6.i686
-rwxr-xr-x. 1 root root  4003232 May  7 17:15 vmlinuz-2.6.32-431.17.1.el6.i686
-rwxr-xr-x. 1 root root  4002656 Nov 21  2013 vmlinuz-2.6.32-431.el6.i686
$ sudo file -s /dev/sda1
/dev/sda1: LVM2 (Linux Logical Volume Manager) , UUID: 3w4BJcaz4wyY6t3CkS2p2lxDRIAkfct
$ sudo blkid
/dev/sda1: UUID="3w4BJc-az4w-yY6t-3CkS-2p2l-xDRI-AkfctS" TYPE="LVM2_member" 
/dev/sda3: UUID="ccc57a57-71bd-4dc7-9e03-2101d0c7250a" TYPE="ext4" 
/dev/sda5: UUID="Y3ggGF-hVjw-PF5Y-ai9h-jNjN-R8aF-3taxPO" TYPE="LVM2_member" 
/dev/sda6: UUID="bdfe2d90-d3c5-44b7-926a-ee5bd1fb1858" TYPE="swap"
Thanks again,
OH
 
Old 06-03-2014, 08:48 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
So your CentOS system is ok as it didn't mount /dev/sda1.
It may still not be bootable, depending on what system was the "owner" of the MBR. I'd be guessing Ubuntu as it's generally better at finding other operating systems than RHEL/Centos was last I looked. From CentOS, go here, and do as it says and post the RESULTS.txt so we can see the boot layout.
 
1 members found this post helpful.
Old 06-03-2014, 09:04 PM   #5
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 332

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by syg00 View Post
So your CentOS system is ok as it didn't mount /dev/sda1.
It may still not be bootable, depending on what system was the "owner" of the MBR. I'd be guessing Ubuntu as it's generally better at finding other operating systems than RHEL/Centos was last I looked.
I meant to say that I was running CentOS when I ran pvcreate.

Quote:
Originally Posted by syg00 View Post
From CentOS, go here, and do as it says and post the RESULTS.txt so we can see the boot layout.
Code:
$ cat RESULTS.txt
                  Boot Info Script 0.61      [1 April 2012]


============================= Boot Info Summary: ===============================

 => Grub Legacy0.97 is installed in the MBR of /dev/sda and looks at sector 
    26647216 on boot drive #1 for the stage2 file.  A stage2 file is at this 
    location on /dev/sda.  Stage2 looks on partition #3 for 
    /boot/grub/grub.conf..

sda1: __________________________________________________________________________

    File system:       LVM2_member
    Boot sector type:  -
    Boot sector info: 

sda2: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  Unknown
    Boot sector info: 

sda5: __________________________________________________________________________

    File system:       LVM2_member
    Boot sector type:  -
    Boot sector info: 

sda6: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info: 

sda3: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  CentOS release 6.5 (Final) 
                       Kernel on an
    Boot files:        /boot/grub/menu.lst /boot/grub/grub.conf /etc/fstab

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *          2,048     1,026,047     1,024,000  83 Linux
/dev/sda2          95,629,310   156,301,311    60,672,002   5 Extended
/dev/sda5          95,629,312   154,222,591    58,593,280  83 Linux
/dev/sda6         154,224,640   156,301,311     2,076,672  82 Linux swap / Solaris
/dev/sda3           1,026,048    95,627,263    94,601,216  83 Linux


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/sda1        3w4BJc-az4w-yY6t-3CkS-2p2l-xDRI-AkfctS LVM2_member 
/dev/sda3        ccc57a57-71bd-4dc7-9e03-2101d0c7250a   ext4       
/dev/sda5        Y3ggGF-hVjw-PF5Y-ai9h-jNjN-R8aF-3taxPO LVM2_member 
/dev/sda6        bdfe2d90-d3c5-44b7-926a-ee5bd1fb1858   swap       

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/sda3        /                        ext4       (rw)


========================== sda3/boot/grub/grub.conf: ===========================

--------------------------------------------------------------------------------
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,2)
#          kernel /boot/vmlinuz-version ro root=/dev/sda3
#          initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-431.17.1.el6.i686)
	root (hd0,2)
	kernel /boot/vmlinuz-2.6.32-431.17.1.el6.i686 ro root=UUID=ccc57a57-71bd-4dc7-9e03-2101d0c7250a nomodeset rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_NO_LVM rd_NO_DM rhgb quiet
	initrd /boot/initramfs-2.6.32-431.17.1.el6.i686.img
title CentOS (2.6.32-431.11.2.el6.i686)
	root (hd0,2)
	kernel /boot/vmlinuz-2.6.32-431.11.2.el6.i686 ro root=UUID=ccc57a57-71bd-4dc7-9e03-2101d0c7250a nomodeset rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_NO_LVM rd_NO_DM rhgb quiet
	initrd /boot/initramfs-2.6.32-431.11.2.el6.i686.img
title CentOS (2.6.32-431.el6.i686)
	root (hd0,2)
	kernel /boot/vmlinuz-2.6.32-431.el6.i686 ro root=UUID=ccc57a57-71bd-4dc7-9e03-2101d0c7250a nomodeset rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_NO_LVM rd_NO_DM rhgb quiet
	initrd /boot/initramfs-2.6.32-431.el6.i686.img
--------------------------------------------------------------------------------

=============================== sda3/etc/fstab: ================================

--------------------------------------------------------------------------------

#
# /etc/fstab
# Created by anaconda on Tue Mar 25 19:01:40 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=ccc57a57-71bd-4dc7-9e03-2101d0c7250a /                       ext4    defaults        1 1
UUID=bdfe2d90-d3c5-44b7-926a-ee5bd1fb1858 swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
--------------------------------------------------------------------------------

=================== sda3: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)

  12.643165588 = 13.575495680   boot/grub/grub.conf                            1
  12.643165588 = 13.575495680   boot/grub/menu.lst                             1
  12.706501007 = 13.643501568   boot/grub/stage2                               1
   1.090335846 = 1.170739200    boot/initramfs-2.6.32-431.11.2.el6.i686.img    1
   2.043476105 = 2.194165760    boot/initramfs-2.6.32-431.17.1.el6.i686.img    2
   1.402793884 = 1.506238464    boot/initramfs-2.6.32-431.el6.i686.img         1
  12.867988586 = 13.816897536   boot/vmlinuz-2.6.32-431.11.2.el6.i686          1
  12.766685486 = 13.708124160   boot/vmlinuz-2.6.32-431.17.1.el6.i686          1
  12.730445862 = 13.669212160   boot/vmlinuz-2.6.32-431.el6.i686               1

======================== Unknown MBRs/Boot Sectors/etc: ========================

Unknown BootLoader on sda2

00000000  95 aa e4 34 06 68 5e 2c  07 a8 6f 8d 28 ce ee c1  |...4.h^,..o.(...|
00000010  93 b2 b7 6f 17 a6 6c 8f  66 48 45 bb 1c ec 0f 63  |...o..l.fHE....c|
00000020  9e 1b 3a c4 44 e6 47 a1  62 32 d3 88 93 28 f3 0e  |..:.D.G.b2...(..|
00000030  50 c2 cc f7 6a 15 fb c3  d4 2f 47 a5 89 c9 94 ea  |P...j..../G.....|
00000040  16 40 58 35 e0 f9 20 e1  94 fa e3 2a 95 fd 01 4a  |.@X5.. ....*...J|
00000050  ca b6 5e 2a 29 a7 ae 17  93 d9 4f 41 a1 cd 99 df  |..^*).....OA....|
00000060  0c e9 a5 40 a1 c9 71 f6  50 d9 1f 70 a6 e3 98 c7  |...@..q.P..p....|
00000070  99 fe 0b e8 89 be 8a 39  a2 62 9a 70 a6 6b 76 42  |.......9.b.p.kvB|
00000080  ba a0 50 71 4e ca 93 4b  34 be 5e ae fb 0d 98 76  |..PqN..K4.^....v|
00000090  6d 01 98 76 67 b2 dc f0  19 0c 4a 79 23 46 55 01  |m..vg.....Jy#FU.|
000000a0  0e 53 f4 6b 19 81 59 eb  86 79 d6 31 0f 9b 6d 77  |.S.k..Y..y.1..mw|
000000b0  10 a4 6f 59 da 6a 41 94  aa 02 1c 9e fb 67 bb 3c  |..oY.jA......g.<|
000000c0  55 f1 6d d2 8c 45 68 11  90 0b 88 30 03 ee f5 54  |U.m..Eh....0...T|
000000d0  55 80 c3 a8 3a bb 71 54  2f 8e 84 7a ed 31 0f 9a  |U...:.qT/..z.1..|
000000e0  f5 a1 70 c0 19 74 25 3a  1a a8 d8 23 ac 19 a0 be  |..p..t%:...#....|
000000f0  cf 66 5b 33 8b 7e 7f 08  f5 ce f8 06 ad bc ab 99  |.f[3.~..........|
00000100  61 ff a5 35 8e a5 a8 2d  06 f6 f7 c6 14 31 19 1f  |a..5...-.....1..|
00000110  51 26 9c 12 0e fa 00 66  57 03 f2 0b 1d cb 36 6c  |Q&.....fW.....6l|
00000120  94 d9 01 a6 af 16 a3 c9  ef e8 c5 58 b2 6b 15 a4  |...........X.k..|
00000130  80 d9 90 fe 53 a5 2a db  80 b6 c7 65 4d e7 db 16  |....S.*....eM...|
00000140  88 91 94 27 16 8b d1 94  ad d0 d7 53 7e 0f 81 74  |...'.......S~..t|
00000150  c8 47 95 68 15 6d 7f 94  8a 78 f2 5c 8c 43 58 2b  |.G.h.m...x.\.CX+|
00000160  de fe 27 e8 19 69 5f ad  64 61 45 17 1b cd 88 05  |..'..i_.daE.....|
00000170  23 b2 6e 81 43 16 30 ac  0c 1a f7 cb 98 d1 61 cd  |#.n.C.0.......a.|
00000180  1c 6c 81 85 36 f7 c3 93  bc 94 2e 4f e7 18 ff 99  |.l..6......O....|
00000190  28 c6 73 ce 63 3a ee c7  97 8b c9 9c d7 98 b8 ea  |(.s.c:..........|
000001a0  b8 c7 c9 5e 4a 45 cc 15  78 94 19 31 4e e1 85 ea  |...^JE..x..1N...|
000001b0  2e 6a 6d 3d bb 4c aa e0  87 21 d6 0b fb 72 00 fe  |.jm=.L...!...r..|
000001c0  ff ff 83 fe ff ff 02 00  00 00 00 10 7e 03 00 fe  |............~...|
000001d0  ff ff 05 fe ff ff 82 15  7e 03 80 b2 1f 00 00 00  |........~.......|
000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200


=============================== StdErr Messages: ===============================

mdadm: No arrays found in config file or automatically

$

Thanks again,
OH
 
Old 06-03-2014, 09:15 PM   #6
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 332

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by syg00 View Post
So your CentOS system is ok as it didn't mount /dev/sda1.
It may still not be bootable, depending on what system was the "owner" of the MBR. I'd be guessing Ubuntu as it's generally better at finding other operating systems than RHEL/Centos was last I looked. From CentOS, go here, and do as it says and post the RESULTS.txt so we can see the boot layout.
Sorry. I forgot to mention that I ran pvcreate on the Ubuntu partition as well and can no longer access it from CentOS.

Code:
$ sudo pvcreate /dev/sda1
  Physical volume "/dev/sda1" successfully created
$ sudo pvcreate /dev/sda2
  dev_is_mpath: failed to get device for 8:2
  dev_is_mpath: failed to get device for 8:2
  Device /dev/sda2 not found (or ignored by filtering).
$ sudo pvcreate /dev/sda3
  Can't open /dev/sda3 exclusively.  Mounted filesystem?
$ sudo pvcreate /dev/sda5
  dev_is_mpath: failed to get device for 8:5
  Physical volume "/dev/sda5" successfully created
$ sudo pvcreate /dev/sda6
  dev_is_mpath: failed to get device for 8:6
  Can't open /dev/sda6 exclusively.  Mounted filesystem?
 
Old 06-03-2014, 09:22 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
So you are deliberately trying to corrupt your running system ?. Not much point trying to help.

Looking at that bootinfo, your system should be bootable. How long it stays that way is likely debatable.
 
Old 06-03-2014, 09:28 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,694

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
So as stated it appears that you didn't damage CentOS and it only consists of sda3 and sda6 (swap). I assume that Ubuntu was the other partition(s) and those were probably corrupted when you ran the pvcreate command. ( I see that you already figured that one out)

Did you want to keep Ubuntu? Did you want to create a LVM or just additional logical partitions? It appears that the disk does not have any free space and if you want to create additional logical partitions your going to have to shrink sda3.

Last edited by michaelk; 06-03-2014 at 09:30 PM.
 
1 members found this post helpful.
Old 06-03-2014, 09:32 PM   #9
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 332

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by syg00 View Post
So you are deliberately trying to corrupt your running system ?. Not much point trying to help.

Looking at that bootinfo, your system should be bootable. How long it stays that way is likely debatable.
My previous post was about what I did early Monday morning in Australia. That was before I realized that pvcreate was destructive. I should have included that info. in my initial post but did not think it was relevant until the discussion turned to the Ubuntu partition and I noticed that sda5 was an LVM2_member.

Thanks,
OH
 
Old 06-03-2014, 09:43 PM   #10
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 332

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by michaelk View Post
So as stated it appears that you didn't damage CentOS and it only consists of sda3 and sda6 (swap). I assume that Ubuntu was the other partition(s) and those were probably corrupted when you ran the pvcreate command. ( I see that you already figured that one out)

Did you want to keep Ubuntu? Did you want to create a LVM or just additional logical partitions? It appears that the disk does not have any free space and if you want to create additional logical partitions your going to have to shrink sda3.
Ubuntu is what I had been using before I installed CentOS. My computer is c. 2001 and does not handle any versions of Ubuntu later than 11.4. I suspect it doesn't handle lighdm but I may be wrong. Ubuntu had been sharing the disk with Windows XP. I replaced the Win XP part with Centos 6.5. I had been keeping Ubuntu just in case I needed a file that I had forgotten to back up.

I wanted to create an LVM because I ran the Lynis audit and it suggested having a separate partition for /tmp and for /home. I thought that the best thing would be to put them into their own logical volumes. I am very new to LVMs having first heard of them a week or two ago so my decisions have not been optimal. Another computer, with Centos 6.5 installed, already have LVM set up so I was able to shrink one of the logical volumes and make another logical volume for /temp.

Could I set up the new logical volumes on the old Ubuntu partition?

Thanks,
OH

Last edited by OtagoHarbour; 06-03-2014 at 09:45 PM.
 
Old 06-03-2014, 09:57 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,694

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Yes. One advantage with LVM is that the space of both partitions can be combined. CentOS does have a GUI management tool called system-config-lvm to make things easier.

Last edited by michaelk; 06-03-2014 at 09:58 PM.
 
1 members found this post helpful.
Old 06-04-2014, 11:18 AM   #12
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
pvcreate will have overwritten the first 8 KB of any filesystem where it ran successfully. For ext2/3/4 filesystems, e2fsck should be able to recover from that by using a backup super block.
Code:
e2fsck /dev/sda1
e2fsck /dev/sda5
FYI, there is no simple way to convert a partition with an existing filesystem to an LVM member. Stop trying.

Last edited by rknichols; 06-04-2014 at 11:20 AM.
 
1 members found this post helpful.
Old 06-04-2014, 09:44 PM   #13
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 332

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by rknichols View Post
pvcreate will have overwritten the first 8 KB of any filesystem where it ran successfully. For ext2/3/4 filesystems, e2fsck should be able to recover from that by using a backup super block.
Code:
e2fsck /dev/sda1
e2fsck /dev/sda5
I ran those commands (with sudo). Initially I got a bunch of messages like
Code:
Free inodes count wrong for group #200 (8176, counted=5651).
Fix<y>?
I hit return every time to accept the defaults. Now I get
Code:
$ sudo e2fsck /dev/sda1
e2fsck 1.41.12 (17-May-2010)
/dev/sda1: clean, 39/128016 files, 72255/512000 blocks
$ sudo e2fsck /dev/sda5
e2fsck 1.41.12 (17-May-2010)
/dev/sda5: clean, 419683/1831424 files, 5177249/7324160 blocks
$
However, I no longer see the Ubuntu system under the Places menu. It used to be under Computer (as something like 29 GB File System) but now there is nothing under Computer.

Quote:
Originally Posted by rknichols View Post
FYI, there is no simple way to convert a partition with an existing filesystem to an LVM member. Stop trying.
Should I give up on making a separate partition for /tmp? I think that Lynis suggested it to prevent a hacker from filling up my HD and making it unusable. Are there other ways to prevent his or could it be avoided with the right security?

Thanks,
OH
 
Old 06-05-2014, 09:15 AM   #14
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Re-run those e2fsck commands, but this time include the "-f" option to force a check even though the super block appears clean. You didn't need that option the first time because the filesystem was obviously broken (missing super block).

If the filesystem is OK, I'm not sure why your GUI file manager wouldn't see it. What does "sudo blkid" now report for /dev/sda5? You might just need to log out and back in again to get the list to refresh.

If you want to make a separate partition for /tmp, you will need to use a tool like gparted to shrink one of your existing partitions to make space for a new one. You will need to boot from a rescue disk to do that since some of the operations cannot be done on a mounted filesystem. I recommend SystemRescueCD for that. Note that rearranging partitions is always a dangerous operation and should only be done with a full backup available.
 
1 members found this post helpful.
Old 06-05-2014, 11:03 AM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,694

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Try manually mounting the partitions.
 
1 members found this post helpful.
  


Reply

Tags
boot from hd, centos6, pvcreate



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
Possibly corrupted partition table? CD1212 Linux - General 1 12-18-2009 03:37 PM
Ubuntu 9.x install corrupted NTFS partition; repair corrupted TrueCrypt partition halfer Linux - General 1 06-30-2009 02:59 PM
Cannot boot-need help recovering Fedora partition LVM rietsit Fedora 11 06-11-2009 04:44 PM
Recovering corrupted Partition marcusmercado Linux - Newbie 2 01-31-2009 07:56 PM
Possibly corrupted X-server. Treval Mandriva 1 01-31-2006 02:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

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