LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-29-2007, 10:38 PM   #1
neoskylla
LQ Newbie
 
Registered: Aug 2007
Location: Brazil
Posts: 8

Rep: Reputation: 0
Question Usual Linux install into usb (no live usb).


At this very moment I am trying to do a regular install of any linux distro into my usb stick. I found that 99,99% of the www content teaches to install a LIVE USB like a live-CD installation, and I really don’t want it.

Slackware installation cannot recognize my /dev/sda1 only /dev/hda1(b,c) and the Ubuntu start the installation but crashes in the half of the process.

I’d like to know if this installation is possible. Does anyone have a clue how to do this?
 
Old 08-30-2007, 02:25 AM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
If you find out why Slackware doesn't recognize your /dev/sda1 (whatever that might happen to be - details are imporant), then perhaps you can do the USB install.
 
Old 08-30-2007, 09:27 AM   #3
nan0meter
Member
 
Registered: Aug 2007
Location: The Netherlands
Distribution: Fedora 7 x86_64
Posts: 119

Rep: Reputation: 15
Did you mount it in slackware? And i don't know how big your USB stick is but maybe Ubuntu is to big.

You can try to install Damn Small Linux on it.
 
Old 08-30-2007, 11:17 AM   #4
neoskylla
LQ Newbie
 
Registered: Aug 2007
Location: Brazil
Posts: 8

Original Poster
Rep: Reputation: 0
My pendrive if a 4GB markvision (bad brand but works fine till now). I used gparted on a live-cd-ubuntu to create 2 partitions one ~3,5GB active ext3 and one ~500MB swap

Well people, somehow after defining the swap partition during the setup of slackware 12 the /dev/sda1 (this is my pendrive device) was recognized. Then I started the installation of slack… in the middle of the installation the setup throw many messages like this:

EXT3-fs error(device sda1): ext3_free_blocks: Freeing blocks not in datazone – block =4294967295, count = 1

The number 4294967295 changed but the message was the same to the other warnings…

The installation moved on! I selected before the minimum set of packages and everything apparently finished ok. Unfortunately after few minutes I discovered that the setup couldn’t make my pendrive bootable. I tried to do a grub-install to the device using ubuntu cd and then I got this:

Format of install_device not recognized

, A few weeks ago I was successful to make a PCLinuxOS Live and Ubuntu Live installation… but, I repeat, what I really want is a regular install into the usb. The ubuntu regular installation crashes and cannot complete the process.

I’ll keep looking for the solution, but I feel that I’m near to run out of resources…
 
Old 08-30-2007, 07:21 PM   #5
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
I'm not sure what you're saying there. Can you start the Slackware install by issuing "cfdisk /dev/sda" and then create your partitions? If so, use reiserfs and swap, and then at the proper time also format and check for bad blocks.
 
Old 09-09-2007, 05:06 PM   #6
neoskylla
LQ Newbie
 
Registered: Aug 2007
Location: Brazil
Posts: 8

Original Poster
Rep: Reputation: 0
Well, I was capable to mess more my situation! I installed slackware12 and couldn’t make the pendrive bootable, then I used fdisk to make the first partition active and installed the lilo in the pendrive… after this I was unable to boot, and surprisingly I discovered that after all, the partition table was corrupted !!!! And now I am unable to exclude, create, edit the partitions on pendrive, and can’t read it too.

Now I’m searching a tool to help me fix the partition table and clean de pendrive… I never could imagine that it could damage the device… fdisk and gparted can’t help me, and now I’m trying some windows tool… If someone knows a good free tool, tell me please.
 
Old 09-09-2007, 06:57 PM   #7
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
I'm having a small amount of trouble understanding what OS you have available, and how you have messed up the USB stick.

I will assume you have a working Linux distribution. If so, you can "fix" the USB drive, as I have had to do in the past.

