[CentOS] Any alternative to Single User Mode

Mon Jun 15 04:33:27 UTC 2015
jd1008 <jd1008 at gmail.com>


On 06/14/2015 10:27 PM, Animesh Pandey wrote:
> On Sun, Jun 14, 2015 at 10:51 PM, jd1008 <jd1008 at gmail.com> wrote:
>
>>
>> On 06/14/2015 08:02 PM, Animesh Pandey wrote:
>>
>>> On Sun, Jun 14, 2015 at 9:47 PM, jd1008 <jd1008 at gmail.com> wrote:
>>>
>>>
>>>> On 06/14/2015 07:36 PM, Animesh Pandey wrote:
>>>>
>>>>   On Sun, Jun 14, 2015 at 9:06 PM, jd1008 <jd1008 at gmail.com> wrote:
>>>>>
>>>>>   On 06/14/2015 06:47 PM, Animesh Pandey wrote:
>>>>>>    I actually opened the Virtual Disk Image (.vdi) on
>>>>>>
>>>>>>> http://www.vmxray.com/
>>>>>>> .
>>>>>>> I could see that despite my disk being of 100GB only ~65GB was being
>>>>>>> shown.
>>>>>>> All the stuff related ot the local user was not visible at all.
>>>>>>> After I restarted my VM, the OS gets stuck here (
>>>>>>> http://i.stack.imgur.com/KVYxV.png). Even after trying the single
>>>>>>> user
>>>>>>> login it was stuck there. But the emergency mode worked alright.
>>>>>>>
>>>>>>> On Sun, Jun 14, 2015 at 8:37 PM, jd1008 <jd1008 at gmail.com> wrote:
>>>>>>>
>>>>>>>
>>>>>>>    On 06/14/2015 06:28 PM, Animesh Pandey wrote:
>>>>>>>
>>>>>>>>     Hi,
>>>>>>>>
>>>>>>>>   I am working on Centos6.6 on a VirtualBox on Windows Host. Today I
>>>>>>>>> started
>>>>>>>>> to have booting issues in the OS. It won't get past the loading
>>>>>>>>> screen.
>>>>>>>>> I
>>>>>>>>> checked and found that the files related to the user "cloudera" on
>>>>>>>>> the
>>>>>>>>> system were not accessible. Only the files related to root were
>>>>>>>>> accessible.
>>>>>>>>> This is why I was am not able to do a single user login but an
>>>>>>>>> emergency
>>>>>>>>> login was possible. This is just a guess.
>>>>>>>>> This all happened due to some update in the Virtual Machine that I
>>>>>>>>> use
>>>>>>>>> to
>>>>>>>>> run CentOS.
>>>>>>>>>
>>>>>>>>> Is there any workaround for this issue?
>>>>>>>>>
>>>>>>>>> Thanks and regards,
>>>>>>>>> Animesh Pandey
>>>>>>>>>
>>>>>>>>>     I wish you could provide more info.
>>>>>>>>>
>>>>>>>>>   How can you determine that inaccessibility to a user's
>>>>>>>> files will prevent centos from taking you all the way to
>>>>>>>> the login (or welcome) screen?
>>>>>>>>
>>>>>>>> I think something else is going on and my guess is that
>>>>>>>> the centos files themselves have been corruped.
>>>>>>>> Can you re-install centos ?
>>>>>>>>
>>>>>>>>    Please do not top-post.
>>>>>>>>
>>>>>>> I am having trouble following your terminology.
>>>>>> Emergency model?
>>>>>> On my centos installation, there is no "Emergency ...."
>>>>>> to select from the list of kernels to boot.
>>>>>>
>>>>>> Also, when you say "worked alright" do you
>>>>>> mean that you were able to access what you thought
>>>>>> was missing?
>>>>>> Can you go to full multiuser?
>>>>>>
>>>>>>
>>>>>>
>>>>>>    Sorry for top posting.
>>>>>>
>>>>> Let me give you a clearer idea.
>>>>>
>>>>> 1. My regular boot freezes after loading is completed.
>>>>> 2. I read on the internet that sometimes due to an update in VirtualBox,
>>>>> this error might occur. To rectify it, I must re-install VirtualBox's
>>>>> Guest
>>>>> Additions. For this, I require booting in a Single User Mode.
>>>>> 3. For that, I followed the correct steps as given here (
>>>>>
>>>>>
>>>>> https://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-rescuemode-booting-single.html
>>>>> ).
>>>>> But still the system froze on that same point.
>>>>> 4. Then I read about an Emergency mode which is even lower level to that
>>>>> of
>>>>> Single User mode. I was able to log in and see the files that I
>>>>> created/modified as root. I could not see any file/folder that related
>>>>> the
>>>>> local user "cloudera" on which I used to work. This is where I thought
>>>>> of
>>>>> seeing the contents of the Image using vmxray.com and found that a
>>>>> large
>>>>> part of the dick is not visible. This part contains that files related
>>>>> to
>>>>> "cloudera". I felt as if any information related to "cloudera" user has
>>>>> been lost.
>>>>>
>>>>> I basically need to access files that I made as "cloudera" on CENTOS and
>>>>> if
>>>>> possible re-install the Guest Additions that ma solve this issue. But
>>>>> for
>>>>> this I need to be able to boot as a Single User.
>>>>>
>>>>>   I assume you are using a virtual drive, which is a file on the host
>>>> machine (You said windows??? ).
>>>> If you can somehow use a tool to dump that disk image to
>>>> a real hard drive (for example using dd ), and connect
>>>> the hard drive a a working linux computer to run fsck on it
>>>> to see what it will find.
>>>> I assume you have no backup of your drive???
>>>>
>>>>
>>>> _______________________________________________
>>>> CentOS mailing list
>>>> CentOS at centos.org
>>>> http://lists.centos.org/mailman/listinfo/centos
>>>>
>>>>   Yes it is windows. By dumping a disk image do you mean a VDI (VirtualBox
>>> Disk Image). These are files that are used by VirtualBox for booting. I
>>> have a copy of that as well. Can Gparted be used for connecting that VDI?
>>>
>>>   You will more than likely need a conversion tool to convert a vdi
>> image to a normal HD image. I do not know of such a tool.
>>
>> Another possibility is to create another VM, install your linux on it
>> with it's own separate disk, but add you bad vdi disk
>> as a second drive. Once booted, use linux to fsck the second
>> drive.
>> Again, be sure you have a copy it before you connect it to this
>> new VM.
>>
>>
>> _______________________________________________
>> CentOS mailing list
>> CentOS at centos.org
>> http://lists.centos.org/mailman/listinfo/centos
>>
> I did exactly as you said. I used Gparted to create a secondary drive. I
> can do "/dev/" to see the four partitions that my original VM had. How do I
> go about it now?

So, the drive (you want to fix) is visible in the new vm.
Good.
be sure it is unmounted.
As root, run fsck /dev/sd?
You supply the value of ?
Is it b or c ...?

fsck could end up deleting files or even truncating them
to shorter lengths if blocks that belong to those
files are no longer referenced in the file's inode.

Good luck