- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: vi commands in Single user mode
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:29 AM
01-14-2004 05:29 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:32 AM
01-14-2004 05:32 AM
Re: vi commands in Single user mode
To use vi you must mount /var and /usr first.
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:34 AM
01-14-2004 05:34 AM
Re: vi commands in Single user mode
it's still in user, but is more self contained, where vi has some dependencies which also need to be available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:36 AM
01-14-2004 05:36 AM
Re: vi commands in Single user mode
Just do a "mount -a", then proceed as normal.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:36 AM
01-14-2004 05:36 AM
Re: vi commands in Single user mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:38 AM
01-14-2004 05:38 AM
Re: vi commands in Single user mode
How about a w! THEN a q?
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:41 AM
01-14-2004 05:41 AM
Re: vi commands in Single user mode
Thats strange. Does the bad disk contain vg00. You can try to move the /etc/fstab to /etc/fstab.org and create a new one. That one will be on different blocks. If so i hope you have mirroring.
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:42 AM
01-14-2004 05:42 AM
Re: vi commands in Single user mode
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:42 AM
01-14-2004 05:42 AM
Re: vi commands in Single user mode
The disk contains vg01.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:43 AM
01-14-2004 05:43 AM
Re: vi commands in Single user mode
How about
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:49 AM
01-14-2004 05:49 AM
Re: vi commands in Single user mode
esc esc then
shift : then
wq! or
w! or
write or
write!
The only things that works are wq! (which doesn't write it just quits), q, and q!. So, I can quit the editor I just can't write to the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:52 AM
01-14-2004 05:52 AM
Re: vi commands in Single user mode
The sed option:
#cat /etc/fstab | sed 's%/dev/vg01%#/dev/vg01%' >>/etc/fstab.new && mv /etc/fstab.new /etc/fstab
But is does not explain the vi, Jeff's remark can.
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:53 AM
01-14-2004 05:53 AM
Re: vi commands in Single user mode
They should be 644 - if not chmod it & try it again.
You only need the ! when there are no write perms on the file.
So you *should* be able to use just "w" w/o the bang.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 05:56 AM
01-14-2004 05:56 AM
Re: vi commands in Single user mode
After you check out the permissions, try writing to a test file just to make sure that it's not a problem with vi.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 06:03 AM
01-14-2004 06:03 AM
Re: vi commands in Single user mode
also, to save you can use shift ZZ NO COLON just shift ZZ gets you out if you had made changes... it saves and quits.
VI FAQ
http://www.faqs.org/faqs/editor-faq/vi/part2/
ZZ write (only if changes have been made) and quit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 06:24 AM
01-14-2004 06:24 AM
Re: vi commands in Single user mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 06:28 AM
01-14-2004 06:28 AM
Re: vi commands in Single user mode
The actual disk-to-VG map is in /etc/lvmtab - BUT you can't edit it as it's a binary file.
You can rename/move it & run vgscan -av to create a new file however.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 06:42 AM
01-14-2004 06:42 AM
Re: vi commands in Single user mode
How long does it take to create the new file? It's been chugging away now for about 10 minutes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 07:14 AM
01-14-2004 07:14 AM
Re: vi commands in Single user mode
It would not take long ( depending on the number of disks you have). You best start with a vgscan -vpa ( preview ) and it it makes a difference mv the lvmtab and recreate it.
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 07:32 AM
01-14-2004 07:32 AM
Re: vi commands in Single user mode
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 07:50 AM
01-14-2004 07:50 AM
Re: vi commands in Single user mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 08:00 AM
01-14-2004 08:00 AM
Re: vi commands in Single user mode
I wouldn't do a vgscan. Even after recreating the /etc/lvmtab, it is still going to complain that lvmtab had fewer disk whereas than kernel.
If vg00 is not affected, then you can edit /etc/lvmrc and make AUTO_VG_ACTIVATE=0. This will not enable volume groups during the boot process. Once the system is up, you can activate all the volume groups except vg01. You can replace the bad disk in vg01 and then run a vgcfgrestore to get rid of lvmtab issue. You will miss the data but that's the safeway to do it.
-Sri