First, open a terminal/konsole and login as root. Issue "tail -f /var/log/messages" and then plug in your USB drive - this will show you what your system does with the drive when you plug it in. Here is an example:
Code:
root@silas:~# tail -f /var/log/messages
Sep 10 04:10:27 silas -- MARK --
Sep 10 04:30:27 silas -- MARK --
Sep 10 04:50:27 silas -- MARK --
Sep 10 05:10:27 silas -- MARK --
Sep 10 05:30:27 silas -- MARK --
Sep 10 05:50:27 silas -- MARK --
Sep 10 06:10:27 silas -- MARK --
Sep 10 06:30:27 silas -- MARK --
Sep 10 06:50:27 silas -- MARK --
Sep 10 06:57:40 silas sudo:  mingdao : TTY=pts/1 ; PWD=/home/mingdao ; USER=root ; COMMAND=/bin/bash
Sep 10 06:58:00 silas kernel: usb 4-6: new high speed USB device using ehci_hcd and address 14
Sep 10 06:58:00 silas kernel: usb 4-6: configuration #1 chosen from 1 choice
Sep 10 06:58:00 silas kernel: scsi7 : SCSI emulation for USB Mass Storage devices
Sep 10 06:58:05 silas kernel: scsi 7:0:0:0: Direct-Access     Generic  STORAGE DEVICE   1.25 PQ: 0 ANSI: 0
Sep 10 06:58:05 silas kernel: SCSI device sdb: 512000 512-byte hdwr sectors (262 MB)
Sep 10 06:58:05 silas kernel: usb 4-6: reset high speed USB device using ehci_hcd and address 14
Sep 10 06:58:08 silas last message repeated 5 times
Sep 10 06:58:08 silas kernel: sdb: Write Protect is off
Sep 10 06:58:08 silas kernel: SCSI device sdb: 512000 512-byte hdwr sectors (262 MB)
Sep 10 06:58:08 silas kernel: usb 4-6: reset high speed USB device using ehci_hcd and address 14
Sep 10 06:58:11 silas last message repeated 5 times
Sep 10 06:58:11 silas kernel: sdb: Write Protect is off
Sep 10 06:58:12 silas kernel:  sdb: sdb1
Sep 10 06:58:12 silas kernel: sd 7:0:0:0: Attached scsi removable disk sdb
Sep 10 06:58:12 silas kernel: sd 7:0:0:0: Attached scsi generic sg1 type 0
From that exercise you will see which device the kernel has assigned. In my case, /dev/sdb. (NB: My primary hard drive is a SATA drive labeled /dev/sda -- if you have a PATA drive your USB disk might be /dev/sda. You must be certain to use the device representing your USB drive. What we are going to do will destroy all the data on whichever device you choose.)

Second, wipe the boot sector of the USB stick by issuing "dd if=/dev/zero of=/dev/sdb bs=512 count=1" (assuming your stick is sdb -- it might be sda)
Code:
root@silas:~# dd if=/dev/zero of=/dev/sdb bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.00567758 seconds, 90.2 kB/s
root@silas:~#
You should now see something like this when you issue "fdisk -l":
Code:
root@silas:~# fdisk -l

((here you will have your other hard drives, I removed my SATA drive where the OS is, labeled /dev/sda)

Disk /dev/sdb: 262 MB, 262144000 bytes
9 heads, 56 sectors/track, 1015 cylinders
Units = cylinders of 504 * 512 = 258048 bytes

Disk /dev/sdb doesn't contain a valid partition table
root@silas:~#
Third, you do NOT need to mount the device. You MUST know where it's located so that you can fix the partition table. Use cfdisk rather than fdisk. Here is the example:
Code:
root@silas:~# cfdisk /dev/sdb
That will open cfdisk with output similar to this:
Code:
cfdisk 2.12r Disk Drive: /dev/sdb Size: 262144000 bytes, 262 MB Heads: 9 Sectors per Track: 56 Cylinders: 1015 Name Flags Part Type FS Type [Label] Size (MB) --------------------------------------------------------------------------------------------------------------------------------------------------------------- Pri/Log Free Space 261.92 [Bootable] [ Delete ] [ Help ] [Maximize] [ Print ] [ Quit ] [ Type ] [ Units ] [ Write ] Toggle bootable flag of the current partition
There is no longer any partition table, so you will select "New" to create a New partition on the device. Your next choice will be to create a Primary or Logical partition. Choose "Primary" and then you will see something like "Size (in MB): 261.92" which should include the entire 4GB of your disk. Just press "Enter" for the purpose of fixing your drive. When it returns to the menu of choices, select "Type" and then type 0C (zero and capital C) for W95 FAT32 (LBA). Trust me on that choice -- if you want it to be readable and writable in both Linux and Windows. Next you select "Write" - don't select Bootable or anything else. The program will return:
Code:
"Are you sure you want write the partition table to disk? (yes or no):

                                                         Warning!!  This may destroy data on your disk!
Type "yes" and then press "Enter". You want to write the partition table and destroy any data on your disk. It doesn't work now, but will after you follow my tutorial. You will see "Writing partition table to disk..." and after some seconds (time may vary depending upon your computer) you will see the menu again. Now you select "Quit" and we will format that new partition table.

To see what you've got now, issue "fdisk -l" and you should see something like this:
Code:
root@silas:~# fdisk -l

(here you will have your other hard drives, I removed my SATA drive where the OS is, labeled /dev/sda)

Disk /dev/sdb: 262 MB, 262144000 bytes
9 heads, 56 sectors/track, 1015 cylinders
Units = cylinders of 504 * 512 = 258048 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1015      255752    c  W95 FAT32 (LBA)
You should have a partition table showing like that, though yours will be somewhat different because it's 4GB rather than my little 256MB disk. If so, move on to the next step -- formatting.

In that same terminal as root issue "/sbin/mkdosfs -F32 -v /dev/sdb1" and you should see something like this:
Code:
root@silas:~# /sbin/mkdosfs -F32 -v /dev/sdb1
mkdosfs 2.10 (22 Sep 2003)
/dev/sdb1 has 9 heads and 56 sectors per track,
logical sector size is 512,
using 0xf8 media descriptor, with 511504 sectors;
file system has 2 32-bit FATs and 1 sector per cluster.
FAT size is 3935 sectors, and provides 503602 clusters.
Volume ID is 46e47f7f, no volume label.
root@silas:~#
If the above worked, then you have just "fixed" your broken pen drive. To check it, mount and list the files and unmount it like this:
Code:
root@silas:~# mount -t vfat /dev/sdb1 /mnt/hd/
root@silas:~# ls -alh /mnt/hd/
total 512
drwxr-xr-x  2 root root 512 1970-01-01 07:00 ./
drwxr-xr-x 10 root root 272 2006-09-26 11:09 ../
root@silas:~# umount /mnt/hd/
root@silas:~#
Success!

NOTES:

1 - Since my flash drive was 256MB, and yours is 4GB, there might be differences. I believe FAT32 can handle a 4GB partition. Since yours doesn't work now, what have you got to lose?

2 - We are not concerned about installing to this disk right now, but just fixing it. So don't try and create other partitions.

3 - We are using cfdisk rather than fdisk, according to the fdisk manual page's recommendation:
Quote:
BUGS
There are several *fdisk programs around. Each has its problems and strengths. Try them in the order cfdisk, fdisk, sfdisk. (Indeed,
cfdisk is a beautiful program that has strict requirements on the partition tables it accepts, and produces high quality partition
tables. Use it if you can. fdisk is a buggy program that does fuzzy things - usually it happens to produce reasonable results. Its sin-
gle advantage is that it has some support for BSD disk labels and other non-DOS partition tables. Avoid it if you can. sfdisk is for
hackers only - the user interface is terrible, but it is more correct than fdisk and more powerful than both fdisk and cfdisk. Moreover,
it can be used noninteractively.)
Since fdisk's manual page specifically says "fdisk is a buggy program that does fuzzy things" and "Avoid it if you can," we only use it to list partitions by issuing "fdisk -l" but always work on disk's partitions with "cfdisk".

4 - This HOW-TO is only intended to fix your USB device, not to install an operating system. Since I don't know how to create a LIVE Linux on a USB stick, you should search <Linux> Google for that information. And follow their instructions, even if you don't agree. Your last attempt to do it your way failed.
 
Old 09-10-2007, 10:28 PM   #8
neoskylla
LQ Newbie
 
Registered: Aug 2007
Location: Brazil
Posts: 8

Original Poster
Rep: Reputation: 0
the instructions worked partially well. I describe what happened in the next lines:

Quote:

tail -f /var/log/messages
(...some text...)
Sep 10 20:13:12 neoskylla /usr/sbin/gpm[3111]: Started gpm successfully. Entered daemon mode.
(...pendrive plugged...)
Sep 10 20:28:01 neoskylla kernel: usb 1-4: new high speed USB device using ehci_hcd and address 4
Sep 10 20:28:01 neoskylla kernel: usb 1-4: configuration #1 chosen from 1 choice
Sep 10 20:28:01 neoskylla kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Sep 10 20:28:06 neoskylla kernel: scsi 2:0:0:0: Direct-Access USBest USB2FlashStorage 0.00 PQ: 0 ANSI: 2
Sep 10 20:28:06 neoskylla kernel: sd 2:0:0:0: Attached scsi removable disk sda
Sep 10 20:28:06 neoskylla kernel: sd 2:0:0:0: Attached scsi generic sg0 type 0

(...ctrl+C to get command prompt, wiping boot sector...)

bash-3.1# dd if=/dev/zero of=/dev/sda bs=512 count=1
dd: opening `/dev/sda': No medium found

(...sda not recognized...)

bash-3.1# dd if=/dev/zero of=/dev/sda1
dd: writing to `/dev/sda1': No space left on device
764201+0 records in
764200+0 records out
391270400 bytes (391 MB) copied, 2.48272 s, 158 MB/s

(...why sda1 was recognized? drive have 2 partitions, one reiser one swap...)

bash-3.1# dd if=/dev/zero of=/dev/sda2
dd: writing to `/dev/sda2': No space left on device
1+0 records in
0+0 records out
0 bytes (0 B) copied, 0.00033377 s, 0.0 kB/s

(...using fdisk, sda where is it? as u can see the pc has 2 hd...)

bash-3.1# fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 14592 117210208+ 7 HPFS/NTFS

Disk /dev/hdb: 80.0 GB, 80060424192 bytes
255 heads, 63 sectors/track, 9733 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 9561 76798701 83 Linux
/dev/hdb2 9562 9733 1381590 82 Linux swap
bash-3.1#


(...using cfdisk on sda...)

bash-3.1# cfdisk /dev/sda
...
FATAL ERROR: Cannot open disk drive
Press any key to exit cfdisk

(...using cfdisk on sda1...)

...
bash-3.1# cfdisk /dev/sda1
FATAL ERROR: Cannot get disk size
Press any key to exit cfdisk
...

I'll keep trying to get my pendrive healthy again.
Bruce Hill: thank you for the tutorial

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

my system:
A7V8X-X motherboard, Athlon XP 2400+, Geforce 6800XT, ~800MB RAM, 80GB/120GB IDE ATA 133 HDs, lilo boot-loader with first HD W2K3 Srv, second HD Slackware12

Last edited by neoskylla; 09-11-2007 at 09:14 PM.
 
Old 09-11-2007, 09:20 PM   #9
neoskylla
LQ Newbie
 
Registered: Aug 2007
Location: Brazil
Posts: 8

Original Poster
Rep: Reputation: 0
The oddest thing is that the pendrive is not hardware-damaged I believe… The device seems to be recognized, but I am not able to create a new MBR and a wealthy partition.
 
  


Reply



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
Please suggest me a Linux Live Distro (CD/DVD/USB)... asgarcymed Linux - Distributions 6 01-26-2007 04:39 AM
LXer: Ubuntu Linux Live CD: Save data & desktop information on USB device LXer Syndicated Linux News 0 07-06-2006 07:54 PM
External USB SB Live 24 with snd-usb-audio: mixer too rudimentary LaoNiu Linux - Hardware 0 05-28-2006 10:22 AM
HP Deskjet (USB) & CUPS & Slackware 9.1: Unable to open USB device "usb:/dev/usb/lp0&qu arnostienen Slackware 2 01-29-2004 03:22 PM
Install Deb from Live CD-No eject & no usb suguru Debian 4 12-30-2003 06:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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